Skip to main content

Matrix row

Overview​

This endpoint allows API Partners to interact with the rows within matrix questions. Rows can only be added to dynamic matrix questions, and then, those rows can be deleted later on.

Pre-requisites: Valid subscription key, organization UUID and question ID (adding of row) OR row ID (deleting of row) for the respective Disclosure API environment.

PUT Request (adding a row)​

Details how to add a row to a dynamic matrix question within a Discloser's questionnaire response.

Note – Row ID: When a row has been created using the PUT request then the UUID for the new row is returned as part of the success response message.

Note:

  • To be able to assign responses to the corresponding row, the rowID must be captured.
  • Only rows that have been created by the user can be deleted.

To find rows created by users in the Portal, the corresponding UUID for the row can be found calling:

GET - /response/questionnaire/questions

Guideline:

  1. Rows can only be added to dynamic matrix questions ("isDynamic" = true).
  2. When creating a row, two options are possible:
    1. When row details are pre-set ("isPrepop" = true), then rowId must be specified in the request body as the ID of an existing row within the question (see Questionnaire: Questions > GET Request section).
    2. When row details are not pre-set ("isPrepop" = false), then rowId in the request body should be null.

URLs​

EnvironmentURL
Sandboxhttps://api.pre.cdpgreenstar.net/asp/response/questions/{questionId}/add-row
Productionhttps://api.cdp.net/response/questions/{questionId}/add-row

Parameters​

NameLocationDescription
subscription-keyheaderFor an authorized user this is the subscription key.
organization-idheaderA valid partner organization ID is required.
questionIdquery parameterThe ID of the matrix question you want to add the row to.

Body​

When row details are pre-set ("isPrepop" = true), rowId should be specified:

{
"rowId": "f4b9433f-03c7-483d-856c-c5ba0b90d1a4"
}

When row details are not pre-set ("isPrepop" = false), then rowId should be null:

{
"rowId": null
}

Response​

Field table

FieldDescriptionData Type
idThe UUID for the newly created row.string
refIdNot in use.string
complexQuestionIdThe ID of the matrix question the row belongs to.string
instanceIdNot in use.integer
titleThe name of the newly created row.string
orderThe position of the row within the matrix question.integer

Schema

{
"id": "string",
"refId": null,
"complexQuestionId": "string",
"instanceId": 0,
"title": "string",
"order": 0
}

DEL request​

Details how to delete a row from a dynamic matrix question within a Discloser's questionnaire response.

Note – Deletion of rows: You can only delete the rows that have been created using this endpoint or created in the customer Portal by the disclosing organization.

URLs​

EnvironmentURL
Sandboxhttps://api.pre.cdpgreenstar.net/asp/response/questions/delete-row/{rowId}
Productionhttps://api.cdp.net/response/questions/delete-row/{rowId}

Parameters​

NameLocationDescription
subscription-keyheaderFor an authorized user this is the subscription key.
organization-idheaderA valid partner organization ID is required.
rowIdquery parameterThe ID of the row you want to delete.

Body​

NULL

Response​

Field table

FieldDescriptionData Type
idThe UUID for the newly created row.string
refIdNot in use.string
complexQuestionIdThe ID of the question the row belongs to.string
instanceIdNot in use.integer
titleThe name of the newly created row.string
orderThe position of the row within the matrix question.integer

Note: The order may be affected if a row has been deleted. E.g. 10 rows created and row 4 is deleted the order won't be updated, instead it will show 1, 2, 3, 5, 6… etc.

Schema

{
"id": "string",
"refId": null,
"complexQuestionId": "string",
"instanceId": 0,
"title": "string",
"order": 0
}

GET/POST requests​

GET requests are not implemented for this endpoint as the information is provided in the responses and for all questions via the /questionnaire/questions endpoint.

POST requests are not implemented for this endpoint as it is not possible to edit rows once they have been created.