AirFinderAirFinder API Guide API OverviewAuthenticating Restful API

Authenticating Restful API

This article details how to authenticate the Restful API of AirFinder.

Authentication of the Restful API is a step step process as shown above.

1. Post a request to https://app.airfinder.com/login

URL:  https://app.airfinder.com/login
Method: POST
Headers : Content-Type = application/json
Request: 
{
"username":"<<EMAIL>>",
"password":"<<PASSWORD>>"
}
Response:
Success :
{
"code": 200,
    	"data": {
        	"account_id": <<ACCOUNT_ID>>,
        	"token": <<ACCESS_TOKEN>>
    	},
    	"message_text": "success"
}
Error :
{
    	"code": 400,
    	"message_text": "Invalid password"
}

Here is an example using http://requestmaker.com/

Here is the response:

2. The user can access the limited resources by passing token in the header.

URL:  https://app.airfinder.com/<<URI>>
Method: DELETE/GET/POST/PUT
Headers : Content-Type = application/json
Request: 
	Header - Parameters
		token: <<ACCESS_TOKEN>>
		x-mobile:true
		Content-type:”application/json”
	Body
{
"FIELD 1":<<FIELD1>>,
"FIELD 2":<<FIELD2>>
...
"FIELD N":<<FIELDN>>
}
	Response:
		Success :
{
"code": 200,
  	"data": [],
 	"message_text": "Success"
}

Error :
<h1>Unauthorized</h1>
<p>The server could not verify that you are authorized to access the URL
    requested. You either supplied the wrong credentials (e.g. a bad password),
    or your browser doesn't understand how to supply the credentials required.</p>

Here is an example using http://requestmaker.com/

0 Comments

Add your comment

E-Mail me when someone replies to this comment