INTRODUCTION :
The Invoke API process in Oracle Apex allows developers to make API calls from within an Oracle Apex application to retrieve data or perform actions on external systems. This feature provides a convenient and efficient way to integrate Apex with other applications and services, enhancing the functionality and overall user experience of the Apex application. A brand-new page level process type enables declarative execution of procedures and functions without the need to write PL/SQL code. Page Designer will automatically establish parameters and map them to matching page elements.
WHY WE NEED TO DO :
The new process type utilizes page item format automatically for type conversions, as well as switch and check box item type configurations automatically for Boolean conversion.Identify the API endpoint you want to use and determine the required parameters and authentication method.
SOLUTION :
Step 1 : Create a new application on Invoke API Process and it is a new feature in Oracle apex 22.2
Step 2: After Creating the application and then create a new blank page to work on this new feature.
Step 3: Creation of a new blank page for this application and then create a process, then change the type from editable to Invoke API in Identification. In settings, change the type into PL/SQL Procedure/Function and the select function as ‘EMP_DATA’.
FUNCTION (EMP_DATA) CODE :
create or replace function Emp_data (l_employee varchar2)
return varchar2
as
lv_emp_name varchar2(50);
begin
begin
select ename into lv_emp_name from emp_d where ename = l_employee;
end;
if lv_emp_name is not null then
return’Employee name is already exist’;
else
return ‘Employee name is not exist’;
end if;
end;
Step 4 : The function that are used in this process which has already fetched some parameters like ‘l_employee’ and ‘Function_Result’.
Step 5: Go to body, then create two Page items and a Button. According to the parameters which were used in this function of that process and Save it.
Step 6: Run this Application (Invoke API Process- Apex 22.2) and the home page will appear. In this region, we can enter the employee name as mentioned in the table of that function had used.
Step 7 : After entering the employee name as mentioned, Then it automatically shows that whether the data is correct or not. If its correct means the employee name is already exist.
Step 8 : If the Employee name which has not listed in that table and it shows an error message like ‘no data is found’.
CONCLUSION :
- Overall, the Invoke API process is a valuable tool for Apex developers looking to integrate their application with external systems.The debug mode is available for use in subsequent operations.
- The process involves defining the API endpoint, specifying the request method, setting the required headers and parameters, and processing the response data.
- Full support for complex data types such PL/SQL Record and full PL/SQL data type like (NUMBER, DATE, TIMESTAMP, BOOLEAN, CLOB, BLOB, etc.) can also used in this process.