Send Requests

Use the following guidelines when sending requests using the Oracle Cloud Metering API.

URL Structure

To perform operations on an Oracle Cloud Service resource by using REST API calls, you must specify the fully-qualified, unique URI of the resource.

The fully qualified URI of a resource is in the following format:

https://itra.oraclecloud.com/{base_path}/{resource_name}
Where:
  • base_path is the base URI of the resource. For example, /metering/api/v1. To view the REST resources, arranged alphabetically by resource path, see All REST Endpoints.

  • resource_name is the name of the specific resource that you are requesting. For example, for retrieving details about the usage consumption for an account, the resource_name is /usage/AccountId.

Supported Methods

The following table describes the REST HTTP methods you can invoke for Oracle Cloud Service objects.

HTTP Method Description
POST Creates an object by using the JSON-formatted data in the request body.
GET Retrieves information about the object/s specified in the request URI.
PUT Updates the attributes of an object by using the JSON-formatted data in the request body.

Each object for which you can perform API calls is identified uniquely by its URI.

Media Types

Oracle Cloud Metering API supports application/json as the base media type. Based on the type of operation you need to perform, refer to the respective service endpoints for the actual value of the supported media type.

Supported Headers

Oracle Cloud Metering API supports the following headers that may be passed in the header section of the HTTP request.

Header Description Optional / Mandatory Example

Accept

The Oracle Cloud Metering API returns JSON-encoded data in its responses. So the Accept header must be set to indicate this.

Mandatory if you are using thePOST or PUT HTTP method.

Optional if you are using the GET HTTP method.

Accept: application/vnd.com.oracle.oraclecloud.metering.cloudbucks+json

Content-Type

All the content in an HTTP request body sent to the API server must be encoded in JavaScript Object Notation (JSON).

Mandatory if you are using thePOST or PUT HTTP method.

Optional if you are using the GET HTTP method.

Content-Type: application/vnd.com.oracle.oraclecloud.metering.cloudbucks+json

X-ID-TENANT-NAME

The http header X-ID-TENANT-NAME must be set to the identity domain ID where the user resides.

Mandatory

X-ID-TENANT-NAME: myDomain