Search
  • Bheem

How to Consume Restful API in Oracle Apex (Parameter in URL).

In this video you will learn consuming web service in oracle apex using plsql.


DECLARE
    l_data    CLOB;
    l_ename   VARCHAR2(2000);
    l_url VARCHAR2(2000):='https://apex.oracle.com/pls/apex/ecom/employee/'||:P3_EMP_ID||'/'||:P3_DEPT||''; 
BEGIN
    l_data := apex_web_service.make_rest_request(p_url => l_url,
                                                 p_http_method => 'GET'
                                                 );
    SELECT
        ename
    INTO l_ename
    FROM
        XMLTABLE ( '/json/items/row' PASSING apex_json.to_xmltype(l_data) COLUMNS 
        ename VARCHAR2(4000) PATH 'ename', 
        empno NUMBER PATH 'empno', 
        job VARCHAR2(255) PATH 'job', 
        mgr NUMBER PATH 'mgr', 
        hiredate VARCHAR2(255) PATH 'hiredate', 
        deptno NUMBER PATH 'deptno' 
        );

    :P3_EMPNAME := l_ename;
END;

425 views0 comments

Recent Posts

See All

How to create network ACL in oracle database.

when you are calling third party API in oracle using UTL_HTTP then you will face Network access denied by ACL error if ACL is not created. To create ACLfirst login with sys account then run below code