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? |
---|---|---|
Yes. Deletes a resource. |
No. |
|
Yes. Gets a single resource. |
Yes. Gets a subset, or all of the resources in the collection. |
|
Yes. Updates a resource. |
No. |
|
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:
|
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, |
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, |
expandRefFull |
|
fields |
Gets information for the specified fields. The valid values include:
|
q |
Used to filter results for a collection of resources. See Manage Collections for more information. |
showParentPks |
|
showPks |
|
showRefIDs |
|
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:
The supported values and their behavior is as follows.
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:
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" topic in the online help for details. |
useSavedQueryAsSubQuery |
|
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 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. |
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 DELETE Method
Use to delete a resource. The method doesn't require a request body.