I am using php to create a little snippet of code to create a bucket on my new app. This is a simple question but how o I add multiple scopes to my request. Here is my code.
$headers[] = 'Content-type: application/x-www-form-urlencoded'; $process = curl_init(); curl_setopt($process, CURLOPT_HTTPHEADER, $headers); curl_setopt($process, CURLOPT_URL, "https://developer.api.autodesk.com/authentication/v1/gettoken"); curl_setopt($process, CURLOPT_RETURNTRANSFER, 1); curl_setopt($process, CURLOPT_POSTFIELDS, "client_id=myclientid&client_secret=myclientsecret&grant_type=authorization_code&code=" . strval($code) . "&redirect_uri=http://localhost/siteForge/home.php&scope=code:all"); curl_setopt($process, CURLOPT_POST, 1); $result = curl_exec($process); curl_close($process);
Also when I try to make the bucket I says I do not have the privileges.
Solved! Go to Solution.
Solved by mikako_harada. Go to Solution.
I'm not php person. But using a tool like postman, where it shows three variation of php codes like below as an example.
You may want to make use of a tool like that. you probably have better chance to get help by posting to stackoverflow as this is more about programming language questions.
e.g.,
>>>>
curl_setopt_array($curl, array(
CURLOPT_URL => "https://developer.api.autodesk.com/authentication/v1/authenticate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "client_id=<>&client_secret=<>&grant_type=client_credentials&scope=data%3Aread%20data%3Acreate%20data%3Awrite%20account%3Awrite%20bucket%3Aread",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded",
"postman-token: <>"
),
));
<<<<
Can't find what you're looking for? Ask the community or share your knowledge.