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!

How to Parse REST API Response with EXECUTE_REST_SOURCE

Osama_MoJul 16 2024

Hello,
I'm trying to follow the documentation example to invoke rest API from pl/SQL Code :

https://docs.oracle.com/en/database/oracle/apex/24.1/aeapi/EXECUTE_REST_SOURCE-Signature-1-Procedure.html

DECLARE
   l_params apex_exec.t_parameters;
BEGIN
   apex_exec.add_parameter( l_params, 'userguid', 'AAA' );
   apex_exec.add_parameter( l_params, 'rolename', 'BBB' );
   

   apex_exec.execute_rest_source(
       p_static_id        => 'check_user_role',
       p_operation        => 'GET',
       p_parameters       => l_params );
 :P6_RESPONSE := apex_exec.get_parameter_clob(l_params,'executeResponse');
END;

But I'm getting the following error :

I can see the API is invoked successfully (OIC REST API) .

But i cannot parse the response

The Sample Response is :

{
 "user_guid" : "AAAAAA",
 "roles" : [ {
   "role_code" : "BBBB",
   "isauthorize" : "true"
 } ]
}
This post has been answered by jariola on Jul 17 2024
Jump to Answer
Comments
Post Details
Added on Jul 16 2024
4 comments
661 views