Supported HTTP Methods

The most commonly used HTTP methods (or verbs) are GET, POST, PATCH, and DELETE. The building blocks of REST APIs, these methods define actions applied to REST resources using their URLs.

The following table lists the methods and their scope for singular and collection resources.

Method Works with a Singular Resource? Works with a Collection Resource?

DELETE

Yes. Deletes a resource.

No.

GET

Yes. Gets a single resource.

Yes. Gets a subset, or all of the resources in the collection.

PATCH

Yes. Updates a resource.

No.

POST

Yes. Creates a new resource.

No, for a collection of root resources. Yes, for a collection of child resources for an existing root resource.

The GET Method

Use this method to retrieve information from a resource. To query both a singular resource and a collection resource, use expand, fields, and expandRefs query parameters. To filter the queried result, use different parameters for a singular resource and a collection resource.

The following table lists common parameters for querying singular resources and resource collections.

Parameter Description

expand

Gets the child resources along with the parent resource when you query a hierarchical resource. The server doesn't return child resources by default. The valid values include:

  • Name of a single child resource.
  • Comma-separated list of child resource names to specify multiple values.
  • Keyword all to expand all child resources.

expandRefs

This query parameter controls whether an ID will be shown for a foreign key or whether there will be a link URL to the referenced resource. The default if not specified is determined by the value of the system property, glog.fusion.cil.restapi.config.expandRefResources, which defaults to true. If true the reference resource links will be shown.

expandChildRefs

This query parameter controls whether to expand references resources as part a child resource or not.

The default if not specified is determined by the value of the system property, glog.fusion.cil.restapi.config. expandChildRefResources, which defaults to false. If false, the child reference resource GID will be shown. When true, all columns of the child reference resources will be shown.

expandRefFull

[true/false: default false] Used to control whether or not referenced resource attributes are shown when "expand=all" is used. The default, if not specified, is determined by the value of the system property, glog.fusion.cil.restapi.config.expandRefFull, which defaults to false. If true, the reference resource attributes will be shown.

fields

Gets information for the specified fields. The valid values include:

  • Name of a single property.
  • Comma-separated list of property names to specify multiple values.
q

Used to filter results for a collection of resources. See Manage Collections for more information.

showParentPks

[true/false: default false] Used to control whether parent primary key attributes (i.e. GIDs) appear in returned child resources.

showPks

[true/false: default false] Used to control whether resource primary key attributes (i.e. GIDs) appear in returned resources.

showRefIDs

[true/false: default false] Used to control whether both the actual property name and resource structure for a referenced resource is shown. For example, by default the "sourceLocation" resource is show for an "orderReleases" resource which will contain a "link" to the actual resource. The "link" will contain the resource primary key. If this property is true, the sourceLocationGid property (with the string GID value) will also be shown. The default, if not specified, is decided by the value of the system property, glog.fusion.cil.restapi.config.showRefID, which defaults to false. If true, the reference resource primary key attribute will be shown.

UOMs

Controls the UOM code and value shown for resources in response to a GET (pull) or as an outbound JSON message (push). There's a query parameter for each UOM type with the name following the pattern of <UOM name> + "UOM". The query parameter is used to control UOM codes on a per-request basis. The following <UOM names> are supported:
  • currency

  • weight

  • volume

  • distance

  • duration

  • speed

  • temperature

  • density

  • area

  • length

  • reportingquantity

The supported values and their behavior is as follows.
  • DISPLAY: Shows the User Preference if declared or the base UOM code if not. This us current behavior.

  • ENTERED: This shows the value and code specified when creating the property. If different from the system base UOM, the base value will be a conversion using the appropriate rate (i.e. standard UOM conversion or a specific exchange rate if a currency UOM).

  • PREF: Shows the user preference UOM code if declared.

  • BASE: Shows the system base UOM code.

  • FUNC (Currency UOMs only): This will show the currency value in the associated functional currency, if defined on the resource.

The values of the query parameter and property can be a comma separate ordered list of multiple UOM options listed above.

For example, for the following currency query parameter:

currencyUOM=PREF,ENTERED

This option will cause all currencies to show the User Preference if declared and revert to the as-entered currency if no preference is declared.

Note:

Following this logic, the option of "DISPLAY" is functionally equal to "PREF,BASE".

Similar functionality can be created using properties. See the "glog.fusion Propeteries" topic in the online help for details.

The POST Method

Creation of root resources should be done as a singular resource with the following media type:

application/vnd.oracle.resource+json; type=singular

Creation of a collection of resources is possible if these are sub-resources of a root resource. For example, it's possible to create multiple 'remarks' sub-resources for 'drivers' root resource. The media type for these messages must be:

application/vnd.oracle.resource+json; type=collection

The PATCH Method

Use to update data in a resource. There are two kinds of PATCH message, although both use the PATCH HTTP method: MERGE PATCH and JSON PATCH. The MERGE PATCH method updates only the fields specified in the request body, which must be in the format of the target resource. The request media type is:

application/vnd.oracle.resource+json; type=singular

The JSON PATCH method applies an array of operations in sequence to a target resource according the path and type of operation specified in each operation array item. The request media type is:

application/json-patch+json

The DELETE Method

Use to delete a resource. The method doesn't require a request body.