Listings: Photo Uploads
This service allows the client upload a photo for a listing. Unlike the Listings: Photos resource, which requires a json payload for uploading a photo, this service supports a form based post body. Paired with the Tickets resource for listings or incomplete listings, this service provides a simple interface to submit forms directly to the API from a web browser.
Supported Roles
| Role | Reads | Writes | Notes |
|---|---|---|---|
| IDX | No | No | |
| Public | No | No | |
| VOW | No | No | |
| Portal | No | No | |
| Private | No | Yes |
More information about roles may be found here.
Available Services
Photo Uploads
URI: Supplied by the Uri attribute in the Listing: Tickets response.
| HTTP Method | Description | Notes |
|---|---|---|
| POST | Uploads a new photo | Requires HTTP form based post submissions instead of the standard API JSON body. |
| GET,PUT,DELETE | Returns HTTP 405 (Method Not Allowed) | Not implemented |
POST Request
Parameters:
| Form Parameter | Required | Description |
|---|---|---|
Token |
Yes | The upload token granted from the Listing: Tickets service. |
Name |
Yes | |
File |
Yes | Photo file to upload |
Primary |
No | Boolean indicating whether the current photo should be set as primary. Optional, false by default unless this is the first listing photo. |
Caption |
No | A caption for the photo, up to 1000 characters. Optional; if omitted, will be blank. |
RedirectTo |
No | URL to send the user back to on successful upload. Optional, JSON response with success message and Id will display by default (See below). |
POST Response (Sample)
On success, when RedirectTo is present, the response redirects the user to the URI, otherwise the response contains the Id of the new photo.
{
"D": {
"Success": true,
"Results": [
{
"Id": "20120117194139638109000000"
}
]
}
}
Response Description
| Attribute | Description | Returned for Which User Type(s) | Returned for Which API Key Role(s) |
|---|---|---|---|
Id |
ID of the uploaded photo. | All | Private |
Expansions
None.