Use cURL

The examples in this document use cURL to show how to access the REST API in Oracle Developer Cloud Service.

To use cURL to access the REST API in Oracle Developer Cloud Service:

  • Install cURL, as described in Quick Start.

  • In a command window, set the cURL environment variable, CURL_CA_BUNDLE, to the location of your local CA certificate bundle. For information about CA certificate verification using cURL, see: http://curl.haxx.se/docs/sslcerts.html.

  • Invoke cURL and specify one or more of the command-line options defined in the following table, as required, to direct its execution

    cURL Option Description
    -d, --data @file.json Identifies the request document, in JSON format, on the local machine.
    -F, --form @file.json Identifies form data, in JSON format, on the local machine.
    -H Defines the content type of the request document.
    -i Displays response header information.
    -u, --user username:password Specifies the user name and password for the Oracle Developer Cloud Service account.
    -X Indicates the type of request (for example, GET, POST, and so on).

The following cURL command example shows how to retrieve the issue that has an ID of 1:

curl -i 
-X GET 
-u 'joe@example.com:myPassword 
http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_203132/issues/v2/issues/1

Note:

The command in the example uses the URL structure http://<host-url>/<org-id>/rest/<project-id>/resource-path, where <host-url> is the Oracle Developer Cloud Service REST server to contact, <org-id> is the identifier of your organization, and <project-id> is the identifier of the project with which the issue is associated. See Send Requests for the appropriate URL structure.