You are here: Communications Cloud API v1 > Resources > Subscriptions > Add a Subscription

Add a Subscription

POST to /api/account/ACCOUNT_CODE/subscriptions.xml

Example Input

For an email subscriber, the input should look like:

<subscriber>
  <email>EMAIL@ADDRESS.COM</email>
  <send-notifications type='boolean'>false</send-notifications>
  <topics type='array'>
    <topic>
      <code>####</code>
    </topic>
    <topic>
      <code>####</code>
    </topic>
  </topics>
</subscriber>

For a wireless subscriber, the input should look like:

<subscriber>
  <phone>###-###-####</phone>
  <country-code>#</country-code>
  <send-notifications type='boolean'>false</send-notifications>
  <topics type='array'>
    <topic>
      <code>####</code>
    </topic>
    <topic>
      <code>####</code>
    </topic>
  </topics>
</subscriber>
Elements
Example Output
<?xml version="1.0" encoding="UTF-8"?>
<subscriber>
  <to-param>ZW1haWxAdGVzdC5nb3ZkZWxpdmVyeS5jb20=</to-param>
  <link rel="self" href="/api/account/TOR_TEST/subscribers/ZW1haWxAdGVzdC5nb3ZkZWxpdmVyeS5jb20="/>
  <subscriber-uri>/api/account/ACCOUNT_CODE/subscribers/ZW1haWxAdGVzdC5nb3ZkZWxpdmVyeS5jb20=</subscriber-uri>
</subscriber>
Example PHP Code
Troubleshooting

Reference subscriber error codes

 

Was this page helpful? Can't find what you need? Let us know