/file/flag
This action flags a file to a bid or a PCR question. Note that only
photos (area=0) can be flagged.
Request
| Field | Description | Required |
|---|---|---|
file_id | Unique identifier for a file | Yes |
comp_note_id | Unique identifier for a bid item | Yes, if flagging file to a bid |
pcr_question_id | Unique identifier for a PCR question | Yes, if flagging file to a PCR question |
type | Flag type. It is b if flagging file to a bid; c if flagging file to a completion; pc if flagging file to a PCR question | Yes |
stage | b for flagging a “Before” photo; i flagging a “During” photo; a for flagging an “After” photo | Yes, if type is c (Completion) |
Example 1. Flag a photo as a “Bid” photo:
{
"file_id": 452,
"comp_note_id": 60,
"type": "b"
}
curl -H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{"file_id": 452, "comp_note_id": 60, "type": "b"}' \
https://ppw.web/svc/file/flag
Example 2. Flag a photo as a “During” photo:
{
"file_id": 160,
"comp_note_id": 93,
"type": "c",
"stage": "i"
}
curl -H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{"file_id": 160, "comp_note_id": 93, "type": "c", "stage": "i"}' \
https://ppw.web/svc/file/flag
Response
| Field | Description | Type |
|---|---|---|
result | Informational message | string |
Example successful response:
{"result":"File flagged to bid"}
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 |
type_required | The flag type not specified in the request | 400 |
type_invalid | The specified flag type in the request is invalid | 400 |
stage_invalid | The specifiecd stage is invalid or `stage is not set when it is a required field | 400 |
file_id_required | The file_id is not specified in the request | 400 |
file_id_invalid | The specified file_id is invalid | 400 |
comp_note_id_required | The flag type is b and the comp_note_id is not specified in the request | 400 |
comp_note_id_invalid | The specified comp_note_id is invalid | 400 |
cannot_flag | The specified file_id is not a photo (area=0) | 400 |