Using curl
Perform the following steps to set up curl and create a project for Oracle Primavera Cloud using the Oracle Primavera Cloud Data Service.
Step 1: Obtain Account Information
Contact your account administrator to obtain the account credentials required to manage workspaces using the data service. You will need:
- A username and password for Oracle Primavera Cloud that has the application administrator privilege
- The URL of your Oracle Primavera Cloud Data Service RESTful endpoints
Step 2: Install curl
The examples within this topic demonstrate how to access the Oracle Primavera Cloud Data Service using the curl command-line tool.
To connect to the Oracle Primavera Cloud Data Service, you must install a version of curl that supports SSL. When you connect to the data service, you must provide an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate. See also:
To install curl on a Windows 64-bit system:
You are now ready to send requests to the Oracle Primavera Cloud Data Service using curl.
Step 3: Run a Query
To run a query using the Oracle Primavera Cloud Data Service, send an HTTP POST request to the /runquery
endpoint. Your POST request must include additional JSON data that specifies the table names, columns, and criteria of the query.
The following example uses a JSON file named query.json to query ACTIVITY_ID, ACTIVITY_NAME, ACTIVITY_TYPE, STATUS, START_DATE, FINISH_DATE columns on SM _ACTIVITY table, with criteria PROJ_ID=1 and PLANNED_HOURS >= 1200.
{ "name": "My Activities", "sinceDate": null, "tables": [{ "tableName": "SM_ACTIVITY", "columns": [ "ACTIVITY_ID", "ACTIVITY_NAME", "ACTIVITY_TYPE", "STATUS", "START_DATE", "FINISH_DATE" ], "condition": { "columnName": null, "operator": "AND", "value1": null, "value2": null, "conditions": [{ "columnName": "PLANNED_HOURS", "operator": "GREATER_THAN_OR_EQUALS", "value1": "1200", "value2": null, "conditions": null }, { "columnName": "PROJ_ID", "operator": "EQUALS", "value1": "1", "value2": null, "conditions": null } ] } }] }