Hello
I am trying the Mendeley REST API Client Credentials Authorisation flow token
http://dev.mendeley.com/reference/topics/authorization_client_credentials.html
But yesterday I receive error : 'Credentials are required to access this resource'
and today I receive error : 'Bad Content-Type header value: application/x-www-form-urlencoded, application/json; charset=utf-8'
I tried putting the username and password parametetrs in the apex_web_service.make_rest_request parameters, then in the apex_web_service.g_request_headers(1) but no joy.
Can anyone help with this issue? I'm new to webservices. I managed to get the mendeley/search/catalog working by manually generating the access token.
Here is my code :
declare
L_token varchar2(1000);
L_OAth_access_token varchar2(1000);
begin
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).Value := 'application/x-www-form-urlencoded; charset=utf-8';
L_OAth_access_token := apex_web_service.make_rest_request
( p_url => 'http://NUK20002443/mendeley/oauth/token'
, p_http_method => 'POST'
, p_parm_name => apex_util.string_to_table('grant_type:scope:client_id:client_secret')
, p_parm_value => apex_util.string_to_table('client_credentials:all:4462:iLN5jLYcZLapMzkH')
);
dbms_output.put_line('This is L_OAth_access_token '|| L_OAth_access_token);
end;
Kind Regards
Ade