REST API: Accounts/Trails

The Set is used to get the trails that are related to the arg acctID user. OAuth required. The POST is used to add a new trail relation to the account. The possible values for relation are:

SUB - User submitted this trail. This relation cannot be POSTed. It is automatically added when a user submits a trail.
FAV - User added this trail as a favorite
SBS- User added this trail via a subscription.
TKN - User added this trail via a token.
FRE - User added this trail as a freebie.


DELETE is use on the individual endpoint with a relation in the query string to un-favorite or unsubscribe a trail.

Resource URI

/Accounts/7440532/Trails/6016038?relation=FAV

Resource Properties

Parameter Format Description Allows Null
expireDate date read only.  For SBS, date the sub expires Yes
relation string FAV,SBS,SUB,TKN,FRE no
relationDate date Date the relation started no 
trailID long unique ID for the related trail no

Error Responses

402 - "Subscription required" - Users without a subscription cannot add SBS relations
402 - "Insufficient number of tokens" Users without available tokens cannot add TKN relations

HTTP DELETE

Remove an account's relation to a trail. Only SBS and FAV can be deleted.

JSON Request:

Body empty (consumer must specify relation type in query string)

JSON Response:

true

XML Request:

XML Response:


REST API: Accounts/Trails Set

Trails related to the account in the arg

Resource URI

/Accounts/7440532/Trails/

Set Filters

Parameter Format Description Allows Null
relation string Comment separated list of FAV,SBS,SUB,TKN yes
offset int Number of the first row Yes
limit int Number of rows Yes 
sort string column to sort by yes

HTTP GET

The list of trails related to the arg acctID user

JSON Request:

Body empty

JSON Response:

[
{
"expireDate": "",
"relation": "SUB",
"relationDate": "",
"trailID": 6683560
},
{
"expireDate": "",
"relation": "SUB",
"relationDate": "",
"trailID": 7482843
}
]

XML Request:

Body empty

XML Response:

HTTP POST

Add a new relation to a trail.

JSON Request:

{
"expireDate": "",
"relation": "FAV",
"relationDate": "2013-04-09 09:54:59Z",
"trailID": 6016038
}

JSON Response:

true

XML Request:

XML Response: