Define parameters for your REST API.
SOURCE_TYPE => URI
ACCESS_METHOD => IN
Calling the API...
Here's actual code, full demo:
-- Generated by ORDS REST Data Services 22.3.3.r3111929
-- Schema: ADMIN Date: Tue Dec 20 03:39:01 2022
--
BEGIN
ORDS.ENABLE_SCHEMA(
p_enabled => TRUE,
p_schema => 'ADMIN',
p_url_mapping_type => 'BASE_PATH',
p_url_mapping_pattern => 'admin',
p_auto_rest_auth => FALSE);
ORDS.DEFINE_MODULE(
p_module_name => 'orders',
p_base_path => '/orders/',
p_items_per_page => 25,
p_status => 'PUBLISHED',
p_comments => 'question for stack overflow');
ORDS.DEFINE_TEMPLATE(
p_module_name => 'orders',
p_pattern => 'getOrders',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'orders',
p_pattern => 'getOrders',
p_method => 'GET',
p_source_type => 'plsql/block',
p_mimes_allowed => NULL,
p_comments => NULL,
p_source =>
'begin
-- order id
-- status
:output := ''Submitted status is '' || :status1 || '' and Order ID is '' || :orderid || ''.'' ;
end;');
ORDS.DEFINE_PARAMETER(
p_module_name => 'orders',
p_pattern => 'getOrders',
p_method => 'GET',
p_name => 'response',
p_bind_variable_name => 'output',
p_source_type => 'RESPONSE',
p_param_type => 'STRING',
p_access_method => 'OUT',
p_comments => NULL);
ORDS.DEFINE_PARAMETER(
p_module_name => 'orders',
p_pattern => 'getOrders',
p_method => 'GET',
p_name => 'orderid',
p_bind_variable_name => 'orderid',
p_source_type => 'URI',
p_param_type => 'INT',
p_access_method => 'IN',
p_comments => NULL);
ORDS.DEFINE_PARAMETER(
p_module_name => 'orders',
p_pattern => 'getOrders',
p_method => 'GET',
p_name => 'status',
p_bind_variable_name => 'status1',
p_source_type => 'URI',
p_param_type => 'STRING',
p_access_method => 'IN',
p_comments => NULL);
COMMIT;
END;
Disclaimer: I work for Oracle and am the product manager for Oracle REST Data Services.