The setsubscriptions API is used to set subscriptions to mailing lists, campaigns, and knowledge base articles.
UI Reference: The API is called when the save button is clicked on the Contact Subscriptions page. See https://www.iservice.info/guides/users/contact-subscriptions.html.
URI: webapp-api-custinfo?api=setsubscriptions
Access Rights Required: All users, but contacts may only set subscriptions for their own contact ID.
The request includes the IDs of the mailing lists, campaigns, and articles that will be set for the contact.
Name |
Type |
Description |
---|---|---|
contactID |
number |
This parameter represents the ID of the user. |
subscriptions |
Object |
This parameter represents the user’s subscriptions values. |
listID |
Array |
This is a list of ids with active subscriptions to mailing lists or mailing campaigns. Campaigns are prefaced with the string campaign-. |
optoutIDs |
Array |
This is a list of ids for mailing lists or mailing campaigns to which the contact has Opted Out. Campaigns are prefaced with the string campaign-. |
articleIDs |
Array |
This is a list of knowledge base article ids with active subscriptions. |
{ "contactID": 4, "subscriptions": { "listIDs": [ "3", "1", "10", "6", "campaign-1" ], "optoutIDs": [ "campaign-2" ], "articleIDs": [ "91" ] } } |
Name |
Type |
Description |
---|---|---|
errors |
Array |
An array of strings. Returns the error message if an error is encountered, otherwise a blank array if there is no error. |
errorsDetails |
Array |
An array of strings. Provides detailed information about the error encountered, otherwise returns a blank array if no error is encountered. |
{ |