---
title: ORDS, OAuth2 & Web Services in APEX – Part 3
description: Calling Web Services from APEX The following blog will show you how to call GET method Web Service from an APEX 5.1 application and extract the response data.
image: https://content.dsp.co.uk/hubfs/Imported_Blog_Media/3_Employees-and-OAuth.jpg
---

[![DSP From Ground to Cloud](https://content.dsp.co.uk/hubfs/Logos/DSP%20From%20Ground%20to%20Cloud/DSP-Logo-Colour-From-Ground-to-Cloud.svg "DSP From Ground to Cloud")](https://dsp.co.uk)

[![DSP From Ground to Cloud](https://content.dsp.co.uk/hs-fs/hubfs/2023/Logos/DSP/DSP-Logo-2019-White-600px.png?width=70&height=72&name=DSP-Logo-2019-White-600px.png "DSP From Ground to Cloud")](https://dsp.co.uk)

- Services 
    - Consulting Services 
          - [Oracle](https://www.dsp.co.uk/oracle-consultancy)
          - [Microsoft](https://www.dsp.co.uk/sql-server-consultancy)
          - [Google](https://www.dsp.co.uk/google-cloud-consultancy)
          - [Architecture](https://www.dsp.co.uk/solution-design-and-architecture)
    - Managed Services 
          - [Oracle Managed Services](https://www.dsp.co.uk/oracle-managed-services)
          - [SQL Server Managed Services](https://www.dsp.co.uk/sql-server-managed-services)
          - [OCI Managed Services](https://www.dsp.co.uk/oracle-cloud-infrastructure-managed-services)
          - [Azure Managed Services](https://www.dsp.co.uk/azure-managed-services)
          - [On Premise Apps Managed Services](https://www.dsp.co.uk/application-managed-services)
          - [Cloud Apps Managed Services](https://www.dsp.co.uk/oracle-cloud-applications-services)
    - Licensing and SAM 
          - [Oracle Licensing](https://www.dsp.co.uk/oracle-licensing-services)
          - [Software Asset Management](https://www.dsp.co.uk/oracle-software-asset-management-sam)
    - Application Services 
          - [Application Development](https://www.dsp.co.uk/software-development)
          - [Application Modernisation](https://www.dsp.co.uk/legacy-software-modernisation)
          - [Oracle Forms to Oracle APEX](https://www.dsp.co.uk/oracle-forms-to-oracle-apex)
          - [Application Extensions](https://www.dsp.co.uk/software-customisation)
          - [Archiving Solutions](https://www.dsp.co.uk/application-archiving-solution)
          - [Application Hosting](https://www.dsp.co.uk/oracle-apex-hosting-services)
          - [Development Training](https://www.dsp.co.uk/oracle-apex-training)
    - Data Science 
          - [AI Strategy](https://www.dsp.co.uk/ai-strategy)
          - [Responsible AI and Governance](https://www.dsp.co.uk/responsible-ai)
          - [Agentic AI](https://www.dsp.co.uk/agentic-ai)
          - [Data Management for AI](https://www.dsp.co.uk/data-management)
          - [Power BI](https://www.dsp.co.uk/power-bi-services)
          - [Microsoft Fabric](https://www.dsp.co.uk/microsoft-fabric-services)
          - [Machine Learning](https://www.dsp.co.uk/oci-machine-learning)
    - Cloud Migration and Management 
          - [Cloud Readiness and Design](https://www.dsp.co.uk/oracle-cloud-readiness-assessment)
          - [Migration to Fusion and Cloud Applications](https://www.dsp.co.uk/oracle-cloud-application-modernisation)
          - [Migration to Cloud Infrastructure](https://www.dsp.co.uk/oracle-cloud-migration)
          - [Private Cloud](https://www.dsp.co.uk/oracle-private-cloud-services)
          - [Database@ Hyperscaler](https://www.dsp.co.uk/multicloud-management)
          - [FinOps and Optimisation](https://www.dsp.co.uk/optimise-oracle-cloud-infrastructure)
    - Integration and APIs 
          - [API Management](https://www.dsp.co.uk/api-development-services)
          - [GoldenGate](https://www.dsp.co.uk/oracle-goldengate-services)
    - Disaster Recovery and Security 
          - [Disaster Recovery](https://www.dsp.co.uk/oracle-database-disaster-recovery-solutions)
          - [Security Compliance](https://www.dsp.co.uk/data-security)
          - [Cloud Security](https://www.dsp.co.uk/cloud-security)
  
  
  
   
  
  ![Oracle Partner, Microsoft Partner and Google Partner](https://content.dsp.co.uk/hubfs/logo-2021/Partner-logos/multiple-vendor/rectangle-2022/Partner-logos-rectangle-Nov21.svg)
  
  
  
  
  
  
  
  #### Getting to know us
  
    - [About us](https://www.dsp.co.uk/about)
    - [What we do](https://www.dsp.co.uk/what-we-do)
    - [Leadership](https://www.dsp.co.uk/dsp-product-leads)
    - [Careers](https://www.dsp.co.uk/careers)
- Technologies 
    - Oracle Cloud Infrastructure 
          - [Oracle Cloud Infrastructure](https://www.dsp.co.uk/oracle-cloud-infrastructure-services)
          - [IaaS](https://www.dsp.co.uk/iaas)
          - [PaaS](https://www.dsp.co.uk/paas-security)
    - Oracle Database 
          - [Oracle Database](https://www.dsp.co.uk/oracle-database-consulting)
          - [Autonomous Database](https://www.dsp.co.uk/oracle-autonomous-database-services)
          - [MySQL and Heatwave](https://www.dsp.co.uk/mysql-services)
          - [Oracle APEX](https://www.dsp.co.uk/oracle-apex-services)
    - Oracle Engineered Systems 
          - [Oracle Exadata](https://www.dsp.co.uk/exadata-database-service-consultancy)
          - [Oracle Database Appliance](https://www.dsp.co.uk/oracle-database-appliance)
    - Oracle Applications 
          - [Oracle Fusion and Cloud Applications](https://www.dsp.co.uk/oracle-fusion-services)
          - [Oracle E-Business Suite](https://www.dsp.co.uk/oracle-ebs-services)
          - [JD Edwards](https://www.dsp.co.uk/jd-edwards-services)
          - [Peoplesoft](https://www.dsp.co.uk/oracle-peoplesoft-services)
          - [Hyperion](https://www.dsp.co.uk/oracle-hyperion-services)
    - Microsoft 
          - [SQL Server](https://www.dsp.co.uk/sql-server-consultancy)
          - [Microsoft Azure](https://www.dsp.co.uk/microsoft-azure-services)
          - [Power BI](https://www.dsp.co.uk/power-bi-services)
          - [Microsoft Fabric](https://www.dsp.co.uk/microsoft-fabric-services)
    - Google 
          - [Google Cloud Platform (GCP)](https://www.dsp.co.uk/google-cloud-partner)
    - Multicloud and Database Hyperscaler 
          - [Oracle Database@Azure](https://www.dsp.co.uk/oracle-databaseazure-partner)
          - [Oracle Database@GCP](https://www.dsp.co.uk/google-cloud-machine-learning)
          - [Oracle Database@AWS](https://www.dsp.co.uk/amazon-web-services-aws)
          - [Oracle Azure Interconnect](https://www.dsp.co.uk/oracle-microsoft-multicloud)
    - Open Source Database 
          - [PostgreSQL](https://www.dsp.co.uk/postgresql-services)
          - [MySQL](https://www.dsp.co.uk/mysql-services)
          - [MariaDB](https://www.dsp.co.uk/migration-from-mariadb-to-mysql)
  
  
  
  #### Managed Services
  
    - [Oracle Database](https://www.dsp.co.uk/oracle-managed-services)
    - [SQL Server](https://www.dsp.co.uk/sql-server-managed-services)
    - [MySQL](https://www.dsp.co.uk/mysql-support)
  
  
  
  
  
  
  #### Application Services
  
    - [Oracle Applications](https://www.dsp.co.uk/oracle-application-cloud-migration)
    - [Oracle APEX](https://www.dsp.co.uk/oracle-apex-services)
    - [Microsoft](https://www.dsp.co.uk/microsoft-partnership)
    - [ISV Services](https://www.dsp.co.uk/isv-support-and-services)
  
  
  
  
  
  
  
  
  #### Cloud Services
  
    - [Oracle Cloud Infrastructure](https://www.dsp.co.uk/oracle-cloud-services)
    - [Microsoft Azure](https://www.dsp.co.uk/microsoft-azure-services)
    - [Google Cloud Platform](https://www.dsp.co.uk/gcp-database)
    - [Multi-cloud](https://www.dsp.co.uk/oracle-microsoft-multicloud)
  
  
  
  
  
  
  #### Data Science
  
    - [Machine Learning](https://www.dsp.co.uk/machine-learning-consulting-services)
    - [Business Intelligence](https://www.dsp.co.uk/business-intelligence-services)
    - [Artificial Intelligence](https://www.dsp.co.uk/artificial-intelligence-consulting-services)
  
  
  
  
  
  
  
  
  #### Consulting Services
  
    - [Oracle](https://www.dsp.co.uk/oracle-consultancy)
    - [Microsoft](https://www.dsp.co.uk/sql-server-consultancy)
    - [Google](https://www.dsp.co.uk/google-cloud-consultancy)
    - [Cloud Migration](https://www.dsp.co.uk/cloud-migrations)
  
  
  
  
  
  
  #### Technology Solutions
  
    - [Engineered Systems](https://www.dsp.co.uk/oracle-engineered-systems-partner)
    - [Data Security](https://www.dsp.co.uk/data-security)
    - [Database Architecture](https://www.dsp.co.uk/solution-design-and-architecture)
    - [Disaster Recovery](https://www.dsp.co.uk/database-disaster-recovery)
- Industries 
    - [Finance](https://www.dsp.co.uk/finance)
    - [Healthcare](https://www.dsp.co.uk/healthcare-it-services)
    - [Travel and Transport](https://www.dsp.co.uk/database-solutions-for-travel-and-transport)
    - [Higher Education](https://www.dsp.co.uk/higher-education)
    - [Public Sector](https://www.dsp.co.uk/public-sector)
    - [Manufacturing](https://www.dsp.co.uk/manufacturing)
    - [Retail](https://www.dsp.co.uk/retail)
    - [Software Vendors](https://www.dsp.co.uk/isv-support-and-services)
  
  
  
  ### Recent case study:
  
  #### Oracle EBS Cloud Deployment
  
  Consolidating and Migrating assets into Oracle Cloud Infrastructure.
  
  [**![Oracle EBS Cloud Deployment](https://content.dsp.co.uk/hs-fs/hubfs/stonewater-logo%20(1).png?width=250&name=stonewater-logo%20(1).png)**](https://www.dsp.co.uk/stonewater)
  
   
  
  
  
  
  
  
  
  #### Most Visited Pages
  
    - [Oracle Licensing](https://www.dsp.co.uk/oracle-licensing)
    - [Oracle Cloud Calculator](https://www.oracle-cloud-calculator.com/)
    - [Oracle Cloud Migration](https://www.dsp.co.uk/oracle-cloud-migration)
    - [Oracle Exadata Services](https://www.dsp.co.uk/oracle-exadata-services)
    - [Artificial Intelligence Services](https://www.dsp.co.uk/artificial-intelligence-consulting-services)
  
  
  
  
  
  
  
  
  #### -
  
    - [SQL Server Support](https://www.dsp.co.uk/sql-server-support)
    - [Oracle Support](https://www.dsp.co.uk/oracle-support)
    - [Google Cloud Consultancy](https://www.dsp.co.uk/google-cloud-consultancy)
    - [New Application Development](https://www.dsp.co.uk/oracle-apex-services)
    - [Azure Virtual Desktop](https://www.dsp.co.uk/azure-virtual-desktop)
- Resources 
    - [Gartner ](https://www.dsp.co.uk/complimentary-gartner-download)
    - [ISG](https://www.dsp.co.uk/isg-oracle-report)
    - [Blogs](https://www.dsp.co.uk/blogs)
    - [Case Studies](https://www.dsp.co.uk/case-studies)
    - [Testimonials](https://www.dsp.co.uk/testimonials)
    - [Events](https://www.dsp.co.uk/events)
    - [Webinars](https://www.dsp.co.uk/webinars)
    - [Insights](https://www.dsp.co.uk/insights)
    - [Technical Resources](https://www.dsp.co.uk/technical-resources)
  
  
  
  ### DSP-Explorer acquires leading Oracle Applications Managed Services Provider, Claremont, to further extend its data management capabilities.
  
   
  
  [![Read More](https://no-cache.hubspot.com/cta/default/3321273/c7e13c9c-65e1-46e7-8541-8da86a4fc305.png)](https://cta-redirect.hubspot.com/cta/redirect/3321273/c7e13c9c-65e1-46e7-8541-8da86a4fc305)
  
  
  
  
  
  
  
  #### Resources
  
    - [Blogs](https://www.dsp.co.uk/blogs)
    - [Webinars](https://www.dsp.co.uk/webinars)
    - [Case Studies](https://www.dsp.co.uk/case-studies)
    - [Testimonials](https://www.dsp.co.uk/testimonials)
- About 
    - [About DSP](https://www.dsp.co.uk/about)
    - [What We Do](https://www.dsp.co.uk/what-we-do)
    - [DSP Group Board ](https://www.dsp.co.uk/dsp-group-board)
    - [Careers](https://www.dsp.co.uk/careers)
    - [Project Harar](https://www.dsp.co.uk/project-harar)
- [Customer Area](https://www.dsp.co.uk/contact-us) 
    - [Customer Support Portal](https://dspgroup-ism.ivanticloud.com/)
    - [Customer Resources](https://www.dsp.co.uk/welcome)
- [Contact us](https://www.dsp.co.uk/contact-us)

# ORDS, OAuth2 & Web Services in APEX – Part 3

[ Colin Archer ](https://content.dsp.co.uk/author/colin-archer) 11-Jan-2018 10:34:01

### Contents

[30-Oct-2017 10:08:26

ORDS,OAuth2 & Web Services in APEX – Part 1

](https://content.dsp.co.uk/web-services-part-1) [13-Nov-2017 12:05:31

ORDS, OAuth2 & Web Services in APEX – Part 2

](https://content.dsp.co.uk/ordsoauth2-web-services-in-apex-part-2) [03-Nov-2020 12:12:00

APEX Authentication Using Microsoft Azure Face API

](https://content.dsp.co.uk/apex-authentication-using-microsoft-azure-face-api)

## Calling Web Services from APEX

The following blog will show you how to call GET method Web Service from an APEX 5.1 application and extract the response data. It will also show you how to authenticate calls to protected Web Services and how to process paginated JSON response data. Typically the Web Services would be external, however to keep things simple and consistent we will build upon the ones we created in the first two parts of this blog. Before you read on you can find out more about our [APEX Services here.](https://www.dsp.co.uk/oracle-apex-services)

### **Enhancements to the previously created Web Services **

We previously created five Web Services over the EMP and DEPT tables and added OAuth2 Authentication. Before we begin we are going to add a further two GET method handlers that use no pagination. We will also update the items returned per page of the original Employees GET method to five and set the department number parameter to be passed in using the HTTP header rather than in the URI.

Login to your ORDSDEMO schema (created in part 1) and run the following PL/SQL.

```
DECLARE
 la_priv_patterns owa.vc_arr;
BEGIN 
 ords.define_template(p_module_name => 'hr.v1',
                      p_pattern     => 'all_departments',
                      p_comments    => 'All Departments');
 ords.define_template(p_module_name => 'hr.v1',
                      p_pattern     => 'all_employees',
                      p_comments    => 'All Employees');
 ords.define_handler(p_module_name     => 'hr.v1',
                     p_pattern         => 'all_departments',
                     p_method          => 'GET',
                     p_source_type     => ords.source_type_query,
                     p_source          => 'SELECT deptno, dname, loc FROM dept ORDER BY deptno',
                     p_items_per_page  => 0,
                     p_comments        => 'List all departments');
 ords.define_handler(p_module_name  => 'hr.v1',
                       p_pattern      => 'all_employees',
                     p_method       => 'GET',
                     p_source_type  => ords.source_type_query,
                     p_source       => 'SELECT d.dname, e.ename, e.job, e.empno, e.hiredate, d.loc
                                       FROM emp e, dept d
                                       WHERE e.deptno = d.deptno
                                       AND (:pn_deptno IS NULL OR d.deptno = :pn_deptno)
                                       ORDER BY d.dname, e.ename',
                     p_items_per_page => 0,
                     p_comments       => 'List all employees');
 ords.define_handler(p_module_name    => 'hr.v1',
                     p_pattern        => 'employees',
                     p_method         => 'GET',
                     p_source_type    => ords.source_type_query,
                     p_source         => 'SELECT d.dname, e.ename, e.job, e.empno, e.hiredate, d.loc
                                         FROM emp e, dept d
                                         WHERE e.deptno = d.deptno
                                         AND (:pn_deptno IS NULL OR d.deptno = :pn_deptno)
                                         ORDER BY d.dname, e.ename',
                     p_items_per_page => 5, 
                     p_comments       => 'List employees');
 ords.define_parameter(p_module_name        => 'hr.v1',
                       p_pattern            => 'all_employees',
                       p_method             => 'GET',
                       p_name               => 'department_number',
                       p_bind_variable_name => 'pn_deptno',
                       p_source_type        => 'HEADER',
                       p_param_type         => 'INT',
                       p_access_method      => 'IN',
                       p_comments => 'Restrict employees to a single department'); 
 ords.define_parameter(p_module_name        => 'hr.v1',
                       p_pattern            => 'employees',
                       p_method             => 'GET',
                       p_name               => 'department_number',
                       p_bind_variable_name => 'pn_deptno',
                       p_source_type        => 'HEADER',
                       p_param_type         => 'INT',
                       p_access_method      => 'IN',
                       p_comments           => 'Restrict employees to a single department'); 
 
 la_priv_patterns(1) := '/hr/v1/all_employees';
 ords.create_privilege_mapping(p_privilege_name => 'employee.privilege',
                               p_patterns       => la_priv_patterns);

COMMIT;
END
```

You will now have two additional GET method Web Services.

- all_departments, non-paginated GET method Web Services returning all departments in JSON format.
- all_employees, non-paginated GET method Web Services returning all employees (optionally for a named department) in JSON format. Protected using OAuth2.

 

### **Access Web Services from APEX**

There are currently two methods of accessing a Web Service within APEX.

1. Define using Web Services References within the Data References section of Shared Components and access via a Web Service page process.
2. Access directly using the apex_web_service PL/SQL API.

The following examples are calling Web Services running on a local XE installation via port 8081; therefore, all of the URLs will start with http://localhost:8081/ords/. Update this part of the URL to reflect your configuration.

### **Accessing a GET method Web Service using Web Services References**

To get started we need to create a new APEX application. Log into the application builder and create a new desktop application called ‘Web Service Demo’. Accept all the defaults and add a blank home page.

Navigate to shared components and click on Web Service Reference within the Data References section, then follow these steps to define the request for the all_departments Web Service.

1. Click ***Create***.  
2. Keep the default type of REST selected and press ***Next***.  
3. Enter the following values for the REST details and press ***Next***.

| Name | All Departments** ** |
| --- | --- |
| URL | http://localhost:8081/ords/api/hr/v1/all_departments |
| HTTP Method | GET |
| Basic Authentication | No |

4. We do not need any REST Inputs so press Next.  
5. Set the REST output type to JSON and press Create.

[![Calling Web Services from APEX](https://content.dsp.co.uk/hs-fs/hubfs/Imported_Blog_Media/1_Test-department-web-service.jpg?width=1343&name=1_Test-department-web-service.jpg)](https://content.dsp.co.uk/hubfs/Imported_Blog_Media/1_Test-department-web-service.jpg)

Now the Web Service Reference has been defined we can use it as the source for an interactive report. Create a new blank page (2) called ‘Departments – WSR’, selecting the options within the wizard to include breadcrumb and navigation links.

Navigate to page 2 and follow these steps to add two process, one to call the Web Service and another to add the returned data into a collection for the interactive report.

1. Right-click on Before Header within Rendering > Pre-Rendering.  
2. Select ‘Create Process’ and enter the following properties.

| Name | Call Department Web Service |
| --- | --- |
|  Type |  Web Service |
| Web Service Operation |  All Departments – doREST |
|  Store Result in |  Collection |
|  Collection Name |  DEPT_JSON |
|  Store Result in |  Collection |
|  Sequence |  Collection |

3. Create a second process using the following properties.

| Name | Create DEPARTMENTS collection |
| --- | --- |
| Type | PL/SQL Code |
| PL/SQL Code | See step 4 |
| Sequence | 20 |

4. Use the following PL/SQL code for the second process to get the Web Service response data and use it to create a new DEPARTMENTS collection for the interactive report to query.

```
DECLARE
 lc_data CLOB;
 lj_depts apex_json.t_values;
BEGIN
 -- Extract JSON data from DEPT_JSON collection populated by Web Service call
 SELECT clob001
 INTO lc_data
 FROM apex_collections
 WHERE collection_name = 'DEPT_JSON';

-- Parse the JSON data 
 apex_json.parse(lj_depts, lc_data);
 
 -- Loop through each department in the JSON data and add to a new collection
 apex_collection.create_or_truncate_collection('DEPARTMENTS');
 FOR dept_loop IN 1 .. apex_json.get_count(p_path => 'items', p_values => lj_depts) LOOP 
   apex_collection.add_member(p_collection_name => 'DEPARTMENTS',
                              p_c001            => apex_json.get_varchar2(p_path   => 'items[%d].deptno',
                                                                          p0       => dept_loop,
                                                                          p_values => lj_depts),
                              p_c002            => apex_json.get_varchar2(p_path   => 'items[%d].dname',
                                                                          p0       => dept_loop,
                                                                          p_values => lj_depts),
                              p_c003            => apex_json.get_varchar2(p_path   => 'items[%d].loc',
                                                                          p0       => dept_loop,
                                                                          p_values => lj_depts)); 
 END LOOP;
END;
```

The final step is to add an interactive report region to the page using the DEPARTMENTS collection as the source.

1. Add an Interactive Report region to the CONTENT BODY of the page.  
2. Set the title to ‘Departments’.  
3. Enter the following for the SQL Query.

```
SELECT c001 dept_number, 
       c002 dept_name, 
       c003 location
FROM apex_collections
WHERE collection_name = 'DEPARTMENTS'
```

4. Press ***Save***.

You now have a page with two before header processes, a breadcrumb region and an interactive report region.

[![Calling Web Services from APEX](https://content.dsp.co.uk/hs-fs/hubfs/Imported_Blog_Media/2_Page-2-editor-view.jpg?width=1548&name=2_Page-2-editor-view.jpg)](https://content.dsp.co.uk/hubfs/Imported_Blog_Media/2_Page-2-editor-view.jpg)

Now run the page, the first process calls the Web Service and stores the JSON formatted response containing the department data into the CLOB column of the DEPT_JSON collection. The second process extracts the data held in the CLOB, parses it using apex_json.parse and the loops through each row in turn to build the DEPARTMENTS collection.

The interactive report region then executes a simple query on the apex_collections table.

### **Accessing a GET method Web Service using apex_web_service**

An alternative to defining the Web Services within shared components is to use the apex_web_service PL/SQL API.

Create a new blank page (3) called ‘Departments – API’ selecting the options to include the breadcrumb and navigation links. Add a Before Header process using the following properties.

1. Right-click on Before Header within Rendering > Pre-Rendering.  
2. Select ‘Create Process’ and enter the following properties.

| Name | Create DEPARTMENTS collection from Web Service |
| --- | --- |
| Type | PL/SQL Code |
| PL/SQL Code | See step 3 |
| Sequence | 10 |

 

3.  Use the following PL/SQL Code for the process to call the Web Service and add the data to a new collection called DEPARTMENTS2.

```
DECLARE
 lc_data CLOB;
 lj_depts apex_json.t_values;
BEGIN
 -- Call the Web Service and store the JSON formatted response into a CLOB 
 lc_data := apex_web_service.make_rest_request( 
                           ' http://localhost:8081/ords/api/hr/v1/all_departments','GET');

-- Parse the JSON data 
 apex_json.parse(lj_depts, lc_data);
 
 -- Loop through each department in the JSON data and add to a new collection
 apex_collection.create_or_truncate_collection('DEPARTMENTS2');
 FOR dept_loop IN 1 .. apex_json.get_count(p_path => 'items', p_values => lj_depts) LOOP 
   apex_collection.add_member(p_collection_name => 'DEPARTMENTS2',
                              p_c001            => apex_json.get_varchar2(p_path   => 'items[%d].deptno',
                                                                          p0       => dept_loop,
                                                                          p_values => lj_depts),
                              p_c002            => apex_json.get_varchar2(p_path   => 'items[%d].dname',
                                                                          p0       => dept_loop,
                                                                          p_values => lj_depts),
                              p_c003            => apex_json.get_varchar2(p_path   => 'items[%d].loc',
                                                                          p0       => dept_loop,
                                                                          p_values => lj_depts)); 
 END LOOP;
END;
```

4. Add an Interactive Report region named ‘Departments’ to the CONTENT BODY area using the following query.

```
SELECT c001 dept_number, 
 c002 dept_name, 
 c003 location
FROM apex_collections
WHERE collection_name = 'DEPARTMENTS2'
```

5. Save and run the page.

When the page runs, the process calls the Web Service using the apex_web_service API and stores the response into a CLOB. The process then parses the CLOB and loops through each row to populate the DEPARTMENTS2 collection. The interactive report then executes a query on the apex_collections table.

### **Accessing a GET method Web Service protected with OAuth2 via Web Services References**

To access an OAuth 2.0 protected Web Service we need a valid access token to pass in the HTTP header, which is generated using a client id and secret. Use the following PL/SQL to create a function within the ORDSDEMO schema to return the client credentials. If your APEX application is in a different schema you will need to grant EXECUTE privileges on the procedure.

```
CREATE OR REPLACE PROCEDURE get_client_credentials(pv_name IN user_ords_clients.name%TYPE,
                                                   pv_id_o OUT user_ords_clients.client_id%TYPE,
                                                   pv_secret_o OUT user_ords_clients.client_secret%TYPE) 
IS
 CURSOR c_client IS
   SELECT client_id, client_secret
   FROM user_ords_clients
   WHERE NAME = pv_name;

vr_client c_client%ROWTYPE;
BEGIN
 OPEN c_client;
 FETCH c_client
 INTO vr_client;
 CLOSE c_client;
 pv_id_o     := vr_client.client_id;
 pv_secret_o := vr_client.client_secret;
END get_client_credentials;
```

Navigate to shared components, click on Web Service Reference and create a second entry using the following steps.

1. Click on ***Create***.  
2. Keep the default type of REST selected and press ***Next***.  
3. Enter the following values for the REST details and press ***Next***.

| Name | All Employees |
| --- | --- |
| URL | http://localhost:8081/ords/api/hr/v1/all_employees |
| HTTP Method | GET |
| Basic Authentication | No |
| HTTP Request Header > Name (1) | Authorization |
| HTTP Request Header > Name (2) | department_number |

4. We do not need any REST Inputs, so press ***Next***.  
5. Set the REST output type to JSON and press ***Create***.

At this stage, we cannot test the Web Service without a valid access token as it is protected.

Now we have created a procedure to return the client credentials and added a Web Service Reference to return all employees we need to add a page to use them. Create a new blank page (4) called ‘Employees – WSR’ and follow these steps to add the various regions, items and processes.

1. Add a Standard region called ‘Department’ and add the following two hidden items.

a. P4_CLIENT_ID  
b. P4_CLIENT_SECRET

2. Add a select list item called P4_DEPT_NO to the region using the following properties.

| Name | P4_DEPT_NO |
| --- | --- |
| Type | Select List |
| Label | Department |
| List of Values | – |
| Type | SQL Query |
| SQL Query | SELECT dname, deptno FROM ordsdemo.dept ORDER BY dname |
| Display NULL value | Yes |
| Null Display Value | All |
| Null Return Value | Leave blank (NULL) |

3. Add a dynamic action to P4_DEPT_NO using the following properties.

| Name | Call Web Service and refresh Employees |
| --- | --- |
| Type | Select List |
| Label | Department |
| When | – |
| Event | Change |
| Selection Type | Items(s) |
| Item(s) | P4_DEPT_NO |
| TRUE action | Submit Page |

4. Add and interactive report region called ‘Employees’ below the department region using the following SQL.

```
SELECT c001 dept_name, 
       c002 emp_name, 
       c003 job_title, 
       c004 location,
       n001 empno,
       d001 hiredate
FROM apex_collections
WHERE collection_name = 'EMPLOYEES'
```

5. Right-click on Before Header within Rendering > Pre-Rendering and select ‘Create Process’ entering the following properties.

| Name | Get Client Credentials |
| --- | --- |
| Type | PL/SQL Code |
| PL/SQL Code | See step 3 |
| Sequence | 10 |

6. Use the following PL/SQL Code for the process (Client 1 has access to the3 Employee Web Services)

```
ordsdemo.get_client_credentials(pv_name => 'Client 1',
                                pv_id_o => :P4_CLIENT_ID,
                                pv_secret_o => :P4_CLIENT_SECRET);
```

7. Click on the processing tab and create a new process to call the Web Service each time the page is submitted using the following properties.

| Name | Execution Options > Point |
| --- | --- |
| Type | Web Service |
| Web Service Operation | All Employees – doREST |
| Store Result in | Collection |
| Collection Name | EMPS_JSON |
| Execution Options > Sequence | 10 |
| Execution Options > Point | Processing |

8. In the processing tree, expand the options beneath the process to display the two IN parameters.  
9. Click on the ‘Authorization’ parameter, set the source to ‘PL/SQL Function Body’ and then enter the following PL/SQL to return the access token.

```
BEGIN
 apex_web_service.oauth_authenticate(p_token_url => 'http://localhost:8081/ords/api/oauth/token',
                                     p_client_id => :P4_CLIENT_ID,
                                     p_client_secret => :P4_CLIENT_SECRET); 
 RETURN 'Bearer '||apex_web_service.oauth_get_last_token;
END;
```

10. Click on the ‘department_number’ parameter and set the source to ‘Item’ and the item to ‘P4_DEPT_NO’.  
11. Add a second process using the following parameters.

| Name | Populate Collection |
| --- | --- |
| Type | PL/SQL Code |
| PL/SQL Code | See next step |
| Execution Options > Sequence | 20 |
| Execution Options > Point | Processing |

12. Use the following PL/SQL for the process to get the response data and build a new collection of employees.

```
DECLARE
 lc_data CLOB;
 lj_emps apex_json.t_values;
BEGIN
 select clob001 
 INTO lc_data
 from apex_collections 
 where collection_name = 'EMPS_JSON';
 
 :P4_CLOB := lc_data;

apex_json.parse(lj_emps, lc_data); 
 apex_collection.create_or_truncate_collection('EMPLOYEES'); 
 
 FOR x IN 1 .. apex_json.get_count(p_path => 'items', p_values => lj_emps) LOOP 
  apex_collection.add_member(p_collection_name => 'EMPLOYEES',
                             p_c001 => apex_json.get_varchar2(p_path   => 'items[%d].dname',
                                                              p0       => x,
                                                              p_values => lj_emps),
                             p_c002 => apex_json.get_varchar2(p_path   => 'items[%d].ename',
                                                              p0       => x,
                                                              p_values => lj_emps),
                             p_c003 => apex_json.get_varchar2(p_path   => 'items[%d].job',
                                                              p0       => x,
                                                              p_values => lj_emps),
                             p_c004 => apex_json.get_varchar2(p_path   => 'items[%d].loc',
                                                              p0       => x,
                                                              p_values => lj_emps),
                             p_n001 => apex_json.get_number(p_path   => 'items[%d].empno',
                                                            p0       => x,
                                                            p_values => lj_emps),
                             p_d001 => apex_json.get_date(p_path   => 'items[%d].hiredate',
                                                          p0       => x,
                                                          p_values => lj_emps)); 
 END LOOP; 
END;
```

13. Save and run the page, selecting Accounting for the department.

When the page runs, the pre-rendering process obtains the client id and secret for Client 1 and stores them in the two hidden items.

Each time the department select list is changed the dynamic action submits the page and runs the processes to call the Web Service and process the results.

The parameters for the Web Services are populated automatically before it runs. The Authorization parameter is populated with a new access token using the oauth_authenticate procedure in conjunction with the client id and secret.

The department_number is set to the value of P4_DEPT_NO item.

The populate collection process then obtains the JSON results from the collection, parses it and then loops through each employee adding the details to a new collection for the Interactive report region to query.

[![Calling Web Services from APEX](https://content.dsp.co.uk/hs-fs/hubfs/Imported_Blog_Media/3_Employees-and-OAuth.jpg?width=1180&name=3_Employees-and-OAuth.jpg)](https://content.dsp.co.uk/hubfs/Imported_Blog_Media/3_Employees-and-OAuth.jpg)

### **Accessing an OAuth2 protected GET method Web Service via apex_web_service**

As we did for page 3, we can use the apex_web_service PL/SQL API to call the Web Service directly. To do this we can copy page 4 and amend it.

1. Open page 4.  
2. Click on the ‘Create’ icon and then select ‘Page as Copy’.  
3. Leave ‘Page in this application’ selected and press ***Next***.  
4. Enter 5 for the new page number and ‘Employees – API’ for the name. Press ***Next***.  
5. Select ‘Create a new navigation menu entry’. Press ***Next***.  
6. Press ***Copy***.

We no longer need the process to call the web service so this can be deleted. To do this simply highlight the process in the tree and press delete. Now we need to update the process that populates to the collection so that it also calls the Web Service. We also need to generate an access token to pass as a parameter along with the department number. To do this update the PL/SQL code with the following.

```
DECLARE
 lc_data CLOB;
 lj_emps apex_json.t_values;
BEGIN
 -- Generate access tokem
 apex_web_service.oauth_authenticate(p_token_url     => 'http://localhost:8081/ords/api/oauth/token',
                                     p_client_id     => :P5_CLIENT_ID,
                                     p_client_secret => :P5_CLIENT_SECRET);
 
 -- Set parameter values
 apex_web_service.g_request_headers(1).name := 'Authorization';
 apex_web_service.g_request_headers(1).value := 'Bearer ' || apex_web_service.g_oauth_token.token;
 apex_web_service.g_request_headers(2).name := 'department_number';
 apex_web_service.g_request_headers(2).value := :P5_DEPT_NO;
 
 -- Call Web Servive
 lc_data := apex_web_service.make_rest_request(p_url         => 'http://localhost:8081/ords/api/hr/v1/all_employees',
                                               p_http_method => 'GET'); 
 :P5_CLOB := lc_data; 
 apex_json.parse(lj_emps, lc_data); 
 
 -- Loop through all returned employees and build new collection
 apex_collection.create_or_truncate_collection('EMPLOYEES2'); 
 FOR x IN 1 .. apex_json.get_count(p_path => 'items', p_values => lj_emps) LOOP 
 apex_collection.add_member(p_collection_name => 'EMPLOYEES2',
                            p_c001            => apex_json.get_varchar2(p_path   => 'items[%d].dname',
                                                                        p0       => x,
                                                                        p_values => lj_emps),
                            p_c002            => apex_json.get_varchar2(p_path   => 'items[%d].ename',
                                                                        p0       => x,
                                                                        p_values => lj_emps),
                            p_c003            => apex_json.get_varchar2(p_path   => 'items[%d].job',
                                                                        p0       => x,
                                                                        p_values => lj_emps),
                            p_c004            => apex_json.get_varchar2(p_path   => 'items[%d].loc',
                                                                        p0       => x,
                                                                        p_values => lj_emps),
                            p_n001            => apex_json.get_number(p_path   => 'items[%d].empno',
                                                                      p0       => x,
                                                                      p_values => lj_emps),
                            p_d001            => apex_json.get_date(p_path   => 'items[%d].hiredate',
                                                                    p0       => x,
                                                                    p_values => lj_emps)); 
 END LOOP; 
END;
```

Finally, update the SQL query for the Employees interactive report to use the collection name ‘EMPLOYEES2’. Now save and run the page, selecting Accounting for the department.

As before, when the page runs the pre-render process obtains the client id and secret. When department is changed the page is submitted and the process to call the Web Service runs. This time the process generates the access token and then uses the apex_web_service API to set the values of the two HTTP header parameters before calling the Web Service and processing the JSON response to build the employee collection.

### **Dealing with paginated JSON data**

The previous examples have all called Web Services that return non-paginated JSON data; however, when they return large volumes of data the responses are typically paginated. This example uses the original Employees GET method Web Services that paginates the employees into sets of five. As we did for page 5 we will start by copying page 4.

1. Open page 4.  
2. Click on the ‘Create’ icon and then select ‘Page as Copy’.  
3. Leave ‘Page in this application’ selected and press ***Next***.  
4. Enter 6 for the new page number and ‘Pagination’ for the name. Press ***Next***.  
5. Select ‘Create a new navigation menu entry’. Press ***Next***.  
6. Press ***Copy***.

We no longer need either of the two processes to call the web service or populate the collection so delete them both. Keep the pre-rendering process to get the client credentials, as this is still required.

When a Web Service returns paginated data it will also contain navigation links (e.g. next, previous and first) which we can extract. The links will consist of the URL to call the web service with the addition of a URI parameter to instruct the Web Service which page of data to return. In this example, we will extract the links and store them in three text items. We will then add navigation buttons to the report region to use the links.

1. Add the following four items to the Department region below P6_CLOB.

a. P6_URL (hidden)  
b. P6_PREV (display only)  
c. P6_NEXT (display only)  
d. P6_FIRST (display only)

2. Change the report type of the Employees region from Interactive Report to Classic Report and change the collection name used in the SQL query to ‘EMPLOYEES3’. Change the pagination type within the reports attributes to ‘No Pagination (Show All Rows)’.  
3. Create a new custom dynamic action with the following properties to call the Web Service and populate the EMPLOYEES3 collection.

| Name | Call API and populate collection |
| --- | --- |
| Event | Custom |
| Custom Event | CallEmployeeAPI |
| Selection Type | JavaScript Expression |
| JavaScript Expression | document |

4. Update the Show TRUE action using the following properties.

| Action | Execute PL/SQL Code |
| --- | --- |
| PL/SQL Code | See step 5 |
| Items to Return | P6_CLOB,P6_NEXT,P6_PREV,P6_FIRST |
| Event | Call API and populate collection |
| Sequence | 10 |

5. Use the following for the PL/SQL code for the TRU action.

```
DECLARE
 lc_data CLOB;
 lj_emps apex_json.t_values;
 lv_token VARCHAR2(100);
BEGIN

 -- Generate a new access token using the client credentials
 apex_web_service.oauth_authenticate(p_token_url => 'http://localhost:8081/ords/api/oauth/token',
                                     p_client_id => :P6_CLIENT_ID,
                                     p_client_secret => :P6_CLIENT_SECRET);
 lv_token := apex_web_service.oauth_get_last_token; 
 
 IF lv_token IS NOT NULL THEN
 
  -- Set Paramaters 
  apex_web_service.g_request_headers(1).name := 'Authorization';
  apex_web_service.g_request_headers(1).value := 'Bearer ' || lv_token;
  apex_web_service.g_request_headers(2).name := 'department_number';
  apex_web_service.g_request_headers(2).value := :P6_DEPT_NO;
 
  -- Call the Web Service and store the JSON formatted response into a CLOB 
  lc_data := apex_web_service.make_rest_request(p_url => NVL(:P6_URL,'http://localhost:8081/ords/api/hr/v1/employees'),
                                                p_http_method => 'GET'); 
 
  -- Parse JSON data and extract data into collection 
  apex_json.parse(lj_emps, lc_data); 
  apex_collection.create_or_truncate_collection('EMPLOYEES3'); 
 
  FOR x IN 1 .. apex_json.get_count(p_path => 'items', p_values => lj_emps) LOOP
 
    apex_collection.add_member(p_collection_name => 'EMPLOYEES3',
                               p_c001            => apex_json.get_varchar2(p_path   => 'items[%d].dname',
                                                                           p0       => x,
                                                                           p_values => lj_emps),
                               p_c002            => apex_json.get_varchar2(p_path   => 'items[%d].ename',
                                                                           p0       => x,
                                                                           p_values => lj_emps),
                               p_c003            => apex_json.get_varchar2(p_path   => 'items[%d].job',
                                                                           p0       => x,
                                                                           p_values => lj_emps),
                               p_c004            => apex_json.get_varchar2(p_path   => 'items[%d].loc',
                                                                           p0       => x,
                                                                           p_values => lj_emps),
                               p_n001            => apex_json.get_number(p_path   => 'items[%d].empno',
                                                                         p0       => x,
                                                                         p_values => lj_emps),
                               p_d001            => apex_json.get_date(p_path   => 'items[%d].hiredate',
                                                                       p0       => x,
                                                                       p_values => lj_emps)); 
 END LOOP;
 END IF;
 
 :P6_CLOB := lc_data; 
 :P6_NEXT := apex_json.get_varchar2(p_path => 'next."$ref"',
                                    p_values => lj_emps);
 :P6_FIRST := apex_json.get_varchar2(p_path => 'first."$ref"',
                                     p_values => lj_emps);
 :P6_PREV := apex_json.get_varchar2(p_path => 'prev."$ref"',
                                    p_values => lj_emps);
 
END;
```

6. Add a second TRUE action to refresh the Employees classic report region.

| Action | Refresh |
| --- | --- |
| Selection Type | Region |
| Region | Employees |
| Event | Call API and populate collection |
| Sequence | 20 |

We now have a custom dynamic action to call the web service, process the response into a collection and extract the next, previous and first URL links. We can now add some navigation buttons to the page to call it and return the relevant pages of employee data. We can also call it when the page loads so the page is not blank when first opened.

1. Create a page load Dynamic Action using the following properties.

| Name | Call Web Service on page load |
| --- | --- |
| Event | Page Load |

2. Update the show TRUE action using the following properties to call the custom dynamic action when the page loads..

| Action | Execute JavaScript Code |
| --- | --- |
| Code | apex.event.trigger(document,”CallEmployeeAPI”); |
| Event | Call Web Service on page load |
| Sequence | 10 |

3. Next, we need to change the existing dynamic action ‘Refresh Employees’ that runs when the department select list is changed (P6_DEPT_NO). Change the Submit Page action to Execute PL/SQL Code using the following properties.

| Action | Execute PL/SQL Code |
| --- | --- |
| PL/SQL Code | :P6_URL := ‘http://localhost:8081/ords/api/hr/v1/employees’; |
| Items to Submit | P6_DEPT_NO |
| Items to Return | P6_URL |
| Sequence | 10 |

4. Now add the following second action.

| Action | Execute JavaScript Code |
| --- | --- |
| Code | apex.event.trigger(document,”CallEmployeeAPI”); |
| Sequence | 20 |

5. Save and run the page.

When the page first loads the pre-rendering process obtains the client credentials. Next, the Page Load dynamic action calls the custom dynamic action, which in turn calls the Web Service, populates the employee collection, extracts the navigation links and refreshes the employee classic report region. Each time the department is changed the custom dynamic action is called to refresh the links and employee region.

Now we need to add some buttons that use the navigation links to page through the employees.

1. Add three buttons to the employee region as follows.

| FIRST | Button Position: Previous |
| --- | --- |
| PREVIOUS | Button Position: Previous |
| NEXT | Button Position: Next |

2. Add a click event dynamic action to the FIRST button with the name ‘Go to first page’ and then add the following two TRUE actions.

| Action 1 |   |
| --- | --- |
| Action | Execute PL/SQL Code |
| PL/SQL Code | :P6_URL := :P6_FIRST; |
| Items to Return | P6_URL |
| Sequence | 10 |

| Action 2 |   |
| --- | --- |
| Action | Execute JavaScript Code |
| Code | apex.event.trigger(document,”CallEmployeeAPI”); |
| Sequence | 20 |

3. Add a click event dynamic action to the PREVIOUS button with the name ‘Go to previous page’ and then add the following two TRUE actions.

| Action 1 |   |
| --- | --- |
| Action | Execute PL/SQL Code |
| PL/SQL Code | :P6_URL := :P6_PREV; |
| Items to Return | P6_URL |
| Sequence | 10 |

| Action 2 |   |
| --- | --- |
| Action | Execute JavaScript Code |
| Code | apex.event.trigger(document,”CallEmployeeAPI”); |
| Sequence | 20 |

4. Add a click event dynamic action to the NEXT button with the name ‘Go to next page’ and then add the following two TRUE actions.

| Action 1 |   |
| --- | --- |
| Action | Execute PL/SQL Code |
| PL/SQL Code | :P6_URL := :P6_NEXT; |
| Items to Return | P6_URL |
| Sequence | 10 |

| Action 2 |   |
| --- | --- |
| Action | Execute JavaScript Code |
| Code | apex.event.trigger(document,”CallEmployeeAPI”); |
| Sequence | 20 |

5. Save and run the page selecting ALL departments.

[![Calling Web Services from APEX](https://content.dsp.co.uk/hs-fs/hubfs/Imported_Blog_Media/4_Pagination.jpg?width=1244&name=4_Pagination.jpg)](https://content.dsp.co.uk/hubfs/Imported_Blog_Media/4_Pagination.jpg)You will see that the returned JSON data contains five employee records and the navigation links. The links have been extracted and displayed in the relevant display only items. The employee classic report shows the first five employees.

If you press the ‘Next’ button, the Web Service will be called again, but this time using the link from P6_NEXT, which is suffixed with the page number to display. The returned JSON response now contains the next five employees and the new navigation links. You will notice that this time there is also a previous link as we are displaying the second page of employees. You can now use the three buttons to page back and forward through all of the employees.

To complete the page we need to make sure the next button is hidden when we are on the last page of employees and the previous button hidden when on the first. One way to do this is to add dynamic actions to P6_PREV and P6_NEXT as follows.

1. Create a change event dynamic action for P6_PREV with the following properties.

| Name | Show/Hide Previous Button |
| --- | --- |
| Event | Change |
| Selection Type | Item(s) |
| Item(s) | P6_PREV |
| Client-side Condition: Type | Item is not null |
| Client-side Condition: Item | P6_PREV |

2. Add the following TRUE and FALSE actions to the dynamic action.

| TRUE Action |   |
| --- | --- |
| Action | Show |
| Affected Elements: Selection Type | Button |
| Button | PREVIOUS |

| FALSE Action |   |
| --- | --- |
| Action | Hide |
| Code | Button |
| Sequence | PREVIOUS |

3. Create a change event dynamic action for P6_NEXT with the following properties.

| Name | Show/Hide Previous Button |
| --- | --- |
| Event | Change |
| Selection Type | Item(s) |
| Item(s) | P6_NEXT |
| Client-side Condition: Type | Item is not null |
| Client-side Condition: Item | P6_NEXT |

4. Add the following TRUE and FALSE actions to the dynamic action.

| TRUE Action |   |
| --- | --- |
| Action | Show |
| Affected Elements: Selection Type | Button |
| Button | NEXT |

| FALSE Action |   |
| --- | --- |
| Action | Hide |
| Code | Button |
| Sequence | NEXT |

5. Save and run the page.

Now when the page runs the next and previous buttons are only displayed if there is an applicable link.

### **POST, PUT and DELETE requests**

You can also use the apex_web_service API to call POST, PUT and DELETE method Web Services. For Example, you could add a departments maintenance page to call the Web Services we created in part one to add, update and delete departments.

To do this simply set the HTTP method parameter to POST, PUT or DELETE as applicable when calling the make_rest_request function and then use apex_json.get_varchar2 to extract the results from the response.

You can also use apex_web_service.g_status_code to get the response status code to check of the Web Service call returned a successful 200 OK status.

For more information, [get in touch](mailto:enquiries@dsp.co.uk) with our experts to find out more about our [APEX Services](https://www.dsp.co.uk/oracle-apex-services) or book a meeting...

[![Book a Meeting](https://no-cache.hubspot.com/cta/default/3321273/3414edc1-fbe5-40fe-9b35-42e662d82b55.png)](https://cta-redirect.hubspot.com/cta/redirect/3321273/3414edc1-fbe5-40fe-9b35-42e662d82b55)

---

 

**Author**: [Colin Archer ](https://content.dsp.co.uk/apex/author/colin-archer)

**Job Title**: Senior Oracle APEX Development Consultant

**Bio**: Colin is a Senior Development Consultant at DSP with 20 years’ experience of analysis, design, and development of bespoke Oracle applications for a wide variety of business functions. Building on his previous experience of Forms and PL/SQL he is now focusing on developing high quality fit for purpose solutions using APEX.

 

---

 

[OAuth2](https://content.dsp.co.uk/topic/oauth2) [ORDS](https://content.dsp.co.uk/topic/ords) [How to](https://content.dsp.co.uk/topic/how-to) [RESTful](https://content.dsp.co.uk/topic/restful) [APEX](https://content.dsp.co.uk/topic/apex) [Oracle APEX](https://content.dsp.co.uk/topic/oracle-apex)

[30-Oct-2017 10:08:26

ORDS,OAuth2 & Web Services in APEX – Part 1

](https://content.dsp.co.uk/web-services-part-1) [13-Nov-2017 12:05:31

ORDS, OAuth2 & Web Services in APEX – Part 2

](https://content.dsp.co.uk/ordsoauth2-web-services-in-apex-part-2) [03-Nov-2020 12:12:00

APEX Authentication Using Microsoft Azure Face API

](https://content.dsp.co.uk/apex-authentication-using-microsoft-azure-face-api)

[Previous

Options For Loading Excel Data Into APEX Applications

](https://content.dsp.co.uk/options-loading-excel-data-apex-applications)

[Next

Introducing APEX TabLock

](https://content.dsp.co.uk/introducing-apex-tablock)

#### Contact

Sales Enquiries  
[+44 (0) 203 880 1686](tel:+4420%2038801686)

Technical Support  
+44 (0) 330 058 8367

[enquiries@dsp.co.uk](mailto:enquiries@dsp.co.uk)

#### Follow us

<https://www.linkedin.com/company/dsp-explorer> <https://twitter.com/dspexplorer> <https://www.facebook.com/DSPcloud>

#### Office Locations

[**London (Head Office)**](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,198m/data=!3m2!1e3!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MTAwOC4wIKXMDSoASAFQAw%3D%3D)  
[Chancery House](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)  
[53-64 Chancery Lane](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)  
[London](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)  
[WC2A 1QS](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)

[**Leeds**  
Richmond House,  
Lawnswood Business Park,  
Leeds,  
LS16 6QY](https://www.google.com/maps/dir/53.8405223,-1.6062773/DSP-Explorer/@53.8404788,-1.6061783,17z/data=!4m9!4m8!1m1!4e1!1m5!1m1!1s0x4879591e5d204ac9:0x4e41b926d72adca!2m2!1d-1.6064847!2d53.8404842)

[**Derby**](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[Cubo Pride Park,](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[1 Pride Place](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[Derby](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[DE24 8QR](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
**  
[Dublin](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)**  
[Inniscarra,](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)  
[Main Street,](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)  
[Rathcoole,](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)  
[Dublin](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)<https://www.google.com/maps/place/70+Gracechurch+St,+Langbourn,+London+EC3V+0XL/@51.512117,-0.0869173,17z/data=!3m1!4b1!4m5!3m4!1s0x4876035256ab55cb:0x1f93b337c0190cf0!8m2!3d51.512117!4d-0.0847286><https://www.google.com/maps/place/Devonshire+House/@51.2797714,-1.0679275,15z/data=!4m5!3m4!1s0x0:0x4f204507edd15263!8m2!3d51.2797718!4d-1.0679748>

#### About Us

DSP is a Data Management and Cloud Platform MSP that delivers enterprise grade support & consulting services for Oracle, Microsoft and Multi-Cloud technologies.

![Oracle Partner](https://content.dsp.co.uk/hubfs/logo-2021/Partner-logos/Oracle-logos/Colour/o-prtnr-cmyk-250.png)

![Microsoft Partner](https://content.dsp.co.uk/hubfs/Microsoft%20partner%20logos%20-%20July%202023/mic-sol-part-colour@200x.png)

![Google Cloud Partner](https://content.dsp.co.uk/hubfs/logo-2021/Partner-logos/GCP-Logos/Google-Cloud-Partner%20(1).svg)

Registered Office: 30 City Road, London, EC1Y 2AB.  
Company Registration Number: 03898451

<https://content.dsp.co.uk/ordsoauth2-web-services-in-apex-part-3#>

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "dateModified" : "2024-10-01",
  "datePublished" : "2024-10-01",
  "headline" : "ORDS, OAuth2 &amp; Web Services in APEX – Part 3",
  "image" : [ "https://www.dsp.co.uk/hubfs/Imported_Blog_Media/3_Employees-and-OAuth.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://content.dsp.co.uk/ordsoauth2-web-services-in-apex-part-3",
    "@type" : "WebPage"
  }
}
```