Follow

Update List

The Update List command allows you to make changes to an existing List.  The command allows you to specify several properties of the List, such as From and Reply To addresses. See REST API List Overview for a table of List properties available to PUT.

PUT /lists/[listId]

https://[siteurl]/rest/lists/[listId]

Request Body Parameters

The Update List command requires the List ID defined within the URI in order to update a Normal List.  No additional fields are required in the JSON other than those to change, and can be found in the Data Fields table in Rest API List Overview.    

Request Body Example

Using Update List with all arguments, line breaks in JSON for readability:

curl --request PUT \ 
--url 'https://mail.mydomain.com/rest/lists/10' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'content-type: application/json' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--data '{ "listName": "myListUpdated", "listFromAddress": "from@mydomain.com", "listReplyToAddress": "replyto@mydomain.com", "listMailFromAddress": "bounce??EMAIL_REF??@mail.mydomain.com", "listDescription": "My Subscriber List Updated", "listAdminEmail": "myemail@mydomain.com", "listSubscribeEmailTemplateId": 0, "listUnsubscribeEmailTemplateId": 0, "listConfirmSubs": false, "listSendCourtesySubsEmail": false, "listSendCourtesyUnsubsEmail": false, "listConfirmationSubGoto": "", "listConfirmationUnsubGoto": "", "listTrackingReadEnabled": true, "listTrackingClickthroughEnabled": true, "listUseStickyCampaign": false, "ftafUseListFromAddress": false, "vmtaId": 0, "baseUrlId": 0, "unsubscribeHeaderEnabled": true, "defaultLifecycleCampaignId": 0, "defaultLifecycle": false, "unsubHeaderHttpValue": "", "unsubHeaderEmailValue": "mailto:unsub@mydomain.com", "listTemplateId": 42, "listFolderId": 2 }' \
--include

Response Body

The response returns all API available List Properties in JSON format.  Based on the example above, the response returns:


HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Content-Length: 926
Link: <https://mail.mydomain.com/rest/lists>;
Date: Rri, 17 Jun 2016 12:54:44 GMT
{
"listFromAddress": "from@mydomain.com"
"listReplyToAddress": "replyto@mydomain.com"
"listMailFromAddress": "bounce??EMAIL_REF??@mail.mydomain.com"
"listDescription": "My Subscriber List Updated"
"listAdminEmail": "myemail@mydomain.com"
"listCreatedDate": "Jun 17, 2016 12:54:44 PM"
"listUpdatedDate": "Jun 17, 2016 12:54:44 PM"
"parentTemplateId": 0
"isTemplate": false
"listSubscribeEmailTemplateId": 0
"listUnsubscribeEmailTemplateId": 0
"listConfirmSubs": false
"listSendCourtesySubsEmail": false
"listSendCourtesyUnsubsEmail": false
"listConfirmationSubGoto": ""
"listConfirmationUnsubGoto": ""
"listTrackingReadEnabled": true
"listTrackingClickthroughEnabled": true
"listUseStickyCampaign": false
"ftafUseListFromAddress": false
"vmtaId": 0
"baseUrlId": 0
"unsubscribeHeaderEnabled": true
"defaultLifecycleCampaignId": 0
"defaultLifecycle": false
"unsubHeaderHttpValue": ""
"unsubHeaderEmailValue": "mailto:unsub@mydomain.com"
"listId": 10
"listRealmId": 1561
"listTemplateId": 42
"type": 0
"listName": "myListUpdated"
"listFolderId": 2
"subscriberCountTotal": 0
"subscriberCountPlain": 0
"subscriberCountHtml": 0
"subscriberCountRss": 0
"subscriberCountMime": 0
"skip": 0
"max": 0
}

Error Response

Error Response Codes include both Client Errors (4xx) and Server Errors (5xx).  Descriptions of each can be found in Response Codes

For example, if the List Name is already in use, the error would appear as:

{
"error": "Cannot insert duplicate key row in object."
"status": "Internal Server Error"
"statusCode": 500
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk