Primavera Data Service Introduction

The Primavera Data Service exposes a set of endpoints that enable you to extract data from the application database. You can use the data service endpoints to discover which database tables, views, synonyms and columns are accessible. You can also use a data service endpoint to fetch table, view, and synonym data.

This image illustrates the data flow described in the paragraph above.

Accessing the Data Service

To use the Primavera Data Service, you must authenticate with a user which has been assigned the appropriate Primavera Data Services role for the environment, for example Primavera Data Services Production or Primavera Data Services Stage. Roles are assigned in Primavera Administration. To check the Primavera Data Service version, access https://<url>/pds.

The data service uses a different base URL from other API services. To access the data service send requests to the following base URL:

https://<url>/pds/rest-service/dataservice/<endpoint>?configCode=<configuration name>

The variables in the previous example URL should be replaced with the following information when accessing the data service:

  • <url>: The URL provided to you when the application was deployed.
  • <endpoint>: A valid data service endpoint, excluding the data service base URL. For example, runquery.
  • <configuration name>: The name of the configuration you want to access.

Note: The following configuration names are available to all customers with the associated applications.

Use ds_p6adminuser to access the P6 EPPM database as admuser.

Use ds_p6reportuser to access the P6 EPPM database as pxrptuser.

Use ds_unifier to access the Primavera Unifier database.

Example curl Request

The following example demonstrates accessing the data service tables endpoint using curl:

curl -X GET -H "Accept:application/json" -u "<username>:<password>" https://<url>/pds/rest-service/dataservice/metadata/tables?configCode=<configuration name>

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

  • <url>: The URL provided to you when the application was deployed.
  • <username>: The username of an application user which will access the data service.
  • <password>: The password associated with the user account used to access the data service.
  • <configuration name>: The name of the configuration you want to access.

Incremental Changes

If the metadata of the application database changes (for example, data, tables, or columns, are added, removed, or renamed), use the appropriate Metadata Refresh Status Endpoint to synchronize PDS with those changes.

Supported Date Formats

The following date formats are supported for requests:

  • yyyy-MM-dd hh:mm:ss TZH:TZM
  • yyyy-MM-dd hh:mm:ss TZHTZM
  • yyyy-MM-dd hh:mm:ss
  • dd-MMM-yyyy
  • dd-MMM-yyyy hh:mm:ss
  • yyyyMMddhhmmss.SSSZ
  • yyyyMMddhhmmss

The following date formats are supported for response:

  • yyyy-MM-dd hh:mm:ss TZH:TZM
  • yyyyMMddhhmmss.SSSZ

Limitations

  • Complex SQL queries cannot be replicated in JSON input. The API supports only:
    • Basic select statements with Where conditions for operators EQUALS, NOT_EQUALS, GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUALS, LESS_THAN_OR_EQUALS, IS_NULL, IS_NOT_NULL, BETWEEN, IN, LIKE.
    • Basic joins between tables where the Primary Key and Foreign Key relationship is defined.
    • Basic explicit joins where there is no defined Primary Key and Foreign Key relationship defined.
  • To run the complex queries (subqueries, multiple joins, aggregate methods), it is recommended that you:
    1. Pull the required tables data using the basic select run query endpoint.
    2. Load the data into a local database.
    3. Run complex queries against the local database.
  • Related to data sorting
    • When query based on database objects "views" or "synonyms", PDS will sort on the first column name provided in the request payload as an input JSON columns property. However, the user may observe duplicate records on the subsequent page request if the first column is non-unique. To avoid duplicate records, the user can provide a list of columns as a unique key with the "orderByColumns" property in input JSON
    • When query based on database object "table", sorting will be performed on "ROWID".
    • Sorting on user preferred columns is not supported for queries requested on "tables", the Primavera Data Service will throw an error with the error message "order by columns are not supported for tables ", whenever the requested query contains "orderByColumns' property.