Listings: Photos
The Listing Photos service returns data about listing photos for a specific listing to be retrieved. URIs to various photo sizes are returned rather than image files.
- Supported Roles
- Available Services
- Listing Photos
- Individual Listing Photo
- Photo Description
- Expansions
- API Explorer
Supported Roles
| Role |
Reads? |
Writes? |
| IDX |
Yes |
No |
| VOW |
Yes |
No |
| Private |
Yes |
Yes |
More information about roles
may be found here.
Available Services
Listing Photos
URI: /<API Version>/listings/<Listing.Id>/photos
| HTTP Method |
Description |
Notes |
| GET |
Returns a list of all photos associated with the current listing |
|
| POST |
Uploads a photo to attach to a listing |
|
| PUT,DELETE |
Returns HTTP 405 (Method Not Allowed) |
Not implemented |
GET Request
Parameters:
GET Response
Example:
{
"D": {
"Success": true,
"Results": [
{
"ResourceUri": "/v1/listings/20060412165917817933000000/photos/20080917142739989238000000",
"Id": "20080917142739989238000000",
"Name": "Listing Photo",
"Caption": "",
"UriThumb": "http://photos.sparkplatform.com/demomls/20080917142739989238000000-t.jpg",
"Uri300": "http://photos.sparkplatform.com/demomls/20080917142739989238000000.jpg",
"Uri640": "http://resize.sparkplatform.com/demomls/640x480/true/20080917142739989238000000-o.jpg",
"Uri800": "http://resize.sparkplatform.com/demomls/800x600/true/20080917142739989238000000-o.jpg",
"Uri1024": "http://resize.sparkplatform.com/demomls/1024x768/true/20080917142739989238000000-o.jpg",
"Uri1280": "http://resize.sparkplatform.com/demomls/1280x1024/true/20080917142739989238000000-o.jpg",
"UriLarge": "http://photos.sparkplatform.com/demomls/20080917142739989238000000-o.jpg",
"Primary": true
}
]
}
}
POST Request
Request body:
{
"D": {
"Photos": [
{
"Picture": "AB81959FEDAA...",
"FileName": "GreatPic.jpg",
"Name": "Front porch",
"Caption": "Step onto the hand-felled timber of your new front porch for the ultimate in luxurious relaxation"
}
]
}
}
POST Response
The
standard success/fail response is returned.
Individual Listing Photo
URI: /<API Version>/listings/<Listing.Id>/photos/<Id>
| HTTP Method |
Description |
Notes |
| GET |
Returns the specified photo |
|
| POST |
Returns HTTP 405 (Method Not Allowed) |
Not implemented |
| PUT |
Updates an existing photo |
|
| DELETE |
Deletes an existing photo |
|
GET Request
Parameters:
GET Response
See the
GET response section above for the data format.
Response Description
PUT Request
Response Body:
See the
POST response section above for the data format.
PUT Response
The
standard success/fail response is returned.
DELETE Request
Parameters:
DELETE Response
The
standard success/fail response is returned.
Response Description
Photo Sizes
If the original size of a photo is smaller than the corresponding attribute declares, the picture linked to will be the original size rather than stretched to specified dimensions. For example, the photo referenced by Uri1280 will be 1280x1024 or smaller.
| Attribute |
Data Type |
Writeable? |
Required? |
Description |
| ResourceUri |
Character |
No |
No |
The URI to the particular photo data (not the image). |
| Id |
Character |
No |
No |
The unique id for the photo. |
| Picture |
Character |
Yes |
POST |
Base64 encoded representation of the image file. |
| FileName |
Character |
Yes |
POST |
The name of the original file being uploaded. |
| Name |
Character |
Yes |
Yes |
The name of the photo. Maximum of 40 characters. |
| Caption |
Character |
Yes |
No |
Text intended as the photo's caption. Maximum of 1000 characters. |
| UriThumb |
Character |
No |
No |
The URI to the thumbnail-sized image. |
| Uri300 |
Character |
No |
No |
|
| Uri640 |
Character |
No |
No |
The URI to the 640x480 image. |
| Uri800 |
Character |
No |
No |
The URI to the 800x600 image. |
| Uri1024 |
Character |
No |
No |
The URI to the 1024x768 image. |
| Uri1280 |
Character |
No |
No |
The URI to the 1280x1024 image. |
| UriLarge |
Character |
No |
No |
The URI to the original image. |
| Primary |
Boolean |
Yes |
No |
true if the photo is intended as the listing's primary photo. |
Expansions
None.
API Explorer
The API Explorer does not currently support this service.