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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Error NotAuthenticated while calling apex_web_service.make_rest_request using bearer token

SATHYAPRIYA KUPPUSAMIJun 9 2025 — edited Jun 9 2025

With the below client credentials, we are able to access bearer token and OIC integration instance all endpoints in postman. In Oracle APEX, i am able to get bearer token using oauth_authenticate but while calling REST Point using apex_web_service.make_rest_request getting below error:

{ "code" : "NotAuthenticated",

"message" : "The required information to complete authentication was not provided or was incorrect." }

script used:

declare
l_resp clob;
begin
apex_web_service.oauth_authenticate(
p_token_url => 'https://idcs-xxxxxxxxxxxxxxxxxxxxxxxx.identity.oraclecloud.com/oauth2/v1/token',
p_client_id => 'xxxxxxxxxxx',
p_client_secret => 'xxxxxxxxxxxxxxxxxxxxxxx,
p_scope => 'urn:opc:idm:__myscopes__');
dbms_output.put_line('Here is the API call result -> '||apex_web_service.oauth_get_last_token);
apex_web_service.g_request_headers(1).name := 'Authorization';
apex_web_service.g_request_headers(1).VALUE := 'Bearer ' || apex_web_service.oauth_get_last_token;

/* getting error in the below */
apex_web_service.g_request_headers(2).name := 'Content-TYPE';
apex_web_service.g_request_headers(2).value := 'application/json';
apex_json.initialize_clob_output(p_preserve => true);
l_resp := apex_web_service.make_rest_request(p_url =>
'https://design.integrationxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.oraclecloud.com/ic/api/integration/v1/monitoring/errors?integrationInstance=xxxxxxxxx',
p_http_method => 'GET');
dbms_output.put_line('Here is the API call result -> '||l_resp);
end;

Comments
Post Details