send_file
– Sending a Photo or File
Attaching photos or files to a work order is done through the send_file
event.
Files can be sent two ways.
- Files should be sent using multipart/form-data with the “file” field name. The POST data should contain four fields. The
dst_report_id
,file_id
,file_name
, andfile_area
.
Request payload JSON - multipart/form-data
{
"username": "demo",
"password": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"site_id": "dcc363d0-8ed1-48a2-ba2e-f638275db4f",
"event_name": "send_file",
"event_data": "{\"dst_report_id\":\"12249481\",\"file_id\":\"1130171565\",\"file_area\":\"0\"}"
}
curl -X POST \
--data 'payload={
"username": "demo",
"password": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"site_id": "dcc363d0-8ed1-48a2-ba2e-f638275db4f",
"event_name": "send_file",
"event_data": "{\"dst_report_id\":\"12249481\",\"file_id\":\"1130171565\",\"file_area\":\"0\"}"
}' \
https://devas.propertypreswizard.com/main/api/link/receiver.php
- A URL accessible to PPW can be sent in the payload for the image and thumbnail. When PPW sends results back to a third party, this method is used.
Field Name | Description |
---|---|
dst_report_id | The report_id file is being uploaded to. |
file_id | The file_id from the integrator. Used to flag photos to PCR questions. Must be unique. |
file_name | The file name, including the extension. Used to check allowed file types. |
file_area | Indicates photo or file upload. 0 = photo, 1 = file. |
s3_url | A URL accessible to PPW. |
s3_url_thumb | A URL accessible to PPW. |
Request Payload JSON - URL Accessible
{
"username": "demo",
"password": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"site_id": "dcc363d0-8ed1-48a2-ba2e-f638275db4f",
"event_name": "send_file",
"event_data": "{\"dst_report_id\":\"12249481\",\"file_id\":\"1130171565\",\"file_area\":\"0\",\"file_name\":\"example.jpg\",\"s3_url\":\"https://your-bucket.s3.amazonaws.com/example.jpg\",\"s3_url_thumb\":\"https://your-bucket.s3.amazonaws.com/example_thumb.jpg\"}"
}
curl -X POST \
--data 'payload={
"username": "demo",
"password": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"site_id": "dcc363d0-8ed1-48a2-ba2e-f638275db4f",
"event_name": "send_file",
"event_data": "{\"dst_report_id\":\"12249481\",\"file_id\":\"1130171565\",\"file_area\":\"0\",\"file_name\":\"example.jpg\",\"s3_url\":\"https://your-bucket.s3.amazonaws.com/example.jpg\",\"s3_url_thumb\":\"https://your-bucket.s3.amazonaws.com/example_thumb.jpg\"}"
}' \
https://www.propertypreswizard.com/api/link/receiver.php
The file_id passed to the PPWL web service should be the unique ID from the integrator’s system. When photos are flagged to Bid/Completion items or PCR form questions, the integrator will send the same ID from their end and PPWL will look up the information and associate the photos correctly.
Allowed File Types
Extension | Mime Type | File Area |
---|---|---|
jpg | image/jpeg | 0 |
jpeg | image/jpeg | 0 |
png | image/png | 1 |
gif | image/gif | 1 |
application/pdf | 1 | |
doc | application/msword | 1 |
docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | 1 |
ppt | application/vnd.ms-powerpoint | 1 |
pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | 1 |
pps | application/vnd.ms-powerpoint | 1 |
ppsx | application/vnd.openxmlformats-officedocument.presentationml.slideshow | 1 |
odt | application/vnd.oasis.opendocument.text | 1 |
xls | application/vnd.ms-excel | 1 |
xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | 1 |
key | application/pgp-keys | 1 |
zip | application/zip | 1 |
mp3 | audio/mpeg | 1 |
wav | audio/x-wav | 1 |
mp4 | video/mp4 | 1 |
wmv | x-ms-wmv | 1 |
avi | video/x-msvideo | 1 |
mpg | video/mpeg | 1 |
txt | text/plain | 1 |
msg | application/vnd.ms-outlook | 1 |
eml | message/rfc822 | 1 |
jxr | image/vnd.ms-photo | 1 |