cURL Overview
The examples within this document use cURL to demonstrate how to access the Oracle Prime REST API.
To use cURL to access the Oracle Prime REST API:
- Install cURL, as described in Using cURL.
- Invoke cURL and specify one or more of the command-line options described in this table.
This table summarizes the cURL options used in the command examples.
cURL Option | Description |
---|---|
-d | Identifies the request document, in JSON format, on the local machine. For example: -d @mydatafile.json |
-F | Identifies form data, in JSON format, on the local machine. For example: -F @myformdatafile.json |
-H | Defines one or both of the following:
|
-i | Displays response header information. |
-u | Specifies the username and password for the Oracle Prime account. For example: -u jsmith:mypassword1 |
-X | Indicates the type of request. For example: -X DELETE |
For example:
curl --u <username><password> -H "<request-header>:<value>" -X GET http://<hostName>:<portNumber>/primeapi/restapi/v<release level>/<service>
To fetch a project object by its project ID:
curl --u jsmith:mypassword1 -H "Accept:application/json" -X GET
http://<server>:<port>/primeapi/restapi/v16.2/project/{id}