Quick Start

See how your APIs, applications, or gateways are performing with the REST API for the Administration Service in Oracle API Platform Cloud Service by performing the following tasks.

Prerequisites

Prerequisite More Information

Provision your API Platform Cloud Service instance.

See Creating an Oracle API Platform Cloud Service Instance in Using Oracle API Platform Cloud Service.

Ensure the VMs are running and that you can access the API Platform Cloud Service Management Portal.

See Accessing the Oracle API Platform Cloud Service Management and Developer Portals in Using Oracle API Platform Cloud Service.

Create an API.

See Creating an API and Implementing APIs in Using Oracle API Platform Cloud Service.

Deploy your API to a gateway.

See Deploying Endpoints in Using Oracle API Platform Cloud Service.

Send requests to your API.

Specific details should be included in the documentation for your API. See Documenting an API in Using Oracle API Platform Cloud Service to add it if you are an API Manager, or How Do I View API Documentation? in Consuming APIs with the Oracle API Platform Cloud Service Developer Portal to view it if you are an application developer.

Step 1: Obtain Account Information

From your account administrator, obtain the appropriate account credentials to enable you to manage APIs, applications, or gateways in your service instance. Specifically, you will need:
  • Username and password

  • The required roles and grants for the analytics data you want to view:
    • To view analytics for a specific gateway, you must be assigned the Administrator or Gateway Manager role (or membership to a group assigned one of these roles) in Oracle API Platform Cloud Service and must be issued the Manage Gateway or View All Details grant for the gateway.

    • To view analytics for a specific API, you must be assigned the Administrator or API Manager role (or membership to a group assigned one of these roles) in Oracle API Platform Cloud Service and must be issued the Manage API or View All Details grant for the API.

    • To view analytics for a specific application, you must be assigned the Administrator, API Manager, or Gateway Manager role (or membership to a group assigned one of these roles) in Oracle API Platform Cloud Service and must be issued the Manage Application or View All Details grant for the application.

Step 2: Install cURL

The examples within this document use the cURL command-line tool to demonstrate how to access the REST API for the Administration Service in Oracle API Platform Cloud Service.

To connect securely to the server, you must install a version of cURL that supports SSL and provide an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate. For more information about:

The following procedure demonstrates how to install cURL on a Windows 64-bit system.
  1. In your browser, navigate to the cURL home page at http://curl.haxx.se and click Download in the left navigation menu.

  2. On the cURL Releases and Downloads page, locate the SSL-enabled version of the cURL software that corresponds to your operating system, click the link to download the ZIP file, and install the software.

  3. Navigate to the cURL CA Certs page at http://curl.haxx.se/docs/caextract.html and download the cacert.pem SSL CA certificate bundle in the folder where you installed cURL.

  4. Open a command window, navigate to the directory where you installed cURL, and set the cURL environment variable, CURL_CA_BUNDLE, to the location of an SSL certificate authority (CA) certificate bundle. For example:

    C:\curl> set CURL_CA_BUNDLE=cacert.pem

You are now ready to send requests to the REST API for the Administration Service in Oracle API Platform Cloud Service using cURL.

Step 3: View Analytics for an API

The following cURL example returns response time analytics for the last 30 days for an API with an ID of 161.

curl -i -X GET 
-H "Authorization: Bearer access_token" 
https://example.com/apiplatform/analytics/v1/timeSeries/responseTimes/totals?apiIds=161&timeUnit=MONTH

Note:

In releases prior to 18.2.5, the REST endpoints were protected using Basic Authorization instead of OAuth. If you are using an earlier version, you must specify an Authorization header whose value contains the base 64-encrypted user name and password (separated by a colon) of an Oracle API Platform Cloud Service user with authorization to perform the requested operation. This header looks like:

Authorization: Basic base64-encrypted-username:base64-encrypted-password

The following sample response body lists the time the data represents (the last 30 days), the time of the initial request, the high response time, the median response time, and the low response time, in milliseconds, for the specified API.

{
  "count": 1,
  "time": {
    "timeEnd": "2017-01-27T19:09:45.571Z",
    "timeSetting": "last30days",
    "timeGroupSize": 1,
    "timeStart": "2016-11-27T19:09:45.571Z",
    "timeOffsetId": "Z",
    "timePeriodMs": 2592000000,
    "timeUnit": "MONTH"
  },
  "items": [
    {
      "start_ts": "2016-12-01T00:00:00Z",
      "high": 7021,
      "measure": 1.2138717,
      "low": 0
    }
  ]
}