Frankly Media API
The API provides access to various data elements pertaining to member and site records in the Frankly Media database. For Single Sign On functionality please refer to the Frankly Media SSO topic. For database synchronization and registration refer to this article. Integration options for Text-Messaging providers are covered here.
In order to use this API, following requirements must be met:
- A unique partner identifier must be assigned by Frankly Media
- A shared key corresponding to the partner name must be issued by Frankly Media
- IPs of the calling servers must be white listed by Frankly Media
- All calls will have to be accompanied by a secure token parameter. The token is hash of a string which is the result of concatenation of all the parameters. Unless requested by the partner otherwise, MD5 hashing algorithm is used. Refer to the example below.
Security Token Parameter
This example is provided with the assumption that the calling method signature is (string dateSince, string siteID, string partnername, string hash) ‘sharedSecret’ is a string known to both parties. C#:
using System.Security.Cryptography;
MD5CryptoServiceProvider x = new MD5CryptoServiceProvider();
byte[] dataBytes = System.Text.Encoding.ASCII.GetBytes(string.Format(“{0}{1}{2}”, dateSince, siteID, sharedSecret));
string result = BitConverter.ToString(x.ComputeHash(dataBytes));
The “result” will be compared to the passed in ‘hash’ value.
$parameters = “dateSince” + “siteID” + “sharedSecret”;
$key = md5($parameters,true);
$result = base64_encode($key);
The “result” will be compared to the passed in ‘hash’ value.
Remarks
If an error occurs on any API call, the service will issue a message in the following format:
<SynchError xmlns=”http://schemas.datacontract.org/2004/07/ListenerAPI.DataObjects” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”><messageText>Start Date parameter is not a valid date.</messageText></SynchError>