Update of a Questionnaire Using the Supplier Data API with Pagination
This topic explains how to post updates to answers in supplier registration, qualification, and modular supplier management questionnaires, including attachments and repeatable sections, using the answers endpoint.
The externalSystemCorrelationId is a unique identifier for a piece of content within an individual questionnaire. It is possible for two different questions in two different questionnaires for the same supplier to have the same externalSystemCorrelationId. Therefore, you pass the survey questionnaireId in the post URL to specify the questionnaire, then specify the externalSystemCorrelationId of the question in the answers block in the post body.
-
Use the vendors endpoint to request the SM Vendor IDs for your suppliers. For example, to return data for all suppliers:
GET {{runtime_URL}}supplierdatapagination/v4/prod/vendorDataRequests/?realm={{realmName}} -
Use the qna endpoint to request questionnaire details for a supplier, including the project workspaceId, questionnaire questionnaireId, and question externalSystemCorrelationId for each question. For example, to get all questions and answers in all questionnaires in all projects for a supplier::
GET {{runtime_URL}}supplierdatapagination/v4/prod/vendors/S11284494/workspaces/questionnaires/qna -
Use the answers endpoint to post an update to one or more questions, passing the questionnaire questionnaireId in the post URL as follows:
POST {{runtime_URL}}supplierdatapagination/v4/prod/vendors/S1128494/workspaces/questionnaires/Doc12345678/answers/?realm={{realmName}}The request body dictates what updates to make and whether the updates triggers approval tasks:-
To update the answer to a question and to trigger the associated approval tasks, pass its externalSystemCorrelationId, new answer, and include triggerApprove: true in the answers block. For example:
{"answers": [ { "externalSystemCorrelationId": "KI_1694841", "Answer": "New answer" "triggerApprove": true } ]}, ]} -
To add or update an attachment, pass its 64-bit encoded content in the fileContents field in the answers block:
{"answers": [ { "externalSystemCorrelationId": "KI_1694841", "attachmentAnswer": { "fileName":"Attachment.csv", "mimeType":"application.csv", "fileSize":221725, "fileContents":"64 bit encoded value" } } ] } -
To add a certificate to the modular questionnaire, use the sample payload provided. If the certificate includes attachments, pass its 64-bit encoded content in the fileContents field:
{"answers": [ { "externalSystemCorrelationId": "KI_18195073", "certificateAnswer": { "certified": true, "issuer": "test certificate", "issuerId": "ZS407289999", "certificateType": "ISO 9001", "auditResult": "positive", "certificateNumber": "ZAA40728999", "effectiveDate": "2/25/2027", "expirationDate": "2/25/2028", "createMode": true, "attachment" : {"fileName":"attachment.pdf", "mimeType": "application/pdf", "fileSize": 8489, "fileContents": "64 Bit encoded value" } } ]} -
To add or update an instance of a repeatable section, pass the number of the section instance in the alternative field:
{"answers": [ { "externalSystemCorrelationId":"KI_1694841", "alternative":"4", "answer":"New answer" }, ]}Use the alternative number of an existing section to update its answer. To add a new instance of the repeatable section, increment the highest alternative in the section by 1. For example, if an existing repeatable section has 3 instances, the alternative of the third instance is 2. Therefore, to add a new instance, specify an alternative of 3 in the answers block.
-
For modular questionnaires and registration questionnaires only, to trigger any approval tasks in the current phase of the questionnaire so that approvers must approve the update, pass a triggerApprove value of true after the answers block:
{ "answers": [ { "externalSystemCorrelationId": "KI_9951113", "answer": "New answer" } ], "triggerApprove" : true }If triggerApprove is false or isn't present in the request, or if the questionnaire is of a type other than modular questionnaire or registration questionnaire, the request automatically updates the specified answers without starting any approval tasks.
-