getAccessToken - www-getstorify-com/getstorify-offers-php-sdk GitHub Wiki

(Since v1.x)

getAccessToken - This will validate the user AppID and fetch access token.

Get access token

Call the getAccessToken() method and it will fetch an accesstoken for you from the GS (GetStorify) server.

$accessTokenResult = $GetStorifyOffersObj->getAccessToken();

On success, you will get the following response.

{
  "status": "success",
  "code": 200,
  "success": {
    "appid": "123",
    "userid": "gs123",
    "domain": "https://example.com",
    "accesstoken": "abcdef1234567890fedcba"
  }
}

The accesstoken sent by the server will be used to make API requests.

On error, you will get the following response.

{
  "status": "error",
  "code": 403,
  "message": "Authentication failed",
  "error": "Forbidden"
}

If you are getting an error response then please make sure you have entered the correct credentials.