Przejdź do treści

Update subscribers list

This method allows editing almost all settings of an existing subscriber list (including its name).

What can not be changed:

  • List type (regular/seed list)
  • List opt-in setting (single opt-in/double opt-in)
  • Confirmation and reminder emails (for double opt-in lists)

To execute the method, perform a HTTP PUT request on a „Lists” resource:

https://{Server address here}/Api/Lists/{List ID here}

You need a List ID to change list settings. List ID is returned when you use API to create a list. It can also be found in the web panel.

Request body should be XML with similar structure to one used for creating lists. See examples below.

When building XML request body, following rules are observed:

  • Settings that are omitted, will be left unchanged.
  • Settings that are present, but empty, will be cleared (unless they are required).
  • Settings that are present and not empty, will be updated.
  • All usual validation rules apply.

Example 1: simple request (changing only list name):

PUT http://api.dev.expertsender/Api/Lists/4398 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml
Content-Length: 148
Host: api.dev.expertsender
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<ApiRequest>
  <ApiKey>test_api_key1</ApiKey>
  <Data>
    <GeneralSettings>
      <Name>mylist</Name>
    </GeneralSettings>
  </Data>
</ApiRequest>

Example 2: full request with all possible options:

PUT http://api.dev.expertsender/Api/Lists/4398 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml
Content-Length: 1765
Host: api.dev.expertsender
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<ApiRequest>
  <ApiKey>test_api_key1</ApiKey>
  <Data>
    <GeneralSettings>
      <Name>mylist</Name>
      <FriendlyName>My Little List</FriendlyName>
      <Description>This is my little list for testing API</Description>
      <Language>en-US</Language>
      <Charset>UTF-8</Charset>
    <SubscriptionConfirmPageUrl>http://www.domain.com/confirm</SubscriptionConfirmPageUrl><SubscriptionThankYouPageUrl>http://www.domain.com/thankyou</SubscriptionThankYouPageUrl>
      <RemovalPageUrl>http://www.domain.com/removal</RemovalPageUrl>
      <PreferencesChangeUrl>http://www.domain.com/preferences</PreferencesChangeUrl>
    </GeneralSettings>
    <AddressSettings>
      <Company>ExpertSender</Company>
      <Address>Kwiatowa 2</Address>
      <Address2>m 10</Address2>
      <City>Gdynia</City>
      <ZipPostalCode>80-123</ZipPostalCode>
      <StateProvinceRegion>Pomorskie</StateProvinceRegion>
      <Country>Polska</Country>
    </AddressSettings>
    <SubscriberSettings>
      <DefaultSubscriberName>Dear Subscriber</DefaultSubscriberName>
      <DefaultSubscriberFirstname>Dear</DefaultSubscriberFirstname>
      <DefaultSubscriberLastname>Subscriber</DefaultSubscriberLastname>
      <FrequencyCappingTimeEmail>3</FrequencyCappingTimeEmail>
      <FrequencyCappingTimeSmsMms>3</FrequencyCappingTimeSmsMms>
      <DisableStandardMessageFooter>true</DisableStandardMessageFooter>
      <DisableListUnsubscribeHeader>true</DisableListUnsubscribeHeader>
      <AskBeforeUnsubscribing>true</AskBeforeUnsubscribing>
      <HideListInPreferenceCenter>true</HideListInPreferenceCenter>
    </SubscriberSettings>
    <DomainSettings>
      <ClickTrackingDomain>click.domain.com</ClickTrackingDomain>
    </DomainSettings>
  </Data>
</ApiRequest>

Example 3: clearing settings:

PUT http://api.dev.expertsender/Api/Lists/4398 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml
Content-Length: 264
Host: api.dev.expertsender
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<ApiRequest>
  <ApiKey>test_api_key1</ApiKey>
  <Data>
    <GeneralSettings>
      <FriendlyName></FriendlyName>
    </GeneralSettings>
    <SubscriberSettings>
      <DefaultSubscriberName></DefaultSubscriberName>
    </SubscriberSettings>
  </Data>
</ApiRequest>

Response

Successful request will return HTTP code 204 without any content:

HTTP/1.1 204 No Content
Cache-Control: private
Access-Control-Allow-Origin: *
Date: Thu, 19 Sep 2019 15:26:27 GMT
Na tej stronie
Do góry