Quick Start

Assign your first role using the REST API for the Administration Service in Oracle API Platform Cloud Service by performing the following tasks.

Prerequisites

Prerequisite More Information

Provision your Oracle API Platform Cloud Service instance.

See Creating an 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.

Step 1: Obtain Account Information

From your account administrator, obtain the appropriate account credentials to enable you to perform administration tasks. Specifically, you will need:
  • Username and password

  • The Administrator role in Oracle API Platform Cloud Service or membership to a group assigned the Administrator role

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 Available Roles

The following cURL example returns the roles you are able to assign to users and groups in Oracle API Platform Cloud Service.

curl -i -X GET 
-H "Authorization: Bearer access_token"
-H "Content-Type: application/json"
-d @api.json
https://example.com/apiplatform/administration/v1/roles

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

You receive a response similar to the following example.

{
  "count": 5,
  "links": [
    {
      "method": "GET",
      "rel": "self",
      "href": "https://example.com:443/apiplatform/administration/v1/roles"
    },
    {
      "method": "GET",
      "rel": "canonical",
      "href": "https://example.com:443/apiplatform/administration/v1/roles"
    }
  ],
  "items": [
    {
      "links": [
        {
          "templated": "true",
          "method": "GET",
          "rel": "canonical",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager"
        }
      ],
      "id": "APIManager"
    },
    {
      "links": [
        {
          "templated": "true",
          "method": "GET",
          "rel": "canonical",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/ApplicationDeveloper"
        }
      ],
      "id": "ApplicationDeveloper"
    },
    {
      "links": [
        {
          "templated": "true",
          "method": "GET",
          "rel": "canonical",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/GatewayManager"
        }
      ],
      "id": "GatewayManager"
    },
    {
      "links": [
        {
          "templated": "true",
          "method": "GET",
          "rel": "canonical",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/Administrator"
        }
      ],
      "id": "Administrator"
    },
    {
      "links": [
        {
          "templated": "true",
          "method": "GET",
          "rel": "canonical",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/GatewayRuntime"
        }
      ],
      "id": "GatewayRuntime"
    }
  ]
}