-
-
Save ismasan/8dac54b92e0648dc69b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,"https://auth.bootic.net/oauth/token"); | |
// Reemplazar client_id:client_secret por credenciales de aplicación | |
curl_setopt($ch, CURLOPT_USERPWD, "client_id:client_secret"); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials&scope=admin"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$server_output = curl_exec ($ch); | |
curl_close ($ch); | |
// Parsea JSON | |
$data = json_decode($server_output); | |
// El token | |
$access_token = $data->{'access_token'}; | |
print_r($access_token); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment