UpdateConsumer
The UpdateConsumer API method allows one to create “email only” registered members in the FM database.
Parameters
• member – A collection of member attributes in the XML format. See Remarks for the detailed description
• token – An encrypted string constructed using the passed-in parameters and the partner-specific “shared secret” provided by the Frankly Media. Unless requested differently by the partner, the MD5 hashing algorithm is used to produce the token. For the purpose of this call the following formula should be used: md5(ExSiteCode + Email + timestamp + SubIDList + shared secret). ExSiteCode and Email are attributes of the member parameter (see Remarks for details). For the generic example refer to this article.
• Timestamp – Verification timestamp. UTC time of the client call. Must be in the following format: YYYYMMDDHHmmss
Note: SubIdList is a string composed of SubscriptionID1 + OptIn1 + SubscriptionID2 + OptIn2 + SubscriptionIDN + OptInN. SubIdList can be left out of the token if Subscription information will not be sent with the request.
For example: “123true456true789false” where 123, 456, and 789 are valid subscription ID’s
API URL
https://api.enticent.com/Subscriptions.svc/UpdateConsumer
How to call
This request is an http post. The contenttype attribute must be set to application/XML. The body of the post must be in the following format:
<UpdateConsumer xmlns=”http://www.franklymedia..com/ISubscriptions” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
<member xmlns:a=”http://www.franklymedia.com/datacontract/XinbanClientMemberEx” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
<a:PartnerCode>StickyFish</a:PartnerCode>
<a:ExSiteCode>Friend</a:ExSiteCode>
<a:Email>[email protected]</a:Email>
<a:Gender>F</a:Gender>
<a:Zip>31562</a:Zip>
<a:DefaultSubscriptions>true</a:DefaultSubscriptions>
<a:DOB>10/10/1970</a:DOB>
<a:Source />
<a:Subscriptions xmlns:b=”http://www.tritonloyalty.com/datacontract/SubscriptionInfo”>
<b:SubscriptionInfo>
<b:SubscriptionID>1234</b:SubscriptionID>
<b:OptIn>true</b:OptIn>
</b:SubscriptionInfo>
<b:SubscriptionInfo>
<b:SubscriptionID>5678</b:SubscriptionID>
<b:OptIn>false</b:OptIn>
</b:SubscriptionInfo>
<b:SubscriptionInfo>
<b:SubscriptionID>9101112</b:SubscriptionID>
<b:OptIn>false</b:OptIn>
</b:SubscriptionInfo>
…
…
…
</a:Subscriptions>
</member>
<token>6687eebff05824f530dec20e15be8eb3</token>
<timestamp>20100615161000</timestamp>
</UpdateConsumer>
Note: The Subscriptions XML shown above is optional and can be excluded (see examples)
Return value
<SynchResponse xmlns=”http://schemas.datacontract.org/2004/07/ListenerAPI.DataObjects” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
<Status>FAILED</Status>
<MemberID i:nil=”true”/>
<Message>Call expired</Message>
<StatusCode>500</StatusCode>
</SynchResponse>
Status: “SUCCESS” or “FAILED”
StatusCode: 200, 400 or 500 (200 means no errors, it was successfully processed. 400 means client error, and 500 means system error)
Message: error message
MemberID: will be filled if it was successfully processed. And this is the FM member id you may want to hold on for future use.
Remarks
The member parameter has the following set of attributes. The attributes are listed in the order, in which they are expected to appear when the structure is posted to the API.
Values that are required or used in the generation of the token parameter are highlighted.
• PartnerCode – Required. Partner identifier issued by Frankly Media
• ExSiteCode – Required. Used for the token generation. Partner’s unique identifier of the site
• Email – Required. Used for the token generation.
• Gender – (optional) Use the following format: M or F
• Zip – Required. User’s zip/postal code.
•DefaultSubscriptions – (optional) This can be used to override automatic subscribing to all subscriptions which are set to ‘defaulted on’. By default when a new user is created, that user is automatically subscribed to any subscription that is set up as ‘defaulted on’. To prevent the user from being automatically subscribed to ‘defaulted on’ subscriptions use the value “false”. This only applies to creation of new records and has no affect on updates since users are not automatically subscribed during an update.
• DOB – (optional) Member date of birth in the following format: mm/dd/yyyy or yyyy/mm/dd.
• Source – (optional) maximum length: 50 characters.
• Subscriptions – (optional) This allows a registration to include information about which subscriptions to op-in / opt-out of. Contains one or more SubscriptionInfo structures. Each SubscriptionInfo tag contains two sub-tags: SubscriptionID and OptIn. SubscriptionID simply contains the unique identifier for a subscription, while OptIn indicates whether or not to subscribe to that particular item.
Examples
See documentation on UpdateMember for example of using PHP to call the API
API call without subscription information:
<UpdateConsumer xmlns=”http://www.franklymedia.com/ISubscriptions” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
<member xmlns:a=”http://www.franklymedia.com/datacontract/XinbanClientMemberEx” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
<a:PartnerCode>StickyFish</a:PartnerCode>
<a:ExSiteCode>Friend</a:ExSiteCode>
<a:Email>[email protected]</a:Email>
</member>
<token>6687eebff05824f530dec20e15be8eb3</token>
<timestamp>20100615161000</timestamp>
</UpdateConsumer>