Request Parameters and Encoding
The SocialAdr API gives you, as a developer, the ability to create web or mobile applications that use the SocialAdr platform.
OAuth 2.0 is used: http://oauth.net/2/
More details about this process are described under Authorization Page.
The API attempts to embrace the RESTful design principles.
Each api method URL corresponds to a resource. The HTTP method (aka. verb) is used to specify the operation. A GET request is used to retreive data. A POST request may add, update or destroy data. The DELETE method is also accepted for methods that destroy data. API methods usually require particular HTTP methods. Such requirements are documented for each method.
The API only accepts and returns text encoded in UTF-8.
The API uses standard HTTP query string to pass parameters. Parameters are required to be properly URL encoded.
The API attempts to returns meaningful HTTP status codes for each request. Possible codes are:
The response body contains data in the JSON format - a light weight serialization format for structured data.
Sign up for the developer program to gain access to the ability to create apps.
https://socialadr.com/pg/apps/developers
Go to the Create App page:
https://socialadr.com/pg/apps/create
Fill out the form to apply for API access for your application. We will notify you when your application has been approved. When creating an App, you’ll specify a “Redirect URI”, which is the URL of the landing page described in Authorization Page.
Once your app has been approved, you need to get its App ID, Client ID, and Client Secret. These can by going to the Manage Apps page, then clicking the “Manage” button for your app.
Now you’re ready to connect to the SocialAdr API.
Your first interaction with the SocialAdr API will be setting up an Authorization Page. The Authorization page is a page in your app that users are redirected to when they have authorized your app. When users are redirected to this page, we append a query string parameter with an Access Code.
If you have an Authorization Page URL of
http://www.yourapp.com/authorized.php |
We will redirect users to
http://www.yourapp.com/authorized.php?code=USERSAUTHCODE |
Once you have the user’s Authorization Code, you must exchange it for an Access Token by making an API call to the SocialAdr oauth grant method.
Typically, you would now save the Access Token and Refresh Token in your app’s database, so that you can connect to the SocialAdr API, as this user, whenever needed.
Using the Access Token you’ve just received and saved for this user, you can now make API calls to access their SocialAdr data.
The list and details of all API Methods is available here:
https://socialadr.com/pg/apps/api-methods
Access tokens expire after a set period of time (currently 1 hour). When you receive an Access Token, you should also be given a Refresh Token. You will want to save both. The Refresh Token is used to get a new Access Token when the old one has expired.
Sample Response
|