Campaign Template
The campaign template record exposes a campaign template to REST web services.
This record:
-
is not a subrecord
-
contains the following subrecords:
-
fromEmail
-
replyToEmail
-
restrictToGroup
-
subscription
-
typeName
-
usesMedia
-
For more information about working with campaign templates in the UI, see Email Marketing Campaigns.
The REST API Browser includes information about the field names and field types of the campaign template record and about the HTTP methods, request parameters, and operations available to this record. For details, see the REST API Browser's campaign template reference page.
For information about using the REST API Browser, see The REST API Browser.
Record ID
The record ID for a campaign template REST record is campaigntemplate.
Prerequisites
You must enable the following features before you can use this record through REST web services:
-
Marketing Automation
-
Customer Relationship Management
-
CRM Template Categories
For more information, see Marketing Automation Overview.
Code Samples
The following samples show common actions for a campaign template.
POST Request
POST /services/rest/record/v1/campaigntemplate HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Content-Type: application/json
Authorization: OAuth realm="3619616",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="1.0",oauth_signature=""
Content-Length: 593
{
"content": "<p>Hello </p>\r\n<p>there.</p>",
"description": "Test description",
"emailAsSalesRep": true,
"fromEmail": {
"id": "crmregress@xxxxxx.com"
},
"fromName": "Test from name",
"isAutoConverted": false,
"isInactive": false,
"isPrivate": false,
"name": "Test template",
"replyToEmail": {
"id": "crmregress@xxxxxx.com"
},
"restrictToGroup": {
"id": "243"
},
"subject": "Test subject",
"subscription": {
"id": "2"
},
"trackStatistics": true,
"usesMedia": {
"id": false
}
}
GET Request
GET /services/rest/record/v1/campaigntemplate/1?expandSubResources=true HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Authorization: OAuth realm="3619616",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="1.0",oauth_signature=""
PATCH Request
PATCH /services/rest/record/v1/campaigntemplate/1 HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Content-Type: application/json
Authorization: OAuth realm="3619616",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="1.0",oauth_signature=""
Content-Length: 583
{
"content": "<p>Updated</p>\r\n<p>content</p>",
"description": "Test description updated",
"emailAsSalesRep": false,
"fromEmail": {
"id": "invalid@inv.netsuite.com"
},
"fromName": "Test from name updated",
"isAutoConverted": true,
"isInactive": true,
"isPrivate": true,
"name": "Test template updated",
"replyToEmail": {
"id": "invalid@inv.netsuite.com"
},
"subject": "Test subject updated",
"subscription": {
"id": "1"
},
"trackStatistics": false,
"usesMedia": {
"id": true
}
}
DELETE Request
DELETE /services/rest/record/v1/campaigntemplate/1 HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Authorization: OAuth realm="3619616",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="1.0",oauth_signature=""