Using curl

Perform the following steps to set up curl and create a project for Oracle Prime Projects using the Oracle Prime Projects API.

Step 1: Obtain Account Information

Contact your account administrator to obtain the account credentials required to manage workspaces using the API. You will need:

  • A username and password for Oracle Prime Projects
  • The URL of your Oracle Prime Projects instance

Step 2: Install curl

The examples within this topic demonstrate how to access the Oracle Prime Projects API using the curl command-line tool.

To connect to the Oracle Prime Projects API, you must install a version of curl that supports SSL. When you connect to the API, you must provide an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate. See also:

  • cURL Overview
  • Authentication and Authorization

To install curl on a Windows 64-bit system:

  1. In your browser, navigate to the curl home page and select Download.
  2. On the curl Releases and Downloads page, locate the SSL-enabled version of the curl software for 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 the command-line, 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 Oracle Prime Projects API using curl.

Step 3: Create a Project

To create a project using the Prime Projects API, send an HTTP POST request to the /project endpoint. Your POST request must include additional JSON data that specifies the project name, parent workspace, and project code. This example uses a JSON file named harbour_example.json to specify the properties of the new project. The harbour_example.json file contains the following JSON data:

  { 
          "projectCode":"EC00610", 
          "projectName":"Harbour Pointe Assisted Living Center", 
          "workspaceId":1, 
          "planStartDate": "2017-09-01T07:00:00.-0700", 
          "status": "ACTIVE", 
          "description": "The assisted living center project is a long term project scheduled for completion in 2021 and is a joint venture with ABC Corp.", 
          "scheduledFinishDate": "2021-08-31T00:00:00.-0700" 
        }

The following example curl command creates a project under the parent workspace using the harbour_example.json file:

Note: Text surrounded in < > indicates a variable. You must replace variables with your own data to run the examples in this documentation. For example, replace the <username> variable with your username.

curl -u <username>:<password> -H "Content-Type:application/json" -X POST -d "@harbour_example.json" https://<host>:<port>/primeapi/restapi/project

The variables in the previous example should be replaced with the following information when accessing the API:

  • <username>: The username of an application user. This user will be used to access the API and must have permission to access requested application data. For example, jsmith.
  • <password>: The password associated with the user account used to access the API.
  • <host>: The name of the host on which the application is deployed. For example, localhost.
  • <port>: The port number assigned to the application on the application host. For example, 7001.

    Note: If the user specified with the curl -u option does not have permission to modify the specified parent workspace, or if the parent workspace does not exist, the project creation will fail, and the API will return a response of 401, 404, or 500.