Developer / Netlog REST API / Authentication Guide
Before the application can make its requests to the API server, it first has to be authenticated. This document describes the steps necessary for authenticating the application.
1. Forward the user to the login page
Before you can authenticate the application, the user has to be logged into the Netlog website. Therefor, you need to redirect the user to http://api.netlog.com/go/api/login/arguments
- Required arguments
- The application id provided by Netlog.
- Version of the API, should be "1.0" for this version
- Optional arguments
Has to be urlencoded.
After the user logs in, the user will be forwarded to the callback page. When the next parameter is specified, it will be appended to the callback page.
Also, the ticket, the apiServer and the language will be appended to this URL.
Upon authentication of the user, he will be redirected to:
callback + next + separator + ticket=ticket + '&' + apiServer=apiServer + '&' + language=language
separator: '?' or '&' depending of the occurrence of '?' in callback + next
- Nickname of the user.
Remark: Netlog consists of a number of independent distributions for different languages. When you forward the user to the login page, we will redirect him/her (based on our cookies) to the correct distribution.
However, when the nickname is specified we will redirect the user to the distribution associated with that nickname.
For example, you can redirect the user to http://api.netlog.com/go/api/login/app_id=YourAppID&version=1.0
After the user has logged in, he will be redirected to http://www.mycallbackpage.com/?ticket=theTicket&apiserver=theServer
The apiServer is the server where all following calls have to be made to. The ticket is needed in the following step of the authentication guide.
Netlog consists of several different distributions in different languages. Therefor, the language (distribution) of the logged in user is also returned. This way, you can build your application in different languages and output the correct language based on the language returned by the authentication.
2. Calling API methods
From now on, all calls should be done to the API Server. This is returned to your callback page through the GET variable apiServer after the user has successfully logged in on the Netlog website.
The URL to make all API calls to is apiServer/action=callMethod&arguments
- Optional arguments
- Should be XML, JSON or JSON2. Standard output format is XML.
All other variables required to call a method should be done by POST.