Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

REST API request

ade_adekoyaJun 20 2017 — edited Jun 20 2017

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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2017
Added on Jun 20 2017
2 comments
789 views