POST to /api/account/ACCOUNT_CODE/subscribers.xml
<subscriber> <email>EMAIL@ADDRESS.COM</email> <send-notifications type='boolean'>false</send-notifications> <digest-for>#</digest-for> </subscriber> -- OR -- <subscriber> <phone>###-###-####</phone> <country-code>#</country-code> <send-notifications type='boolean'>false</send-notifications> </subscriber>
<email> | The subscriber's email address. |
<phone> | The subscriber's phone number. |
<country-code> | The subscriber's country code. You can leave this blank to use the default country code set for your account, although we highly recommend setting the code (1 for United States, 44 for United Kingdom). To check the country code for your account, contact support@granicus.com. |
<send-notifications> | This field requires a value of either True or False and the type="boolean" attribute. Set this field to true send an email notification to the subscriber that their record has been updated. |
<digest-for> |
This field requires a number value and the type="integer" attribute. Use it to set the frequency for how often the subscriber receives bulletins. Possible values are:
|
<id> | This field indicates the subscriber ID. Omit it from the input to allow the system to generate the subscriber's ID. If you include the field in your input, it requires a number value and the type="integer" attribute. If you set the value to an ID that has already been used, the call will return an error. |
<link> | The link fields return URIs to see additional information about the subscriber, such as their category subscriptions, topic subscriptions, etc. |
<?xml version='1.0' encoding='UTF-8'?> <subscriber> <to-param>SUBSCRIBER_ID</to-param> <link rel="self" href="/api/account/ACCOUNT_CODE/subscribers/SUBSCRIBER_ID" /> </subscriber>
The example below uses curl.
curl -s -D- -X POST -u 'username':'password' -d@subscription_create.txt -H 'Content-Type: text/xml' https://stage-api.govdelivery.com/api/account/<ACCOUNT_CODE>/subscriptions.xml
Reference subscriber error codes
Was this page helpful? Can't find what you need? Let us know