REST API: Images

This endpoint is used for updating or fetching an image by its imageID. GET requires an API key. All other operations require OAuth. The authenticated user can only update her own images. An attempt to update someone else's image will return 403.

To POST a new image, use Trails/Images or Account/Images

This endpoint only handles the image details. To see the actual image, get the following uri. Remember the image will not be served by traillink until it has been approved by RTC.

http://www.traillink.com/imagehandler.ashx?id={imageID}&t={type}

{type} can be "sm" for a thumbnail, "150" for a 150px square thumbnail, "md" for a 300px image, "640" for a 640px medium-large or lg for full size

Resource URI

/Images/26620?api_key=xxxx

Resource Properties

Parameter

Format

Description

Allows Null

caption string Cpation for the image no 
detailUrl  string  Formatted traillink url for trail  no 
displayName  string  User name for submitter  no 
imageID  long  unique identifier for image  no 
lat  decimal  Latitude for image.  0 if unknown  no 
lon  decimal  Longitude for image.  0 if unknown  no 
mimeType string  mime type for image.  no 
postDate  date  Date image was posted  no 
submitterAcctID  long  unique id for submitter  no 
title  string  Title for the image  no 
trailID  long  Unique ID for trail  no 
trailName  string  Name of trail  no 

Error Responses

HTTP GET

Get a single image by imageID.

JSON Request:

Empty

JSON Response:

{
"caption": "This is my caption",
"detailUrl": "trail-name-test-2",
"displayName": "johnqsample",
"imageID": 26620,
"lat": "-74.32",
"lon": "40.52777777777780",
"mimeType": "image\/jpeg",
"postDate": "2011-10-04 17:37:13Z",
"submitterAcctID": 7440532,
"title": "This is the title",
"trailID": 6683560,
"trailName": "Trail Name Test 2"
}

XML Request:

XML Response:

HTTP PUT

Update image details: display name, title, description, lat/lon First post image using /V1/Trails/Images/{TrailID}, then use this method to add details to the image.

JSON Request:

{
"caption": "This is my new caption",
"detailUrl": "trail-name-test-2",
"displayName": "johnqsample",
"imageID": 26620,
"lat": "-74.32",
"lon": "40.52777777777780",
"mimeType": "image\/jpeg",
"postDate": "2011-10-04 17:37:13Z",
"submitterAcctID": 7440532,
"title": "This is the title",
"trailID": 6683560,
"trailName": "Trail Name Test 2"
}

JSON Response:

true

XML Request:

XML Response:

true

REST API: Images Set

The Set endpoint is used to get the most recent images.  No posting is available on this endpoint.  Consumers must post to either Accounts/Images or Trails/Images.  API key required

Resource URI

/v1.1/Images/?limit=3&api_key=xxx

Set Filters

ParameterFormatDescriptionAllows Null
limit number MANDATORY - maximum number of records to return No

HTTP GET

Get the {limit} most recent images. Limit is mandatory.

JSON Request:

Request Body is empty

JSON Response:

[{
"caption": "The Truckee watershed became part of the National Forest Foundation's 'Treasured Landscapes, Unforgettable Experiences' program in 2012, one of only 14 sites chosen nationwide.",
"detailUrl": "truckee-river-bike-trail",
"displayName": "TrailLink Guest",
"imageID": 48651,
"lat": "0",
"lon": "0",
"mimeType": "image\/jpeg",
"postDate": "2013-02-05 17:49:24Z",
"submitterAcctID": 6313088,
"title": " ",
"trailID": 6015322,
"trailName": "Truckee River Bike Trail"
}, {
"caption": "The river and rail-trail are named after Chief Truckee, a leader of the Paiute tribe who guided westward settlers through the area in the mid-1800s.",
"detailUrl": "truckee-river-bike-trail",
"displayName": "TrailLink Guest",
"imageID": 48650,
"lat": "0",
"lon": "0",
"mimeType": "image\/jpeg",
"postDate": "2013-02-05 17:47:53Z",
"submitterAcctID": 6313088,
"title": " ",
"trailID": 6015322,
"trailName": "Truckee River Bike Trail"
}, {
"caption": "The trail follows the former route of the Lake Tahoe Railway and Transportation Company, which operated in the early 1900s between the bustling railroad town of Truckee (a stop along the First Intercontinental Railroad) and Tahoe City on the lake's shore.",
"detailUrl": "truckee-river-bike-trail",
"displayName": "TrailLink Guest",
"imageID": 48649,
"lat": "0",
"lon": "0",
"mimeType": "image\/jpeg",
"postDate": "2013-02-05 17:45:43Z",
"submitterAcctID": 6313088,
"title": " ",
"trailID": 6015322,
"trailName": "Truckee River Bike Trail"
}]

XML Request:

Request Body is empty

XML Response: