The Rest API supports the ability to manage Subscriptions to Lists for Contacts that already exist. The Rest API URI for the Subscriptions resource is in the format:
https://[siteurl]/rest/subscriptions
Commands
API Commands for Subscription management include:
|
Name |
HTTP Method |
Endpoint |
Description |
|
POST |
/rest/subscriptions |
Create a Subscription for a Contact to a List |
|
|
Update Subscription |
PUT |
/rest/subscription/{subscriptionId} |
Update the format of a Subscription |
|
Delete Subscription by Subscription ID |
DELETE |
/rest/subscriptions/{subscriptionId} |
Delete specific Subscription for a Contact on a List |
|
DELETE |
/rest/subscriptions |
Delete specific Subscription for a Contact on a List by JSON object |
|
|
GET |
/rest/lists/{listID}/subscribers |
Get details for all Contacts in a List. Does not return Subscription ID. |
|
|
GET |
/rest/subscribers/{subscriberId}/subscriptions |
Get all Subscriptions for a Contact by Contact ID. Includes each Subscription ID. |
|
|
GET |
/rest/subscribers/{customerKey}/subscriptions |
Get all Subscriptions for a Contact by Customer Key. Includes each Subscription ID. |
Related Commands:
In the Rest API Lists resource, the following command associated with Subscribers are also available:
Subscription Data Fields
The following data fields may be set and viewed.
|
Field Name |
Methods |
Description |
Type |
Example |
|
Contact ID |
POST, GET, DELETE |
Unique identifier of the Contact |
Integer |
"subscriberId": [subscriberId] |
|
Subscription ID |
GET, DELETE |
Identifier of the Subscription to the List |
Integer |
"subscriptionId": [subscriptionId] |
|
List ID |
POST, GET, DELETE |
Unique Identifier of the List. |
Integer |
"listId": [listId] |
|
List Name |
POST, GET, DELETE |
Unique Name of the List. |
String |
"listName": [listName] |
|
Subscription Format |
POST, PUT, PATCH, GET |
The preferred format of the email message content to send.
|
Integer |
"formatId": [formatId] |
|
Subscription Created Date |
GET |
Date Subscription to List first created. |
Date/Time |
"createdDate": "Mar 23, 2016 12:45:04 PM" |
|
Realm ID |
GET |
Identifier of the Realm in which the Contact exists. |
Integer |
"realmId": [realmId] |
|
|
POST, DELETE, GET |
Email address of the Contact. |
String |
"email": "[email]" |
|
Customer Key |
POST, DELETE, GET |
Unique identifier for the Contact in Realms in which Customer Key is required. |
String |
"customerKey": "[customerKey]" |
|
First Name |
POST, DELETE, GET |
Contact first name |
String |
"firstName": "[firstName]" |
|
Last Name |
GET |
Contact last name. |
String |
"lastName": "[lastName]" |
|
Company |
GET |
Contact company. |
String |
"company": "[company]" |
|
Address 1 |
GET |
Contact address part 1. |
String |
"address1": "[address1]" |
|
Address 2 |
GET |
Contact address part 2. |
String |
"address": "[address2]" |
|
City |
GET |
Contact city. |
String |
"city": "[city]" |
|
State |
POST, PUT, GET |
Contact state, four character limit. |
String |
"state": "[stat]" |
|
Zip |
POST, PUT, GET |
Contact zip or postal code. |
String |
"zip": "[zip]" |
|
Country |
GET |
Contact country. |
String |
"country": "[country]" |
|
Phone |
GET |
Contact phone number. |
String |
"phone": "[phone]" |
|
Fax |
GET |
Contact fax number. |
String |
"fax": "[fax]" |
|
Contact Created Date |
GET |
Date Contact record first created. |
Date/Time |
"createdDate": "Mar 23, 2016 12:45:04 PM" |
|
Contact Updated Date |
GET |
Date Contact record last updated. |
Date/Time |
"updatedDate": "Mar 23, 2016 12:45:04 PM" |
|
MD5 Encryption |
GET |
Encrypted Contact identifier. |
String |
"md5Encryption": "[md5Encryption]" |
|
SHA1 Encryption |
GET |
Encrypted Contact identifier. |
String |
"sha1Encryption": "[sha1Encryption]" |
|
IP Address |
GET |
Contact IP Address from last Open or Click tracking event. |
String |
"ipAddress": "[ipAddress]" |
|
Custom Fields |
GET |
Custom data stored for Contact. |
String, Integer, Float, Date |
"customFieldName": "string"
|
|
Skip |
GET |
Parameter to retrieve next set of results. See Pagination for more details. |
Integer |
"skip": 0 |
|
Max |
GET |
Max is not in use. |
Integer |
"max": 0 |