Verification is done by the “/token” method. The grant_type parameter should be entered as “password”, the “username” parameter should be the API user name, and the “password” parameter should be the password of the owned API user.

If the response code is 200 (OK) as a result of the request, the “access_token” and “token_type” parameters that should be used when making requests to the methods, and the “expires_in” parameter that indicates when the token will expire, is found in the response body.

In case of an incorrect request, an error message and error code will be received.

Authentication Sample Code(C#)
private static IRestResponse GetToken()
{
RestClient client = new RestClient("http://host.flexxii.com/");
RestRequest request = new RestRequest("token", Method.POST);
request.AddParameter("grant_type", "password");
request.AddParameter("username", username);
request.AddParameter("password", password);
IRestResponse response = client.Execute(request);
return response;
}
Was this helpful?
0 / 0