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 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.

PUT

Yes. Replaces data in a resource.

No.

The DELETE Method

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

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. When expand isn't provided, it returns the child resources of the target resource with links to the resources. The valid values include:

  • Single child resource name

    Expands the specified child resource to one level.

    Example: /v2/orderReleases/<orderReleaseGid>?expand=lines

    Expands the lines child resource to one level. Further children of lines (for example, orderRelease.lines.refnums, orderRelease.lines.remarks) are provided as links.

  • Comma-separated list of child resource names

    Expands multiple child resources.

    Example: /v2/orderReleases/<orderReleaseGid>?expand=lines,lines.refnums

    Expands the lines child resource and also expands refnums of lines. Other children of lines (for example, orderRelease.lines.remarks) are provided as links.

  • Keyword all

    Expands all child resources recursively at every level, including referenced resources.

    Example: /v2/orderReleases/<orderReleaseGid>?expand=all

    Expands all child resources recursively at every level.

expandRefs

Controls whether a foreign key is represented as a GID string or as a link URL to the referenced resource.

If not specified, the default is determined by the system property: glog.fusion.cil.restapi.config.expandRefResources which defaults to true.

When true, reference resource links are shown.

When false, GID strings are displayed for reference resources.

Examples:
  • /v2/orderReleases/<orderReleaseGid>?expand=all&expandRefs=true
  • /v2/orderReleases/<orderReleaseGid>?expand=all (Default expandRefs=true)
    • Expands all children recursively at every level, including referenced resources.
    • Children (for example, orderRelease.refnums, orderRelease.lines, orderRelease.lines.refnums) are fully expanded.
    • Child referenced resources (for example, orderRelease.lines.packagedItem, orderRelease.lines.orderBase) are fully expanded.
    • Target-level referenced resources (for example, sourceLocation, destLocation) remain partially expanded as links.
  • /v2/orderReleases/<orderReleaseGid>?expand=all&expandRefs=false
    • All child resources (for example, orderRelease.lines, orderRelease.lines.refnums, orderRelease.statuses) are recursively expanded.
    • Child referenced resources (for example, lines.packagedItem, lines.orderBase) are provided as GID strings.
    • Target resource references (sourceLocation, destLocation) are also provided as GID strings.
  • /v2/orderReleases/<orderReleaseGid>?expand=lines&expandRefs=true
  • /v2/orderReleases/<orderReleaseGid>?expand=lines (Default expandRefs=true)
    • Expands lines to one level.
    • Children of lines (for example, orderRelease.lines.refnums, orderRelease.lines.remarks) are provided as links.
    • Referenced resources (lines.packagedItem, lines.orderBase) are provided as GID strings.
    • Target references (sourceLocation, destLocation) are partially expanded.
  • /v2/orderReleases/<orderReleaseGid>?expand=lines&expandRefs=false
    • Expands lines to one level.
    • Children of lines (for example, lines.refnums, lines.remarks) are provided as links.
    • Referenced resources (lines.packagedItem, lines.orderBase) are shown as GID strings.
    • Target references (sourceLocation, destLocation) are also provided as GID strings.

expandChildRefs

Controls whether referenced resources of a child resource are expanded when expand=<childResource>&expandRefs=true is used. If not explicitly specified, the default behavior is controlled by: glog.fusion.cil.restapi.config.expandChildRefResources which defaults to false.

When false, only the child reference resource GID is displayed.

When true, all attributes (columns) of the child reference resources are included in the response.

Examples:
  • /v2/orderReleases/<orderReleaseGid>?expand=lines&expandChildRefs=true
  • /v2/orderReleases/<orderReleaseGid>?expand=lines&expandRefs=true&expandChildRefs=true
    • Expands lines to one level.
    • Remaining children (for example, lines.refnums, lines.remarks) are provided as links.
    • Child referenced resources (lines.packagedItem, lines.orderBase) are fully expanded.
    • Target referenced resources (sourceLocation, destLocation) are not affected by expandChildRefs; they're controlled by expandRefs.
  • /v2/orderReleases/<orderReleaseGid>?expand=lines&expandChildRefs=false
    • Expands lines to one level.
    • Remaining children (for example, lines.refnums, lines.remarks) are provided as links.
    • Child referenced resources (lines.packagedItem, lines.orderBase) are shown as GID strings.
    • Target referenced resources (sourceLocation, destLocation) aren't affected by expandChildRefs.

expandRefFull

[true | false]: Defaults to false. Controls whether referenced resource attributes are fully displayed when both expand=all and expandRefs=true are used. The default, if not specified, is controlled by: glog.fusion.cil.restapi.config.expandRefFull which defaults to false. When true, referenced resource attributes are fully displayed.

Examples:

  • /v2/orderReleases/<orderReleaseGid>?expand=all&expandRefFull=true
    • Target-level references (for example, sourceLocation, destLocation) are fully expanded with all attributes.
    • All children (for example, orderRelease.refnums, orderRelease.lines, orderRelease.lines.refnums) are expanded recursively.
    • Child referenced resources (for example, lines.packagedItem, lines.orderBase) are fully expanded.
  • /v2/orderReleases/<orderReleaseGid>?expand=lines&expandRefFull=true
    • expandRefFull isn't applied because expand=all isn't provided.
  • /v2/orderReleases/<orderReleaseGid>?expand=all&expandRefs=false&expandRefFull=true
    • expandRefFull isn't applied because expandRefs=true isn't specified.

fields

Retrieves only the specified properties. Valid values include: A single property name, A comma-separated list of property names

Examples:

  • /v2/orderReleases/<orderReleaseGid>?expand=all&fields=shipUnitOrigin,sourceLocation,lines.refnums
    • Returns only the selected fields: shipUnitOrigin, sourceLocation, and expanded lines.refnums.
  • /v2/orderReleases/<orderReleaseGid>?expand=lines.refnums&fields=lines.weight,lines.refnums,lines.remarks
    • Expands the specified child (for example, lines) to one level.
    • Returns the listed fields lines.weight,expanded lines.refnums and unexpanded lines.remarks.
    • Other child attributes (for example, lines.volume, lines.declaredValue) are excluded as they aren't part of fields.
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 (such as, GIDs) appear in returned child resources.

showPks

[true/false: default false] Used to control whether resource primary key attributes (ush as, 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 (such as, 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 Properties help for details.

useSavedQueryAsSubQuery

[true/false: default false] Used to control whether the saved query being executed runs with a join query or as a sub query. There could be a performance benefit in running the saved query as a sub query when the object being queried on has a high volume of data.

This query parameter is applicable when an advanced query is used with a saved query. For more details, see the Saved Query Execution section in Manage Collections.

Query Parameters with Bridge Resources

Only expand=all is supported, but not expand=<childResource>, on bridge resources.
  • Works correctly and expands all children of orderRelease:
    • /v2/shipments/<shipmentGid>/orderReleases?expand=all works correctly and expands all children of orderRelease.
  • Will return an error:
    • /v2/shipments/<shipmentGid>/orderReleases?expand=lines
    • /v2/shipments/<shipmentGid>?expand=orderReleases.lines
Field selection works for simple attributes and reference resources at the root level of bridge resources. It doesn't work for children of bridge resources. If child resources are included in fields, only simple links of the main bridge resource are returned.
  • Both of these URLs return simple orderReleases links without children:
    • /v2/shipments/<shipmentGid>/orderReleases?fields=lines
    • /v2/shipments/<shipmentGid>?fields=orderReleases.lines
  • Returns only the attributes orderBase and isTemplate:
    • /v2/shipments/<shipmentGid>/orderReleases?fields=orderBase,isTemplate
expand=all expands all child resources of the bridge resource recursively. In this example, it expands all children of orderRelease recursively.
  • /v2/shipments/<shipmentGid>/orderReleases?expand=all
expandRefs and expandRefFull work for root-level referenced resources of the bridge resource. In this example, it expands root-level referenced resources of bridge resources:
  • /v2/shipments/<shipmentGid>/orderReleases?expand=all&expandRefs=true&expandRefFull=true
It isn't possible to specify child resources directly in the URI of a bridge resource. The following URLs will not work:
  • /v2/shipments/<shipmentGid>/orderReleases/<orderReleaseGid>/statuses
  • /v2/shipments/<shipmentGid>/orderReleases/<orderReleaseGid>/lines

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 following table lists parameters that can be used with MERGE PATCH.

Parameter Description

includeChildren

This parameter helps you include both child and parent objects in the same PATCH request.

When the payload contains both parent and child objects, this parameter will decide whether to persist only the parent or to also include the child objects into persistence. The default value is false, which means that PATCH operation will not affect child resources. If it's set to true, the PATCH operation will be carried out on both parent and child resources in a single request.

When the "includeChildren" query parameter isn't provided, the behavior is based on the following property setting: glog.fusion.cil.restapi.config.includeChildren=true|false

When an asynchronous PATCH request or a PATCH request is made using batch transmission (JSON transmission), this property value will be used.

This parameter works with the glog.fusion.cil.restapi.config.patchParent.allowAddChild property. Both needs to be set to true to PATCH child records to an object that doesn't have any child records.

For example, if an order release doesn't contain accessorials, you can PATCH an accessorial to it if you have includeChildren=true and allowAddChild=true.

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

application/json-patch+json

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 PUT Method

Use to replace data in a resource. The replace operation must specify a "replaceChildren" query parameter, whose value is a comma separated list of child objects that should be replaced. This is only supported in asynchronous mode. The request media type is:

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

The following table lists parameters that can be used with PUT.

Parameter Description

replaceChildren

This parameter helps you include comma separated list of child objects that should be replaced.