I want to learn how to generate this token for API calls. My question is what way or method can I call this API?
API Documentation for Generating Token
>Solution :
https://developers.bux.ph/#operation/buxOauth
If you look to the right there will be an example of the expected parameter you send to receive your token from the server.
Here’s an example using PHP:
$url = 'https://api.bux.ph/v1/api/sandbox/oauth/token/';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
'grant_type' => 'reports',
)));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Basic ' . base64_encode('client_id:client_secret'),
));
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response, true);
// get the "access_token" from the response
$access_token = $response['access_token'];