Sending API Requests

This topic explains how to send HTTP requests to the Oracle Unity API.

Introduction

A basic request has several components not including authentication. An Oracle Unity API request follows the form:

[Verb][AccountURL]/[Endpoint]

Where...

  • Verb represents the HTTP request "method" type. Oracle Unity's API services support four different verbs or methods: POST, GET, PUT and DELETE. In terms of database functions, these HTTP verbs correspond to the basic operations of "CRUD": create, read, update and delete.
  • AccountURL is your URL to your Oracle Unity account. Contact your tenant administrator if you do not know your Account URL.
  • Endpoint is the path of the Oracle Unity resource.
  • Some endpoints also require an {AccessKey}, this is your tenant access key, see Determining Tenant Access Keys and Tenant IDs if you do not know yours.

Therefore an example of a complete request would be as follows:

GET https://oracle-tenant.cxunity.ocs.oc.com/api-metadata/v1/{AccessKey}/metadata/tables

Learn more by watching the video

Use cases

  • Leverage the API to create programs and scripts to automate tasks you would normally use the user interface to do, thus alleviating the need for manual work and thereby saving time.

  • Extend your use of the Oracle Unity platform by adopting capabilities of the platform that are only available using the API endpoints.

Workflow

The sequence of steps required for processing Oracle Unity REST API requests is:

  1. Client obtains an authentication token.
  2. Client sends a request to an Oracle Unity API endpoint. For example:

    Authorization: Bearer <token>
    Content-Type: application/json
    GET https://oracle-tenant.cxunity.ocs.oc.com/api-metadata/v1/e2a7a0df2410470d85ef69c8dad2bdb8/metadata/tables			
 

API Endpoints

The Oracle Unity platform provides the following APIs for programmatically performing workflows such as ingesting data, analyzing & enriching data, and exporting data to other systems and integrated platforms.

API Description Service URI
Address Validation

Address verification is done as part of the Data warehouse job after ingest jobs successfully import address data into the Oracle Unity data model.

Oracle Unity uses the third-party service Loqate as an address validation service. Loqate standardizes its address data coverage based on country of residence. Review the address coverage of Loqate. For U.S. address data, Loqate uses CASS as an additional address validation feature.

The API is used to view or update your Address Validation settings.

/api-metadata/v1/{access-key}/metadata/transforminstances/DWLoqateValidator

 

Intelligent Attributes

Intelligent attributes allow you to simplify the calculation of aggregated values for your customer and account data. For example, to calculate the average return value for a customer, you'll need to consider the historic purchase total each time any new event and new transaction for this customer occurs. By using an intelligent attribute to calculate this value, the attribute would update automatically when there is a new purchase and transaction event for a particular customer, simplifying the way the value is calculated.

There are two types of intelligent attributes: Intelligent Attributes and Bucket Attributes.

/api-metadata/v1/{access-key}/metadata/aggregatedtables/{aggregatedTableId}/aggregatedattributes
Aggregated Data Object (Master Entities)

A master entity is a data object in the data model that stores unified records. The output of deduplication, merge, and promotion of source records are stored in corresponding master entities. Examples of master entities are Master Customer, Master Account, and Master Product.

The Master entities API is used to programmatically manage the master entities in your Unity instance, also known as "Aggregated tables".

/api-metadata/v1/{access-key}/metadata/aggregatedtables
Bucket Attributes

Bucket Attributes group data according to rules you specify. Bucket attributes are based on another attribute (either a data object or an aggregated attribute).

For example, "age_bands" is a bucket attribute, based on the age attribute, that groups customers by their age into the following buckets:

  • Under 18

  • 18-44

  • 45-64

  • 65+

/api-metadata/v1/{access-key}/metadata/aggregatedtables/{aggregatedTableId}/buckets
Clusters

Deduplication is a task to match and link duplicate customer records. This task is a part of ID resolution.

When deduplication is complete, Oracle Unity ensures that multiple records belonging to the same person are linked to one master record and don't count as more than one person.

Oracle Unity deduplicates data records by "clustering" all records belonging to distant persons, matching similar records, and linking records to one master identifier.

The Clusters API is used to programmatically manage the Deduplication rules in your Oracle Unity instance.

/api-metadata/v1/{access-key}/metadata/clusters
Cubes

Cubes are components of models that provide additional dimensions. You may use Cubes to add additional dimensions to your reports, queries, or aggregated attributes.

/api-metadata/v1/{access-key}/metadata/models/cubes
Customer 360

Using data from Oracle Unity, the Customer 360 API creates customer profiles to provide a 360 view of your customers. This API enables use cases such as:

  • Search Basic Customer Information

  • Search Customer "Intelligent Attributes"

  • Find All Addresses for a Customer Record

  • Retrieve Time-Series Order Information from Multiple Sources

  • Search Account Profile Data

/api-data/v1/{access-key}/data/idgraph/
Data Density

The data density figure represents the percentage of records that have values for an attribute. For example, if only half the total number of records in the Address data object have a non-null value populated for the State attribute, then the data density value for State is 50%.

Use the data density API for the following use cases:

  • Checking how many rows exist in a data object.
  • Checking per data object attribute, how many are null/populated.
  • Checking the density is per attribute, i.e. the percentage of records with the attribute populated.
/api-data/v1/{access-key}/data/density/entities/{tableId}
Data Query

The Data query APIs are used to execute queries against data objects using MCPS query objects.

/api-data/v1/{access-key}/data/query/
Data Source Views

Data Source Views are metadata objects that tell other objects where to look for data.

Example: ID Graph Rules need to reference a Data Source View to inform Oracle Unity which attributes comprise the ID Graph Rule. The attributes selected then become the search-able attributes when using the Customer 360 API.

Data Source Views are needed for aggregated attributes, models, and ID Graph Rules.

/api-metadata/v1/{access-key}/metadata/datasourceviews
DW Mapping Scripts

Data Warehouse (DW) Mapping Scripts are scripts that can pre-process data, when data is ingested into Unity.

/api-metadata/v1/{access-key}/metadata/dwmappingscripts
Models

Models are metadata objects that can be used to define attributes and characteristics for a data object. Not all data objects will have an associated model.

Example: There is an out-of-the-box model named "CA_OrderItemModel" that defines attributes for the Aggregated Attribute named "Total Spent Amount".

/api-metadata/v1/{access-key}/metadata/models
Job Sequences

Job sequences are a series of jobs you can configure to run on an ad hoc basis, or on a recurring schedule.

api/cx-unity-api/flows
Jobs

Jobs are tasks to transfer data or to complete system tasks. You can manage and monitor jobs from the Jobs page.

The Jobs API enables you to create, update, and retrieve your jobs.

/api-metadata/v1/{access-key}/metadata/jobs
Attribute Lookups

Oracle Unity allows you to look up attribute values on the segmentation canvas so that you can select values from a list instead of manually entering them. Oracle Unity comes with out-of-the-box lookups for many attributes.

The Attribute lookup API is used to create, retrieve, and update the lookups in your Oracle Unity instance.

/api-metadata/{access-key}/metadata/lookups
Promotion Rules

Promotion is a task to merge attribute values of source records and promote the optimal value to the master record attribute. For example, you can promote the optimal value of attributes such as first name, last name, address, and gender to a master entity. This task is a part of ID resolution.

You can use the Promotion Rule API to manage the promotion rules in your Oracle Unity instance.

/metadata/v1/{access-key}/metadata/aggregatedtables/{aggregatedTableId}/promotionrules
Destinations (Sink Instances)

Oracle Unity allows you to export data and segments by running export jobs and campaign jobs. Before setting up an export job or campaign in Oracle Unity, you will need to create the destination, which includes all the details of where the data will be exported to.

Note: To create the destination, you will need to provide your own Secure FTP site to enable the data transfer. Oracle Unity does not provide Secure FTP sites.

You can use the Destinations API to create, update, and retrieve your Destinations.

/api-metadata/v1/{access-key}/metadata/sinkinstances
Sources

You will need to create sources in Oracle Unity so that customer data can be imported into the data model. These sources will provide all the details needed so that Oracle Unity can run ingest jobs and import data.

Ensure source files are formatted correctly by reviewing CSV file standards for Oracle Unity.

Note: To create the source, you will need to provide your own Secure FTP site to enable the data transfer. Oracle Unity does not provide Secure FTP sites.

The sources API is used to programmatically manage the sources in your instance.

/api-metadata/v1/{access-key}/metadata/sourceinstances
Stream

The Streaming API is used to ingest data directly from applications into Oracle Unity. Unlike using in ingest job, when data is streamed you cannot map or transform the data. A typical use case could be to send data updates to Oracle Unity once customers save their profile.

/api-stream/v1/<tenantAccessKey>/data/entities
Data Objects

Oracle Unity comes with a default set of data objects for your data model that gives the tools necessary to effectively manage your customer data. However, if the existing data objects don't fully meet the needs of your organization, you can create custom data objects.

Use the Data Objects API to retrieve and update information about your data objects and their attributes.

/api-metadata/v1/{access-key}/metadata/tables