NOTE

  • To use of any of our APIs, you need to call one mandatory API in which you have to post your API code, and you will get credentials from it, like payload and token.
  • While you use any of rest API you have to use this payload and token for Authentication.


Steps & Credentials for accessing API


Step 1: Request URL:

Step 2: Post Data:

  • Data must be in JSON format like below
      {"api_code":"*****"}

Step 3: Response:

  • Response format is json
       {
       "success": true,
       "message": "Credential load successfully.",
       "token": "92.8d870944f4541xxxxxxxxxxx",
       "payload":
       "eyJ0eXAiOiJqd3QiLCJhbGciOxxxxxxxxxxxxxxxxxxxxxxx"
       }

Endpoints

restapi.awarathon.com/api/get_credential


Example

Postdata

$post_array = array(api_code'=>"*****");

$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($post_array));
curl_setopt($curl, CURLOPT_URL, 'https://restapi.awarathon.com/api/get_credential');
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

$result = curl_exec($curl);


Response

{
"success": true,
"message": "Credential load successfully.",
"token": "92.8d870944f4541xxxxxxxxxxxxxxxxx",
"payload": "eyJ0eXAiOiJqd3QiLCJhbGciOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}