Skip to Main Content
  • Questions
  • How to call rest api which accept x-www-form-urlencoded in PL/SQL procedure in Apex

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Tbd.

Asked: April 09, 2024 - 8:32 am UTC

Last updated: April 22, 2024 - 2:12 am UTC

Version: Apex 23

Viewed 1000+ times

You Asked

How to call rest api which accept
x-www-form-urlencoded in PL/SQL procedure in Apex
I am calling

https://api.textlocal.in/docs/sendsms

and Connor said...

Its going to look something like this:

DECLARE
    l_resp_body CLOB;
BEGIN
    l_resp_body := apex_web_service.make_rest_request(
        p_url         => 'https://api.textlocal.in/docs/sendsms',
        p_http_method => 'POST',
--        p_username  => '<username>',
--        p_password => '<password>',
        p_parm_name => APEX_UTIL.string_to_table('apikey:numbers:sender:message'),
        p_parm_value => apex_util.string_to_table('val1:val2:val3:val4')
    );

    DBMS_OUTPUT.PUT_LINE (apex_web_service.g_status_code);
    DBMS_OUTPUT.PUT_LINE (dbms_lob.substr(l_resp_body, 32000,1));
END;
/


More to Explore

CLOB/BLOB/etc

Complete documentation on Securefiles and Large Objects here