0

I am using Oracle Apex 24. I am trying to call a REST API in JavaScript when a button is clicked. The REST API was called, and the resulting JSON items populated successfully.

However, this is not the approach I want to use.

I have created a process in the Processing Execution Point whose type is INVOKE API, but I am unable to call the process created on the processing Execution Point (not PL/SQL ) when the button is clicked.

Firstly, I tried to create a Process at the Process Tab as shown in the figure below: Process Tab

Secondly, the figure below shows the condition of the process: Process Condition

Finally, the dynamic action has a TRUE condition on which the process will be called: Dynamic Action Condition

But still it is not firing, any help?

2 Answers 2

0

To call a rest API in a page process use the process type of type "Execute code". As code you write an pl/sql block. For invoking the rest api, use the function APEX_WEB_SERVICE.MAKE_REST_REQUEST . The response will be in a CLOB that you can then parse using the native sql json_table functions.

Sign up to request clarification or add additional context in comments.

Comments

0

The appropriated approach for your situation is Ajax Callback processes. It is the last execution point in the "processes tab". The processes in this point not executed until you call it using its name. After creating the process in this point you should call it using apex.server.process() function of Oracle Apex Javascript api.

1 Comment

In this case the json is called on the client (and readable with dev tools by the user). It depends on the business case if this is acceptable. If the rest call is done on the server none of the rest communciation is exposed in the client.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.