Learn About the Oracle API Platform Cloud Service REST APIs

Oracle API Platform Cloud Service provides REST web services that you can use to automate certain tasks.

The REST APIs included in Oracle API Platform Cloud Service are:

  • Administration Service: Provides operations to manage gateway artifacts, create and obtain policy information, get and update user preferences, and get information about roles and grants for users, among other administrative operations.
  • Analytics: Provides operations to get statistics and performance information such as active applications, failures, total number of requests, active gateways, request and response as time series data, and so on.
  • Consumer Service: Provides operations that support the creation and deletion of applications, or update application information, add or remove grants to applications, manage developer portal configuration settings, set or delete user preferences, and so on.
  • Gateway Controller: Provides operations related to configuration of nodes and security profiles.
  • Management Service: Provides operations to create and deploy APIs, API grants, create and manage applications, deployments, and API entitlements among other operations.

The Management Service is a REST API that you can use to create and deploy APIs in Oracle API Platform Cloud Service.

Use the Oracle API Platform Cloud Service Management API to Create a New API

Use the Oracle API Platform Cloud Service Management API to create APIs using REST.

To create an API by using the Management REST API you can use cURL or the REST client of your preference to test that you have the API Manager role before you execute the REST commands in your scripts.

  1. In an Editor, create a basic JSON template for the cURL request with the following information.
    {
        "name": "YOUR_API_NAME",
        "version": "YOUR_API_VERSION",
        "implementation":
        {
            "policies": [
            {
                "id": "1",
                "type": "o:ApiRequest",
                "version": "1.0",
                "draft": true,
                "config":
                {}
            },
            {
                "id": "2",
                "type": "o:ServiceRequest",
                "version": "1.0",
                "draft": true,
                "config":
                {}
            },
            {
                "id": "3",
                "type": "o:ServiceResponse",
                "version": "1.0",
                "config":
                {}
            },
            {
                "id": "4",
                "type": "o:ApiResponse",
                "version": "1.0",
                "config":
                {}
            }],
            "executions":
            {
                "request": ["1", "2"],
                "response": ["3", "4"]
            }
        }
    }

    In the JSON template, name is your API name and version is your API version. This template has the minimum essential information that is required to create an API in Oracle API Platform Cloud Service such as an API name, a version, the API Request and Service request policies in draft mode, and the Service Response and API Response policies.

  2. By using cURL or your REST client, make a POST request to the https://YOUR-API-PCS-INSTANCE-URL/apiplatform/management/v1/apis endpoint, where YOUR-API-PCS-INSTANCE-URL is the URL of your Oracle API Platform Cloud Service instance.
  3. Verify the response headers from the request and the response body.
    HTTP/1.1 200 OK 
    Server: Oracle-Traffic-Director/12.2.1.0.0
    Date: Tue, 19 Jul 2016 13:27:08 GMT
    Content-Length: 30
    Content-Type: application/json
    X-oracle-dms-ecid: dd439614-7d4f-47ad-a1ea-a25a74ec9403-0000032d
    X-oracle-dms-rid: 0:1
    Via: 1.1 otd_opc
    Proxy-agent: Oracle-Traffic-Director/12.2.1.0.0

    The response body from the server is also in JSON format.

    {
      "id": "101",
      "iterationId": "1"
    }