Update an organization’s response
Overview
This article covers the PUT request, used to update a Discloser's questionnaire-response.
Pre-requisites: Valid subscription key and organization UUID for the respective Disclosure API environment.
Guidelines
- All questions that are part of the Discloser's response can be retrieved and updated.
- It will only be possible to PUT when the response workflow status is set to
IN_PROGRESSorAMENDMENTS(i.e., it is not possible to send a PUT request once a response is submitted). To check the status of a questionnaire call GET – Questionnaire metadata. - When a value is updated into a question which has been hidden by show/hide conditional logic, the value is stored until the response is submitted. Should the question become visible again (if the answer to a lead question changes), the previously hidden value would be included in the submission. Response data includes a
isHiddenstatus flag indicating whether the question is visible to the user in the portal. To check theisHiddenproperty, call the GET – Retrieve a Discloser's Response endpoint. - To answer an expression (auto-calculation) question, an update must be sent based on the formulas provided by the GET – Expressions endpoint. The fields do not auto-calculate when the dependent questions are updated.
- Answers sent to an expression (auto-calculation) question will not be validated by the CDP Portal. You must ensure the calculation is performed correctly before sending the value.
- A GET request can be sent after a PUT request to verify the update to the data.
- When updating a matrix question a
rowIdmust be provided or the update cannot be stored against the question. - Send a
nullvalue to reset:- A numeric or rich text question.
- A date.
- Single/multi select and/or grouped options questions.
PUT request
The information provided below shows how to structure a request to update a Discloser's questionnaire-response, for each question type. This shows each question type in isolation, however, it is expected that multiple question updates are sent together.
Note: All field names throughout the API are formatted using camel casing.
Known limitation – Large batch updates: Requests that update a very large number of matrix cells in a single call (roughly 2,000 or more) currently fail with an error rather than being processed. This affects responses to matrix questions with many added rows.
Workaround: Split large updates into smaller batches, around 1,000 cells per request is a safe upper limit and submit them sequentially. Each batch is processed independently, so a failure in one batch does not roll back previously submitted batches.
URLs
| Environment | URL |
|---|---|
| Sandbox | https://api.pre.cdpgreenstar.net/asp/response/response |
| Production | https://api.cdp.net/response/response |
Parameters
| Name | Location | Description |
|---|---|---|
subscription-key | header | For authorized user, the subscription key. |
organization-id | header | A valid partner organization ID. |
Body
Field table
| Field | Description | Data Type |
|---|---|---|
id | The ID of the row to be updated. Note: A rowID must be provided when updating a matrix question or the data is lost. For a Matrix question, enter the corresponding rowID for the question only. | string |
updateResponseInput | Additional info regarding the content and status update to be made: • content: The ID AND name for an option, OR the answer-value to be updated. |