Views:

This article is for an API Partner wanting to upload a file attachment to an attachment question. 

 

Summary    

Gives the API Partner the ability to add an attachment to an attachment question within the discloser’s questionnaire-response. 

Pre-requisites: Valid subscription key, organization UUID and question ID for the relevant attachment question in the respective Disclosure API environment 

Note Question Type: Files can only be attached to questions with the “ATTACHMENT” type. Once attachments have been added, the file metadata is returned via the GET /response endpoint. 

Note – Delete File: Attachment files can only be removed from the front-end of the response system in the current build.  

 

POST Request 

Details on how to complete the POST request to add a file attachment to an attachment question. 

Note Restrictions: File type and size restrictions apply to the POST request as in the CDP Response Portal: 

  • Supported file types: PDF, DOCX, DOC, XLSX, XLS, CSV, PPTX, PPTXS 
  • File size: 50Mb 

 

URLs 

 

Headers/Variables 
subscription-key (header):For authorized user, the primary/secondary subscription key.
organisation-id (header): A valid partner organization ID is required  

 

Body 

questionId: Question ID of a file attachment question 

file: Valid file attachment (see above) 

rowId: Row id if the attachment question is within a matrix question (currently all are within a matrix question. 

 

Response 

Field Table 

Field 

Description 

Data Type 

id 

The ID of the generated file within the response 

integer 

fileName 

The name of the file which was uploaded 

string 

fileSize 

Size of the file attached 

integer 

fileType 

The type of the file which was uploaded 

string 

fileStatus 

The status of the upload request 

string 

 


Schema 

{
    "id": integer,
    "fileName": "string",
    "fileSize": integer,
    "fileType": "string",
    "fileStatus": "string"
}
 

 

GET/PUT/DELETE Requests 

GET requests are not implemented for this endpoint, preventing the retrieval of files attached to a response. File metadata is returned via the /response/response endpoint. 

PUT requests are not implemented for this endpoint, as once a file is attached to a response it cannot be updated or overwritten. 

DELETE requests are not implemented for this endpoint, preventing deletion of files and file metadata. 

 

If you have not found the answer you were looking for, please contact your account manager who will be able to assist you further. 

Add a comment