/file/list
This action returns a list of files associated with a work order.
Request
| Field | Description | Required |
|---|---|---|
report_id | Unique identifier for the work order | Yes |
Example:
{
"report_id": 3749
}
curl -H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{"report_id": 3749}' \
https://ppw.web/svc/file/list
Response
| Field | Description | Type |
|---|---|---|
report_id | Unique identifier for the work order | number |
files | List of files associated with work order | array |
Each item in files is a JSON object describing a file associated
with the work order. It contains the following information:
| Field | Description | Type |
|---|---|---|
file_id | Unique identifier for the file | number |
file_name | File name | string |
file_type | MIME-type identifier | string |
file_area | 0 if it is a “Photo”; 1 if it is a “Document” | number |
flags | Photo flag information | array |
The flags field will be populated if the file is a photo and if it’s
flagged to bid, completion, PCR question, Damage or Violation. Each
item in flags is a JSON object and will contain the following
fields:
| Field | Description | Type |
|---|---|---|
comp_note_id | Unique identifier for a bid or completion. | number |
item_description | Name of the bid or completion. Set only for Bid/Completion flag. | string |
pcr_question_id | Unique identifier for a PCR question flag. | number |
question | Question name. Set only for a PCR question flag. | string |
pcr_form_id | Unique identifier for the PCR Form associated to the PCR question. Set only for a PCR question flag. | number |
form_name | PCR Form name. Set only for a PCR question flag. | string |
damage_id | Unique identifier for a damage. Set when photo is flagged to a Damage or a Bid/Completion that has the “Damage” field checked. | number |
damage_title | Damage title. Set only for a Damage flag. | string |
violation_id | Unique identifier for a violation. Set photo is flagged to a Violation or a Bid/Completion that has the “Violation” field checked. | number |
violation_title | Violation title. Set only for a Violation flag. | string |
type | Flag type. b if it is a Bid flag; c if it is a Completion flag; pc if it is a PCR question flag; d if it is a Damage flag; v if it is a Violation flag. | string |
stage | Stage is set when type is b or c. See the following table for the possible values. | string |
The value of the stage field depends on the type. The following
table contains all possible values of stage:
| Type field | Possible stage values |
|---|---|
b (Bid) | b (Bid) |
c (Completion) | b (Before), i (During), a (After) |
Example successful response:
{
"report_id": 3749,
"files": [{
"file_id": 401,
"file_name": "grass.jpg",
"file_type": "image\/jpeg",
"file_area": 0,
"flags": [{
"pcr_question_id": 3,
"question": "Height of Grass",
"pcr_form_id": 2,
"form_name": "Grass Form",
"type": "pc"
}]
}, {
"file_id": 402,
"file_name": "lawn.jpg",
"file_type": "image\/jpeg",
"file_area": 0,
"flags": [{
"comp_note_id": 85,
"item_description": "Debris Exterior",
"type": "c",
"stage": "i"
}]
}, {
"file_id": 403,
"file_name": "Grasscut_Spec.pdf",
"file_type": "application\/pdf",
"file_area": 1,
"flags": []
},
{
"file_id": 101,
"file_name": "photo-73.jpg",
"file_type": "image/jpeg",
"file_area": 0,
"flags": [{
"damage_id": 3,
"damage_title": "Kitchen Damage",
"type": "d"
}]
},
{
"file_id": 102,
"file_name": "photo-74.jpg",
"file_type": "image/jpeg",
"file_area": 0,
"flags": [{
"violation_id": 3,
"violation_title": "Door Violation",
"type": "v"
}]
}
]
}
Errors
| Error Type | Description | Status Code |
|---|---|---|
access_denied | Access token is invalid or expired | 401 |
scope_invalid | Client app does not have the required OAuth scope | 403 |
invalid_wo | report_id in the request is invalid | 400 |