Deep Link

Client Credentials Token

The client can request an access token using only its client credentials (or other supported means of authentication) when the client is requesting access to the protected resources under its control, or those of another resource owner that have been previously arranged with the authorization server (the method of which is beyond the scope of this specification). To make this token request, send a HTTP POST request below.

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('{ClientID provided by Mobifinance}&client_secret={ClientSecret provided by Mobifinance}&grant_type={client_credentials}');

$body = new http\Message\Body;
  'Content-Type' => 'application/x-www-form-urlencoded'


$response = $client->getResponse();
echo $response->getBody();
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");

RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{ClientID provided by Mobifinance}&client_secret={ClientSecret provided by Mobifinance}&grant_type={client_credentials}")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")

Response response = client.newCall(request).execute();
Method POST
Content-Type application/x-www-form-urlencoded
Parameters Type Required Description
client_id string Yes Client ID provided by Mobifinance
client_secret string Yes Client secret provided by Mobifinance
grant_type string Yes As defined in the OAuth 2.0 specification, this field must contain a value of client_credentials.
Parameters Type Description
access_token string The token that can be send to API. Next step APIs will be called using this token.
token_type string Token type. (Bearer) (Bearer)
Response type
Code Message Description
400 invalid_request Bad request
401 unauthorized_client Invalid client_id or client_secret
403 invalid_grant Invalid code
415 unsupported_grant_type Unsupported type
505 server_error Internal server error