GetFormPhoto()
The GetFormPhoto() command returns a form photo.
|
Parameter | Type | Max Length | Required | Description |
---|---|---|---|---|
apiToken | string | 20 | Y | Your API security token configured in Field View. |
formId | string | 20 | Y | Supply the form Id the photo is attached to |
mediaId | string | 20 | Y | The unique ID of the photo |
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:GetFormPhoto>
<ns:apiToken>68DC485979B73FD1EF363AC292D9E41FBECF11D</ns:apiToken>
<ns:formId>F1.32975</ns:formId>
<ns:mediaId>1.57919</ns:mediaId>
</ns:GetFormPhoto>
</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>
<GetFormPhotoResponse xmlns="https://localhost.priority1.uk.net/Priority1WebServices/XML">
<GetFormPhotoResult>
<FormPhotoResponse xmlns="">
<MediaId>1.57919</MediaId>
<Media>/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQ THIS COULD BE HUGE DEPENDING ON THE SIZE OF ATTACHMENT........</Media>
<DateRecorded>2016-12-20T10:41:19.553</DateRecorded>
<Status>
SUCCESS
<Message>Success.</Message>
</Status>
</FormPhotoResponse>
</GetFormPhotoResult>
</GetFormPhotoResponse>
</soap:Body>
</soap:Envelope>
Recreating the document (C#)
var photo= [yourAPIcall...]
Response.Clear();
Response.ClearHeaders();
Response.ContentType = "image/jpeg";
Response.AddHeader("Content-Disposition", "attachment; filename=" + photo.MediaId + ".jpg");
Response.BinaryWrite(photo.Media);
Response.Flush();
Response.End();