Concrete5 rest api does not work
Permalink 1 user found helpful
I do as in the video and receive:
{
"error": "access_denied",
"message": "The resource owner or authorization server denied the request.",
"hint": "Missing \"Authorization\" header"
}
GEThttp://concrete5.dariuszgarus.pl/index.php/ccm/api/v1/system/info?a...
In the second case
POST
https://concrete5.dariuszgarus.pl/oauth/2.0/authorize...
unsupported_grant_type
The authorization grant type is not supported by the authorization server.
{
"error": "access_denied",
"message": "The resource owner or authorization server denied the request.",
"hint": "Missing \"Authorization\" header"
}
GEThttp://concrete5.dariuszgarus.pl/index.php/ccm/api/v1/system/info?a...
In the second case
POST
https://concrete5.dariuszgarus.pl/oauth/2.0/authorize...
unsupported_grant_type
The authorization grant type is not supported by the authorization server.
Hi. Thanks for reply.
I used postman and cURL.
I used postman and cURL.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "http://concrete5.dariuszgarus.pl/index.php/ccm/api/v1/system/info?access_token=example_token", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Accept: */*", "Accept-Encoding: gzip, deflate", "Cache-Control: no-cache", "Connection: keep-alive",
Viewing 15 lines of 30 lines. View entire code block.
Take a look at the video on this page https://documentation.concrete5.org/developers/rest-api/connecting-t... and fast forward to about 5:35, he talks about this exact error.
Hutman thanks but that's not it.
PHP HTTP AUTHORIZATION HEADER was disabled
This solves the problem
.htaccess
.
PHP HTTP AUTHORIZATION HEADER was disabled
This solves the problem
.htaccess
RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
You need to add the required parameters to the post/get requests.