Skip to Main Content

Need Help Using APEX_WEB_SERVICE to Invoke REST WS

User_LT7WCSep 16 2022

Hi, I'm new to coding. I have an API: https://ge26fe17f66d208-gswobow3a6jm5vc0.adb.us-sanjose-1.oraclecloudapps.com/ords/newspace/countries/country/209 , that I'm trying to write a simple REST request for. This is what I came up with using the syntax from Oracle site: https://docs.oracle.com/database/121/AEAPI/apex_web_service.htm#AEAPI1932

declare
l_clob clob;
l_buffer varchar2(32767);
l_amount number;
l_offset number;
begin

l_clob := apex_web_service.make_rest_request(
p_url => 'https://ge26fe17f66d208-gswobow3a6jm5vc0.adb.us-sanjose-1.oraclecloudapps.com/ords/newspace/countries/country/209',
p_http_method => 'GET',
p_parm_name => apex_util.string_to_table('appid:format'),
p_parm_value => apex_util.string_to_table(apex_application.g_x01||':'||apex_application.g_x02));

l\_amount := 32000;
l\_offset := 1;
begin
    loop
        dbms\_lob.read( l\_clob, l\_amount, l\_offset, l\_buffer );
        htp.p(l\_buffer);
        l\_offset := l\_offset + l\_amount;
        l\_amount := 32000;
    end loop;
exception
    when no\_data\_found then
        null;

end;

end;

I don't think this is correct. I'm having trouble figuring out what to put on the 'p_parm_name,' and 'p_parm_value' lines. I did read up on it on Oracle site, am still having trouble. Any guidance or solution would be welcome. Thank you!

Comments
Post Details
Added on Sep 16 2022
0 comments
22 views