curl --request GET \
--url https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"object": {
"activeDomain": "test.hs-sites.com",
"archived": false,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": {
"main": {
"boxed": false,
"isSingleColumnFullWidth": false,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": [
"module_160676180617911"
],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": [
"module-0-1-1"
],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": [
"module-1-1-1"
],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
}
},
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"templatePath": "@hubspot/email/dnd/plain_text.html",
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"hs_enable_module_padding": false,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": {
"value": ""
},
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"id": "38175169118",
"isPublished": false,
"isTransactional": false,
"language": "en",
"name": "My subject",
"publishDate": "2020-11-30T18:44:20.387Z",
"sendOnPublish": true,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": {
"officeLocationId": "5449392956"
},
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [
1
],
"include": [
5
]
},
"suppressGraymail": true
},
"type": "BATCH_EMAIL",
"updatedAt": "2020-11-30T18:44:20.384Z",
"updatedById": 3739732,
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
},
"updatedAt": "2023-11-07T05:31:56Z",
"user": {
"email": "<string>",
"fullName": "<string>",
"id": "<string>"
}
}
],
"total": 123,
"paging": {
"next": {
"after": "<string>",
"link": "<string>"
},
"prev": {
"before": "<string>",
"link": "<string>"
}
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Get revisions of a marketing email
Obtenez une liste de toutes les versions d’un e-mail marketing, chaque entrée incluant l’état complet de cette version particulière. Pour afficher la version la plus récente, triez par le paramètre updatedAt.
curl --request GET \
--url https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/marketing/v3/emails/{emailId}/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"object": {
"activeDomain": "test.hs-sites.com",
"archived": false,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": {
"main": {
"boxed": false,
"isSingleColumnFullWidth": false,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": [
"module_160676180617911"
],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": [
"module-0-1-1"
],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": [
"module-1-1-1"
],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
}
},
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"templatePath": "@hubspot/email/dnd/plain_text.html",
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"hs_enable_module_padding": false,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": {
"value": ""
},
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"id": "38175169118",
"isPublished": false,
"isTransactional": false,
"language": "en",
"name": "My subject",
"publishDate": "2020-11-30T18:44:20.387Z",
"sendOnPublish": true,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": {
"officeLocationId": "5449392956"
},
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [
1
],
"include": [
5
]
},
"suppressGraymail": true
},
"type": "BATCH_EMAIL",
"updatedAt": "2020-11-30T18:44:20.384Z",
"updatedById": 3739732,
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
},
"updatedAt": "2023-11-07T05:31:56Z",
"user": {
"email": "<string>",
"fullName": "<string>",
"id": "<string>"
}
}
],
"total": 123,
"paging": {
"next": {
"after": "<string>",
"link": "<string>"
},
"prev": {
"before": "<string>",
"link": "<string>"
}
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Supported products
Required Scopes
Required Scopes
Autorisations
The access token received from the authorization server in the OAuth 2.0 flow.
Paramètres de chemin
L'ID de l'e-mail marketing.
Paramètres de requête
Le jeton de curseur de pagination de la dernière ressource lue avec succès sera renvoyé en tant que propriété JSON paging.next.after d'une réponse paginée contenant plus de résultats.
La valeur du jeton de curseur pour obtenir l'ensemble précédent de résultats. Vous pouvez l'obtenir à partir de la propriété JSON paging.prev.before d'une réponse paginée contenant plus de résultats.
Le nombre maximum de résultats à afficher. Par défaut, 100.
Réponse
successful operation