Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

API token generation

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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'];
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading