Search This Blog

Tuesday, July 1, 2025

Create RESTful Service Modules

 Creating RESTful Service Modules in Oracle APEX enables developers to build scalable and organized APIs that facilitate seamless communication between applications. These modules group related REST endpoints, making it easier to manage and maintain your services. By leveraging RESTful Service Modules, you can design clean, modular APIs that follow best practices for resource organization, improving both development efficiency and API usability.

Creating RESTful Service Modules in Oracle APEX involves organizing related REST endpoints into a cohesive unit, which simplifies management and improves API clarity. Here’s how you do it in detail:

  1. Access Oracle REST Data Services (ORDS) Console
    RESTful Service Modules are managed via ORDS, which integrates with Oracle Database and APEX. Start by logging into the ORDS administration interface or Oracle APEX RESTful Services section.

  2. Create a New Module
    Within the RESTful Services area, choose to create a new Module. The module represents a logical grouping of REST endpoints, usually by functionality or resource type, for example, “Employees” or “Orders.”

  3. Define Module Properties
    Provide a unique module name, URI prefix, and optionally a description. The URI prefix defines the base path for all REST endpoints within this module, such as /api/employees.

  4. Create Templates (Endpoints)
    Inside the module, create one or more templates. A template defines the URI pattern for an endpoint, such as /list or /{employee_id}. Templates can include variables in curly braces to accept dynamic input.

  5. Define Handlers for HTTP Methods
    For each template, define handlers that specify how different HTTP methods (GET, POST, PUT, DELETE) are processed. Each handler has an associated SQL or PL/SQL code block that implements the business logic or database interaction.

  6. Set Parameters and Request/Response Formats
    Configure any parameters the handler requires, such as path parameters or query parameters. Also specify the request and response media types (typically JSON or XML), ensuring data is exchanged correctly.

  7. Test and Publish the Module
    Use the built-in testing tools to verify your REST endpoints. Once confirmed, publish the module to make it available for client applications.

  8. Manage Security and Access Controls
    Assign authentication schemes and privileges to control who can access each module or endpoint. This ensures your RESTful services are secure.

Using RESTful Service Modules promotes reusable, well-structured APIs in Oracle APEX. This modular approach facilitates easier maintenance and scalability as your application grows.

Create RESTful Service Modules


Calloing a RESTful Service by ID number in Oracle APEX , you need to pass the ID as part of the URL or query parameters. This can be done in a variety of ways, depending on the structure of the RESTful service you're calling.

We have 3 options, with the last option being the simplest (It also has step by step descriptions)

Key Concepts:

  1. RESTful Web Services: REST (Representational State Transfer) is an architectural style used for designing networked applications. RESTful web services allow you to perform operations like GET, POST, PUT, and DELETE over HTTP, typically using JSON or XML as the data format.

  2. RESTful Web Service in APEX: Oracle APEX provides built-in functionality to consume and interact with external REST APIs directly through APEX components, such as Web Source or RESTful Services.

  3. Data Synchronization: The goal of synchronization is to keep the data in APEX consistent with the data on an external system. This can involve:

    • Pulling data from an external REST API to populate your APEX application (e.g., fetching remote data and displaying it in APEX forms or reports).

    • Pushing data to an external system by sending data from APEX to the REST API (e.g., submitting a form and sending the data to a remote service).

    • Updating or deleting data from APEX to keep both systems in sync.

Scenario: Calling a RESTful Service by ID

Let’s assume you have an existing RESTful Service for a resource, such as employees, and you want to retrieve details for a specific employee based on an ID number.

Steps to Call a RESTful Service by ID Number in Oracle APEX 23:

Step 1: Define the RESTful Web Service

Let’s say the resource employees is exposed as a RESTful Web Service and you have a query parameter for the id.

  1. Define the RESTful Resource in APEX

    • The Resource Path can be something like /employees/{employee_id}.

    • The employee_id would be a parameter in the RESTful Web Service URL.

Example of defining the resource path:

/employees/{employee_id}

Where {employee_id} is a placeholder for the actual ID passed by the user or application.

Step 2: Prepare the Call to the RESTful Service in APEX

To call this service by employee_id, you can either pass the ID in the URL as a path parameter or use a query parameter.


In conclusion, RESTful Service Modules provide a structured approach to developing and managing REST APIs in Oracle APEX. By grouping related endpoints and applying consistent design principles, you ensure your services are maintainable, scalable, and easy to understand. This approach not only enhances developer productivity but also delivers a better experience for API consumers.

No comments:

Post a Comment

Learning ORACLE APEX: Creating a Complete Application from a CSV File

  Learning ORACLE APEX: Creating a Complete Application from a CSV File Start with a simple CSV dataset and finish with a working, shareable...