GetFormDocument()

The GetFormDocument() command returns a form document.

We only allow for the retreival of one document at a time, so if you need multiple attachments youll have to handle this your side by iterating through the API results from the GetFormAttachments call

  • Quota: 6

As a limitation we only allow for the retreival of one document at a time.

Table 1. Parameters
ParameterTypeMax LengthRequiredDescription
apiTokenstring20YYour API security token configured in Field View.
formIdstring20YSupply the form Id the document is attached to
documentIdint MAXYThe unique ID of the document.
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:GetFormDocument>
        <ns:apiToken>68DC485979B73FD1EF363AC292D9E41FBECF11D</ns:apiToken>
        <ns:formId>F1.32975</ns:formId>
        <ns:documentId>11201</ns:documentId>
     </ns:GetFormDocument>
  </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>
     <GetFormDocumentResponse xmlns="https://localhost.priority1.uk.net/Priority1WebServices/XML">
        <GetFormDocumentResult>
           <FormDocumentResponse xmlns="">
              <DocumentId>11201</DocumentId>
              <DocumentName>Report (26).csv</DocumentName>
              <DocumentType>Excel</DocumentType>
              <MimeType>application/vnd.ms-excel</MimeType>
              <DocumentFile>VGF664BG63663G98478937HJKHKJHKJHKJ2H45298752H54JK2HJ45J24H58924Y524KB5JK2H THIS COULD BE HUGE DEPENDING ON THE SIZE OF ATTACHMENT........</DocumentFile>
              <Date>2016-12-14T09:19:11.63</Date>
              <Forename>MCS_UK</Forename>
              <Surname>DEMO_RS</Surname>
              <Status>
                 SUCCESS
                 <Message>Success.</Message>
              </Status>
           </FormDocumentResponse>
        </GetFormDocumentResult>
     </GetFormDocumentResponse>
  </soap:Body>
</soap:Envelope>
Recreating the document (C#)

var doc = [yourAPIcall...]
Response.Clear();
Response.ClearHeaders();
Response.ContentType = doc.MimeType;
Response.AddHeader("Content-Disposition", "attachment; filename=" + doc.DocumentName + "");
Response.BinaryWrite(doc.DocumentFile);
Response.Flush();
Response.End();