Post Request

Overview

The POST /api/reporting/data-extract endpoint submits a new assessment data extraction job. The request body specifies what type of assessment data to extract and the filtering criteria to apply.

What you can do
Submit an assessment data extraction job with a specified report type and filter criteria
Filter results by assessment status, date range, identifiers, names, templates, and labels
Reference a sample curl request and expected success and error responses
Prerequisites
A valid OAuth 2.0 bearer token — see the API Token Authentication article for details
Access to a tool or environment capable of making HTTP POST requests (for example, curl or an API client)
Endpoint Reference
Method
POST
URL
https://api.trustarc.com/api/reporting/data-extract
Content-Type
application/json
Request Body Parameters
Required JSON Parameters
Name Value Description
requestName String The unique name of the request or job.
requestType String The type of assessment data to extract. Accepted values:
ASSESSMENT_SUMMARY
ASSESSMENT_SURVEY
ASSESSMENT_SURVEY_WITH_SUMMARY
requestParams JSON

The filtering criteria for the extraction. Fields within requestParams:

assessmentStatusOptional
List of assessment statuses to filter by. Accepted values: OPEN, SURVEY, SURVEY_COMPLETE, IN_REVIEW, REVIEW_COMPLETE, APPROVED, APPROVED_PENDING_REMEDIATION.
periodStartRequired
Start of the date range as an Epoch timestamp in milliseconds, representing when assessments were created.
periodEndRequired
End of the date range as an Epoch timestamp in milliseconds, representing when assessments were created.
dateRangeTypeOptional
The type of date range to apply. Accepted values:
ASSESSMENT_CREATED_RANGE (default)
ASSESSMENT_START_RANGE
ASSESSMENT_SURVEY_COMPLETE_RANGE
ASSESSMENT_APPROVED_RANGE
ASSESSMENT_DUE_RANGE
ASSESSMENT_LAST_MODIFIED_RANGE
assessmentIdentifiersOptional
List of assessment identifiers in PIDnnnn format. Use * as a wildcard character. For example, PID00* matches PID0001, PID002345, and so on.
assessmentNamesOptional
List of assessment names. Use * as a wildcard character. For example, Test* matches "2301 Test level", "Test 23", "Test", "456 Test", and so on.
assessmentTemplatesOptional
List of assessment template names. Use * as a wildcard character.
assessmentLabelsOptional
List of assessment labels. Labels are case-sensitive and do not support wildcards.
Sample Request with curl
curl -X POST \
  'https://api.trustarc.com/api/reporting/data-extract/' \
  -H "accept: application/json;charset=UTF-8" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "requestName": "AMDataExtraction-QA themis 1-32",
    "requestParams": {
      "assessmentStatus": ["SURVEY", "SURVEY_COMPLETE"],
      "periodEnd": 1590187492179,
      "periodStart": 1585724400000
    },
    "requestType": "ASSESSMENT_SURVEY_WITH_SUMMARY"
  }'
Responses
Success Response
Code: 200 OK
{
  "requestName": "AMDataExtraction-QA themis 1-32",
  "requestParams": {
    "periodEnd": 1590187492179,
    "periodStart": 1585724400000,
    "dateRangeType": "ASSESSMENT_SURVEY_COMPLETE_RANGE"
  },
  "requestType": "ASSESSMENT_SURVEY_WITH_SUMMARY"
}
Error Responses
Code: 400 Bad Request
Code: 401 Unauthorized
TrustArc  ·  Assessment Data Extraction API — POST /api/reporting/data-extract  ·  support.trustarc.com