Access Metadata

You can use the GET method to retrieve metadata about REST resources from their /describe endpoints. Each resource's metadata contains a comprehensive description, including the object resource URIs, attributes, supported actions, child resources, and list-of-value (LOV) resources. The metadata also includes attribute properties such as name, type, mandatory, updatable, queryable, and so on.

How You Retrieve Metadata for a Specific Resource

Perform a GET operation on the resource using this request URL syntax:

https://<host>:<port>/hcmRestApi/resources/<version>/<resource>/describe
Content-Type: application/vnd.oracle.adf.resourceitem+json

You can make many types of HTTP requests using Oracle Applications Cloud REST APIs to view, create, update, or delete records. As an example, let's look at how to send a simple REST HTTP request to find out the structure of a workers object.

To retrieve metadata for the workers resource, perform a GET operation using this request URL:

https://servername.fa.us2.oraclecloud.com/hcmRestApi/resources/11.13.18.05/workers/describe
Content-Type: application/vnd.oracle.adf.resourceitem+json

You can also use this cURL command to perform the operation:

curl -X GET -u <username:password> https://servername.fa.us2.oraclecloud.com/hcmRestApi/resources/11.13.18.05/workers/describe HTTP/1.1 -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json'  | json_pp

How You Retrieve Metadata for All Resources

Caution:

Use this method only when you want to retrieve the full metadata for all resources hosted in an application, because it can overload your application and increase the response time.

To retrieve the metadata for all resources hosted in the application, perform a GET operation using this request URL:

https://servername.fa.us2.oraclecloud.com/hcmRestApi/resources/11.13.18.05/describe
Content-Type: application/vnd.oracle.adf.resourceitem+json

You can also use this cURL command to perform the operation:

curl -X GET -u <username:password> https://servername.fa.us2.oraclecloud.com/hcmRestApi/resources/11.13.18.05/describe HTTP/1.1 -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json'  | json_pp

Such a request might return a very large result, but there might be times when you need to inventory all available resources.

How You Retrieve Minimal Metadata for All Resources

To limit the amount of metadata retrieved for an application, use the metadataMode parameter. Perform a GET operation using this request URL:

https://servername.fa.us2.oraclecloud.com/hcmRestApi/resources/11.13.18.05/describe?metadataMode=minimal

You can use this cURL command to return only the resources:

curl -X GET -u <username:password> https://servername.fa.us2.oraclecloud.com/hcmRestApi/resources/11.13.18.05/describe?metadataMode=minimal HTTP/1.1 -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json'  | json_pp

Note:

You can't use the metadataMode parameter to access the metadata for a specific resource.

If your application has a large number of custom objects, you can use the metadataMode parameter to retrieve a smaller response much faster.

Examples

Here are some examples of attributes, LOVs, and finders in the /describe endpoint response of the workers resource.

The describe operation returns attributes of the workers resource, for example ,PersonId, PersonNumber, and so on.
The describe operation returns the finders and finder attributes of the workers resource, for example, PrimaryKey and its attributes DisabilityId, EffectiveEndDate, and EffectiveStartDate.