GetFormAttachments()

The GetFormAttachments() command returns a list of all attachments against a form.

  • Quota: 2
Table 1. Parameters
ParameterTypeMax LengthRequiredDescription
apiToken string 20Y Your API security token configured in Field View.
formId string 20Y The unique ID of the form.
answerId string 20 narrow down the search to an individual answer by supplying this OPTIONAL value.

The information that this API returns can be used to make additional API Calls to GetFormDocument and GetFormPhoto, you will need the documentId's and photoId's for this.

If AnswerId is not specified then the entire form's attachments will be returned. This includes attachments at the top level (accessible from the web forms list via the icons), attachments on an answer (accessible from within the form itself on the web) and also any sketch or photo question types which have been uploaded as part of a form answer. The MediaType column that gets returned explains where each attachments belongs.

To retrieve attachments on a form answer specify the AnswerId.

To retrieve an attachments on a photo or sketch question type specify the AnswerId.

Example SOAP Envelope Header

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="https://localhost.priority1.uk.net/Priority1WebServices/XML">
  <soap:Header/>
  <soap:Body>
     <ns:GetFormAttachments>
        <ns:apiToken>68DC485979B73FD1EF363AC292D9E41FBECF11D</ns:apiToken>
        <ns:formId>F1.32975</ns:formId>
        <ns:answerId></ns:answerId>
     </ns:GetFormAttachments>
  </soap:Body>
</soap:Envelope>
Example SOAP Response

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
     <GetFormAttachmentsResponse xmlns="https://localhost.priority1.uk.net/Priority1WebServices/XML">
        <GetFormAttachmentsResult>
           <FormAttachmentsResponse xmlns="">
              <Attachments>
                 <Attachment>
                    <Id>11201</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>Report (26).csv</Name>
                    <OwnerId>F1.32975</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11202</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>Production Checksheet.pdf</Name>
                    <OwnerId>F1.32975</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11207</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>00932175_20161102_1202.csv</Name>
                    <OwnerId>F1.32975</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11208</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>BulkGeometryTemplate.xlsx</Name>
                    <OwnerId>F1.32975</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11211</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>JG-git-merge example.docx</Name>
                    <OwnerId>1.347787</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11212</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>Tasks (27) (1).csv</Name>
                    <OwnerId>1.347787</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11213</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>big_btn_change status 2.jpg</Name>
                    <OwnerId>1.347788</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11214</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>change status 2.jpg</Name>
                    <OwnerId>1.347788</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11215</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>change status.jpg</Name>
                    <OwnerId>1.347788</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>11216</Id>
                    <Type>DOCUMENT</Type>
                    <MediaType>Document Attachment</MediaType>
                    <Name>task list.jpg</Name>
                    <OwnerId>1.347788</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>1.57903</Id>
                    <Type>PHOTO</Type>
                    <MediaType>Form Photo</MediaType>
                    <OwnerId>F1.32975</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>1.57904</Id>
                    <Type>PHOTO</Type>
                    <MediaType>Form Photo</MediaType>
                    <OwnerId>F1.32975</OwnerId>
                 </Attachment>
                 <Attachment>
                    <Id>1.57905</Id>
                    <Type>PHOTO</Type>
                    <MediaType>Form Photo</MediaType>
                    <OwnerId>F1.32975</OwnerId>
                 </Attachment>
              </Attachments>
              <Status>
                 SUCCESS
                 <Message>Success.</Message>
              </Status>
           </FormAttachmentsResponse>
        </GetFormAttachmentsResult>
     </GetFormAttachmentsResponse>
  </soap:Body>
</soap:Envelope>