This article is for an API Partner wanting to retrieve partner organization response information.
Contents
Summary
When interacting with a Discloser’s response data you can call two methods GET and PUT. This article covers the GET request, which allows you to retrieve the existing answer-values in an individual response. A GET request can be sent after a PUT request to verify the update to the data.
Pre-requisites: Valid subscription key and organization UUID for the respective Disclosure API environment.
Note - Data Sync: To ensure you are seeing the latest answer-values within a Discloser’s questionnaire-response then this data should be refreshed when updates are made to the response, either via the API or within the Portal directly.
Note - Hidden Questions: When a value is updated into a question which has been hidden by show/hide conditional logic, the value is stored regardless. Should the question become visible again (if the answer to a lead question changes), the previously hidden value would be included in the submission. You can see this using the “status” field.
Note - Different States: It is possible to GET when the response workflow is in an “In Progress”, “Submitted” or “Amendments” state.
GET Request
The GET request details how to send the request to the response/response endpoint and the response that is returned when a successful request is sent.
URLs
Sandbox: https://api-pre.cdpgreenstar.net/asp/response/response
Production: https://api.cdp.net/response/response
Headers/Variables
subscription-key (header): For authorized user, the primary/secondary subscription key.
organization-id (optional header): Enter the UUID for the organization’s response.
Body
NULL
Response
Top Level: Response (n)
Answer-value data for the specified organizations response.
Field table
Note: The “status” field is the current state of the question in the portal. These are for display purposes only; the Discloser should ensure their response is filled out correctly prior to final submission.
"UNANSWERED"– The question has not been answered.
"ANSWERED"– The question is answered or has been marked by the user as answered.
"SKIPPED"– The question is marked as skipped by the user. No content has been filled.
"REVIEWED"– The question has been marked as reviewed by the Submission Lead.
"CONDITIONAL" – The question is currently locked/hidden in the CDP Portal by conditional logic.
Schema
{
"content: "string",
"setAnsweredManually": boolean,
"questionId": "string",
"organizationId": "string",
"discloserId": "string",
"partnerId": "string",
"createdOn": "string",
"updatedOn": "string",
"rowId": "string",
"responseVersionId": "string",
"row": [{...}],
"attachments": [{...}],
"responseVersion": [{...}],
]
Second Level: Rows (n+1)
Additional information about the row and matrix question that the expression belongs to, if applicable.
Field table
Schema
...
"row": {
"refId": null,
"complexQuestionId": "string",
"order": integer
Second Level: Attachments (n+1)
Attachment information added as part of the response to the question.
Note: The attachment files themselves cannot be retrieved via the API.
Field table
Schema
...
"attachemnts": {
"filename": "string",
"fileSize": integer,
"fileType": "string",
}
...
Second Level: Response Version (n+1)
Response version to the question.
Field table
Schema
...
"responseVersion": {
}
...
JSON Response Example
Below is an example API response while calling the GET method for this endpoint. The data retrieved is a part of the response to the questionnaire, currently held for that organization.
{
"content: "null",
"setAnsweredManually": false,
"questionId": "14b2db4c-c9ef-4495-b020-7a8f436ae0ba",
"organizationId": "ldja212-121f-ds12-890a-000d4g21gl28",
"discloserId": "23df3456-2130-2g31-7a6h-3255450ac245",
"partnerId": null,
"createdOn": "2024-09-25T15:52:17.612Z",
"updatedOn": "2024-09-30T19:43:50.863Z",
"rowId": null,
"responseVersionId": "e1htf1f8-ra5h-4236-t0fd-4f3264ff7gy1",
"row": {
"id": "0e13121a-a696-221f-7065-c79c7ca542aa",
"refId": null,
"complexQuestionId": "9aa87751-7692-4a54-a00d-9c6c98fdea7a",
"instanceId": null,
"title": "Row 1",
"order": "1
"attachments": [{...}],
"responseVersion": [{...}],
}
"attachments": [{
"id": 11111,
"fileName": “application/pdf",
"fileStatus": “uploaded”,
"responseVersion": {
}
Error Handling
1. Invalid Subscription Key
When an incorrect or invalid subscription key is entered, the following error is displayed:
"name": "Unauthorized",
"link": 401
2. Invalid Organization ID
When an incorrect or invalid organization key is entered, the following error is displayed:
"name": "Unauthorized",
"link": 401
POST/PUT Requests
POST and PUT are implemented for this endpoint, these are covered in articles:
- Disclosure API: Response - Update a Discloser's Response
- Disclosure API: Response - Upload a File Attachment
If you have not found the answer you were looking for, please contact your Account Manager who will be able to assist you further.
