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