Create a standard report

Make a POST request to send a request to create any report in a SAS format.

Note:

  • To run these Oracle Clinical One Platform API calls, you need to include an authentication token. For instructions on how to generate your authentication token, see Get a token for authentication and Use the token to make an API request.
  • For every API call make sure you construct the URL using the correct server URL and parameters values.
For the following API calls, you need the studyID and mode. These values are retrieved as part of a prerequisite, see Get study information.

Step 1: Create the request payload file

The following JSON contains the code to request the names of all the forms in your study. Create a JSON file called report.json and copy the following:

Note:

Replace these values with those relevant to you and the report you are generating.
{
  "fieldSpecsList": [{
    "fldId": "546A77A696BE11EABB370242AC130002",
    "fieldType": "list",
    "fieldName": "field Name",
    "fieldValueList": ["Form Name (All)"]
  }],
  "extFieldSpecsList": [{
    "fldId": "546A77A696BE11EABB370242AC130002",
    "fieldName": "Field Name",
    "fieldType": "list",
    "fieldValueList": ["Form Name (All)"]
  }]
}

Step 2: Generate report using payload file

Given a reportId, run the following cURL call to build the report with the XPORT format and specifications from the request payload file:

curl -X POST "https://tenant.clinicalone.oraclecloud.com/ec-reporting-svc/rest/v1.0/reports?reportid={reportId}&format=XPORT&studyId={studyId}&mode={mode}" -d "@report.json"
Take note of the job id and rptId values from the response object. In order to download the specific report you just generated using Rest APIs you will need this data. See the following section of a sample response:
{
  "status" : "success",
  "result" : {
    "id" : "C7915941393842F9A7983B8B654F3C7D",
    "rptId" : "E341BB429E7D44E3989D113A504F3BF8",
    "versionStart" : "2021-03-25T07:05:52.117Z",
    "runDuration" : null,
    "userId" : "3627C13BD3F041158A026EFEB33D8C38",
    "versionEnd" : "3099-12-31T00:00:00.000Z",
    "operationType" : "CREATED",
    "reason" : null,
    "comment" : null,
    "rptKickoffDatetime" : "2021-03-25T07:05:52.117Z",
    "rptName" : "Subject Data Extract",
    "rptStatCd" : "SUBMITTED",
    "rptFormat" : "XPORT",
    "recCount" : null,
    "currSearchSpec" : "{\"fieldSpecsList\":[{\"fieldName\":\"File Name\",\"fieldSequence\":0,\"fieldValueList\":[\"Form Name (All)\"],\"fieldType\":\"list\"}]}",
    "currSortSpec" : null,
    "objectVersionNumber" : 1,
    "softwareVersionNumber" : 2.00,
    "fileStorageId" : null
  },

For more information on how to build the payload, other parameters and response objects details, see Generate a report based on search specifications and query parameters.

Tip:

There are many different Clinical One APIs that could help you complete a particular task. Browse for these and other related APIs under the Tasks section of this guide. If you see any deprecated endpoint, look for its newest version.