Update a marketing campaign
curl --request PATCH \
--url https://api.scribe-mail.com/v1/marketing_campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"marketing_campaign": {
"name": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"time_zone": "<string>",
"send_email": true,
"content": {
"id": "<string>",
"visible": true,
"type": "stack",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"children": [
{
"id": "<string>",
"visible": true,
"type": "text",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"tokens": [
{
"id": "<string>",
"type": "textToken",
"value": "<string>",
"smartFieldUuid": "<string>",
"textStyle": {
"fontSize": 123,
"color": "<string>",
"lineHeight": 5
},
"href": {
"text": "<string>",
"smartFieldUuid": "<string>"
}
}
],
"displayName": "<string>"
}
],
"displayName": "<string>"
},
"smart_fields_conditions": [
[
{
"smart_field_id": "<string>",
"values": [
"<string>"
]
}
]
],
"signature_template_ids": [
"<string>"
]
}
}
'import requests
url = "https://api.scribe-mail.com/v1/marketing_campaigns/{id}"
payload = { "marketing_campaign": {
"name": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"time_zone": "<string>",
"send_email": True,
"content": {
"id": "<string>",
"visible": True,
"type": "stack",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"children": [
{
"id": "<string>",
"visible": True,
"type": "text",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"tokens": [
{
"id": "<string>",
"type": "textToken",
"value": "<string>",
"smartFieldUuid": "<string>",
"textStyle": {
"fontSize": 123,
"color": "<string>",
"lineHeight": 5
},
"href": {
"text": "<string>",
"smartFieldUuid": "<string>"
}
}
],
"displayName": "<string>"
}
],
"displayName": "<string>"
},
"smart_fields_conditions": [[
{
"smart_field_id": "<string>",
"values": ["<string>"]
}
]],
"signature_template_ids": ["<string>"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
marketing_campaign: {
name: '<string>',
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
time_zone: '<string>',
send_email: true,
content: {
id: '<string>',
visible: true,
type: 'stack',
blockStyle: {
marginBottom: 123,
marginRight: 123,
marginLeft: 123,
marginTop: 123,
paddingLeft: 123,
paddingRight: 123,
paddingTop: 123,
paddingBottom: 123,
backgroundColor: '<string>',
gap: 123,
width: 123
},
children: [
{
id: '<string>',
visible: true,
type: 'text',
blockStyle: {
marginBottom: 123,
marginRight: 123,
marginLeft: 123,
marginTop: 123,
paddingLeft: 123,
paddingRight: 123,
paddingTop: 123,
paddingBottom: 123,
backgroundColor: '<string>',
gap: 123,
width: 123
},
tokens: [
{
id: '<string>',
type: 'textToken',
value: '<string>',
smartFieldUuid: '<string>',
textStyle: {fontSize: 123, color: '<string>', lineHeight: 5},
href: {text: '<string>', smartFieldUuid: '<string>'}
}
],
displayName: '<string>'
}
],
displayName: '<string>'
},
smart_fields_conditions: [[{smart_field_id: '<string>', values: ['<string>']}]],
signature_template_ids: ['<string>']
}
})
};
fetch('https://api.scribe-mail.com/v1/marketing_campaigns/{id}', 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.scribe-mail.com/v1/marketing_campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'marketing_campaign' => [
'name' => '<string>',
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'time_zone' => '<string>',
'send_email' => true,
'content' => [
'id' => '<string>',
'visible' => true,
'type' => 'stack',
'blockStyle' => [
'marginBottom' => 123,
'marginRight' => 123,
'marginLeft' => 123,
'marginTop' => 123,
'paddingLeft' => 123,
'paddingRight' => 123,
'paddingTop' => 123,
'paddingBottom' => 123,
'backgroundColor' => '<string>',
'gap' => 123,
'width' => 123
],
'children' => [
[
'id' => '<string>',
'visible' => true,
'type' => 'text',
'blockStyle' => [
'marginBottom' => 123,
'marginRight' => 123,
'marginLeft' => 123,
'marginTop' => 123,
'paddingLeft' => 123,
'paddingRight' => 123,
'paddingTop' => 123,
'paddingBottom' => 123,
'backgroundColor' => '<string>',
'gap' => 123,
'width' => 123
],
'tokens' => [
[
'id' => '<string>',
'type' => 'textToken',
'value' => '<string>',
'smartFieldUuid' => '<string>',
'textStyle' => [
'fontSize' => 123,
'color' => '<string>',
'lineHeight' => 5
],
'href' => [
'text' => '<string>',
'smartFieldUuid' => '<string>'
]
]
],
'displayName' => '<string>'
]
],
'displayName' => '<string>'
],
'smart_fields_conditions' => [
[
[
'smart_field_id' => '<string>',
'values' => [
'<string>'
]
]
]
],
'signature_template_ids' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scribe-mail.com/v1/marketing_campaigns/{id}"
payload := strings.NewReader("{\n \"marketing_campaign\": {\n \"name\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"time_zone\": \"<string>\",\n \"send_email\": true,\n \"content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"smart_fields_conditions\": [\n [\n {\n \"smart_field_id\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n ],\n \"signature_template_ids\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.scribe-mail.com/v1/marketing_campaigns/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"marketing_campaign\": {\n \"name\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"time_zone\": \"<string>\",\n \"send_email\": true,\n \"content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"smart_fields_conditions\": [\n [\n {\n \"smart_field_id\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n ],\n \"signature_template_ids\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scribe-mail.com/v1/marketing_campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"marketing_campaign\": {\n \"name\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"time_zone\": \"<string>\",\n \"send_email\": true,\n \"content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"smart_fields_conditions\": [\n [\n {\n \"smart_field_id\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n ],\n \"signature_template_ids\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"send_email": true,
"content": {},
"smart_fields_conditions": [
[
{
"smart_field_id": "<string>",
"values": [
"<string>"
]
}
]
],
"signature_template_ids": [
"<string>"
],
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"time_zone": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>"
},
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"allowed": [
"<unknown>"
],
"missing": [
"<string>"
]
}
]
}Marketing campaigns
Update a marketing campaign
PATCH
/
v1
/
marketing_campaigns
/
{id}
Update a marketing campaign
curl --request PATCH \
--url https://api.scribe-mail.com/v1/marketing_campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"marketing_campaign": {
"name": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"time_zone": "<string>",
"send_email": true,
"content": {
"id": "<string>",
"visible": true,
"type": "stack",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"children": [
{
"id": "<string>",
"visible": true,
"type": "text",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"tokens": [
{
"id": "<string>",
"type": "textToken",
"value": "<string>",
"smartFieldUuid": "<string>",
"textStyle": {
"fontSize": 123,
"color": "<string>",
"lineHeight": 5
},
"href": {
"text": "<string>",
"smartFieldUuid": "<string>"
}
}
],
"displayName": "<string>"
}
],
"displayName": "<string>"
},
"smart_fields_conditions": [
[
{
"smart_field_id": "<string>",
"values": [
"<string>"
]
}
]
],
"signature_template_ids": [
"<string>"
]
}
}
'import requests
url = "https://api.scribe-mail.com/v1/marketing_campaigns/{id}"
payload = { "marketing_campaign": {
"name": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"time_zone": "<string>",
"send_email": True,
"content": {
"id": "<string>",
"visible": True,
"type": "stack",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"children": [
{
"id": "<string>",
"visible": True,
"type": "text",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"tokens": [
{
"id": "<string>",
"type": "textToken",
"value": "<string>",
"smartFieldUuid": "<string>",
"textStyle": {
"fontSize": 123,
"color": "<string>",
"lineHeight": 5
},
"href": {
"text": "<string>",
"smartFieldUuid": "<string>"
}
}
],
"displayName": "<string>"
}
],
"displayName": "<string>"
},
"smart_fields_conditions": [[
{
"smart_field_id": "<string>",
"values": ["<string>"]
}
]],
"signature_template_ids": ["<string>"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
marketing_campaign: {
name: '<string>',
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
time_zone: '<string>',
send_email: true,
content: {
id: '<string>',
visible: true,
type: 'stack',
blockStyle: {
marginBottom: 123,
marginRight: 123,
marginLeft: 123,
marginTop: 123,
paddingLeft: 123,
paddingRight: 123,
paddingTop: 123,
paddingBottom: 123,
backgroundColor: '<string>',
gap: 123,
width: 123
},
children: [
{
id: '<string>',
visible: true,
type: 'text',
blockStyle: {
marginBottom: 123,
marginRight: 123,
marginLeft: 123,
marginTop: 123,
paddingLeft: 123,
paddingRight: 123,
paddingTop: 123,
paddingBottom: 123,
backgroundColor: '<string>',
gap: 123,
width: 123
},
tokens: [
{
id: '<string>',
type: 'textToken',
value: '<string>',
smartFieldUuid: '<string>',
textStyle: {fontSize: 123, color: '<string>', lineHeight: 5},
href: {text: '<string>', smartFieldUuid: '<string>'}
}
],
displayName: '<string>'
}
],
displayName: '<string>'
},
smart_fields_conditions: [[{smart_field_id: '<string>', values: ['<string>']}]],
signature_template_ids: ['<string>']
}
})
};
fetch('https://api.scribe-mail.com/v1/marketing_campaigns/{id}', 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.scribe-mail.com/v1/marketing_campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'marketing_campaign' => [
'name' => '<string>',
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'time_zone' => '<string>',
'send_email' => true,
'content' => [
'id' => '<string>',
'visible' => true,
'type' => 'stack',
'blockStyle' => [
'marginBottom' => 123,
'marginRight' => 123,
'marginLeft' => 123,
'marginTop' => 123,
'paddingLeft' => 123,
'paddingRight' => 123,
'paddingTop' => 123,
'paddingBottom' => 123,
'backgroundColor' => '<string>',
'gap' => 123,
'width' => 123
],
'children' => [
[
'id' => '<string>',
'visible' => true,
'type' => 'text',
'blockStyle' => [
'marginBottom' => 123,
'marginRight' => 123,
'marginLeft' => 123,
'marginTop' => 123,
'paddingLeft' => 123,
'paddingRight' => 123,
'paddingTop' => 123,
'paddingBottom' => 123,
'backgroundColor' => '<string>',
'gap' => 123,
'width' => 123
],
'tokens' => [
[
'id' => '<string>',
'type' => 'textToken',
'value' => '<string>',
'smartFieldUuid' => '<string>',
'textStyle' => [
'fontSize' => 123,
'color' => '<string>',
'lineHeight' => 5
],
'href' => [
'text' => '<string>',
'smartFieldUuid' => '<string>'
]
]
],
'displayName' => '<string>'
]
],
'displayName' => '<string>'
],
'smart_fields_conditions' => [
[
[
'smart_field_id' => '<string>',
'values' => [
'<string>'
]
]
]
],
'signature_template_ids' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scribe-mail.com/v1/marketing_campaigns/{id}"
payload := strings.NewReader("{\n \"marketing_campaign\": {\n \"name\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"time_zone\": \"<string>\",\n \"send_email\": true,\n \"content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"smart_fields_conditions\": [\n [\n {\n \"smart_field_id\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n ],\n \"signature_template_ids\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.scribe-mail.com/v1/marketing_campaigns/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"marketing_campaign\": {\n \"name\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"time_zone\": \"<string>\",\n \"send_email\": true,\n \"content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"smart_fields_conditions\": [\n [\n {\n \"smart_field_id\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n ],\n \"signature_template_ids\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scribe-mail.com/v1/marketing_campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"marketing_campaign\": {\n \"name\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"time_zone\": \"<string>\",\n \"send_email\": true,\n \"content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"smart_fields_conditions\": [\n [\n {\n \"smart_field_id\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n ],\n \"signature_template_ids\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"send_email": true,
"content": {},
"smart_fields_conditions": [
[
{
"smart_field_id": "<string>",
"values": [
"<string>"
]
}
]
],
"signature_template_ids": [
"<string>"
],
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"time_zone": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>"
},
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"allowed": [
"<unknown>"
],
"missing": [
"<string>"
]
}
]
}Was this page helpful?
⌘I