To create a subscriber via the API, do an HTTP POST like so:
[ ~ ] $ curl -u 2dac9d3d93326f97da4845d407789da232514b28:X -H 'Content-Type: application/xml' -d '<subscriber><customer-id>8889</customer-id><screen-name>freddy</screen-name></subscriber>' https://spreedly.com/api/v4/meresheep/subscribers.xml
Here is the response:
<?xml version="1.0" encoding="UTF-8"?>
<subscriber>
<active type="boolean">false</active>
<active-until type="datetime">2008-02-21T19:04:28Z</active-until>
<billing-first-name></billing-first-name>
<billing-last-name></billing-last-name>
<card-expires-before-next-auto-renew type="boolean">false</card-expires-before-next-auto-renew>
<created-at type="datetime">2007-12-21T18:54:24Z</created-at>
<customer-id>8889</customer-id>
<eligible-for-free-trial type="boolean">true</eligible-for-free-trial>
<email></email>
<feature-level type="string">Pro</feature-level>
<lifetime-subscription type="boolean">false</lifetime-subscription>
<on-trial type="boolean">false</on-trial>
<recurring type="boolean">false</recurring>
<screen-name>freddy</screen-name>
<store-credit type="decimal">0.0</store-credit>
<subscription-plan-name>Super Pro Account</subscription-plan-name>
<token>1c08af7ef78f1a4b51127cf0ddfe7b2b24681b6c</token>
<updated-at type="datetime">2007-12-21T19:04:28Z</updated-at>
</subscriber>
If successful, a status code of 201 (Created) is returned. The xml of the newly created subscriber is returned as well. In addition, the Location header in the response will be set to the url of the newly created subscriber.
A 403 (Forbidden) status code is returned under the following circumstances:
A 422 (Unprocessable Entity) is returned if the subscriber you’re trying to create has a validation error.