Generating access token for B2B API

To use the APIs listed in SIMPPLR B2B API DOCUMENTATION, you will need an access token.

To get the access token, you can use the OAuth token URL received after configuring the client application with the client credentials grant type. Use the following curl to get the access token:

curl --request POST \
     --url https://platform.dev.simpplr.xyz/v1/identity/oauth/token \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "grant_type": "client_credentials",
  "client_id": "replace-client-id",
  "client_secret": "replace-client-secret"
}
'

The response will look something like

{
    "access_token": <your access token>
}

You can also pass scope param in the request payload. Allowed values:

  • read - in case you only want to access read resources. (GET API calls and in some case where POST is being used for searching resources)
    • This is default scope.
  • write - in case you want to access writing resources. (POST, PUT, DELETE API calls)
  • everything - allows both read, write operations

Use the token

Now you can use this token in the authorization header to hit the B2B APIs.

curl --request GET \
     --url https://platform.dev.simpplr.xyz/v1/b2b/identity/users \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <your access token>'