REST API: Accounts

Get or update traillink user account information. OAuth required.
Create a new traillink account. Key required.

Resource URI

/Accounts/7440532

Resource Properties

Parameter

Format

Description

Allows Null

aboutMe string The users's profile text Yes
acctID long unique identifier for account no
altLine1 string Additional address line for the user's primary contact address Yes
altLine2 string Additional address line for the user's primary contact address yes
availableTokenCount int Number of tokens available for account. GET only. no
city string city of the user's primary contact address yes
country string country of the user's primary contact address yes
email string user's email address no
expiredTrailCount int Number of expired trails for account. GET only. no
favoriteTrailCount int Number of favorited trails for account. GET only. no
firstName string user's first name no
fullName string user's full name. This field is computed, and cannot be updated directly yes
imageID long ID of the user's profile pic. 0 if none no.
lastName string user's last name no
middleName string user's middle name yes
mobileNumber string user's mobile number yes
phone string user's home phone yes
prefix string user's prefix yes
state string state of the user's primary address yes
street string street of the user's primary address yes
submittedTrailCount int Number of submitted trails for account. GET only. no
subscriptionExpireDate date Date the Account's subscription ends. GET only. Empty string if account has never subscribed no
subscriptionTrailCount int Number of subscribed trails for account. GET only. no
suffix string user's name suffix (Jr., etc) yes
tokenTrailCount int Number of token-purchased trails for account. GET only. no
userName string user's userName. This is immutable, so updates are ignored no
zip string zipcode of the user's primary address no

Error Responses

First Name is required.
Last Name is required.
Email is required.
UserName is required.
Zipcode is required.
Password is required.

This username is already registered.
This email address is already registered.

AltLine1 must be fewer than 30 characters.
AltLine2 must be fewer than 30 characters.
City must be fewer than 25 characters.
Country must be exactly 2 characters.
Email must be fewer than 150 characters.
FirstName must be fewer than 20 characters.
Invalid email format.
LastName must be fewer than 30 characters.
MobileNumber must be fewer than 20 characters.
Password must be at least 8 characters
Phone must be fewer than 20 characters.
Prefix must be fewer than 20 characters
State must be exactly 2 characters.
Street must be fewer than 30 characters.
Suffix must be fewer than 15 characters.
UserName must be fewer than 20 characters.
Zip must be fewer than 14 characters.

HTTP GET

Returns an existing account. OAuth required.

JSON Request:

Request Body is empty

JSON Response:

{
"aboutMe": " I am a sample account, and I wear a really nice hat.
",
"acctID": 7440532,
"altLine1": " ",
"altLine2": "",
"availableTokenCount": 0,
"city": "Vienna",
"country": "US",
"email": "johnqsample@generalsystems.com",
"expiredTrailCount": 0,
"favoriteTrailCount": 0,
"firstName": "John",
"fullName": "Mr. John Sample",
"imageID": 48346,
"lastName": "Sample",
"middleName": " ",
"mobileNumber": "(703)444-5555",
"phone": "(703)444-4444",
"prefix": "Mr.",
"state": "VA",
"street": "44 Sample Drive",
"submittedTrailCount": 2,
"subscriptionExpireDate": "2014-04-04 04:00:00Z",
"subscriptionTrailCount": 0,
"suffix": " ",
"tokenTrailCount": 0,
"userName": "johnqsample",
"zip": "22180"
}

XML Request:

XML Response:

HTTP PUT

Updates an existing account. Returns true on success; false on failure.

JSON Request:

{
"aboutMe": " I am a sample account, and I wear a really nice hat.",
"acctID": 7440532,
"altLine1": " ",
"altLine2": "",
"city": "Vienna",
"country": "US",
"email": "johnqsample@generalsystems.com",
"firstName": "John",
"fullName": "Mr. John Sample",
"imageID": 0,
"lastName": "Sample",
"middleName": " ",
"mobileNumber": "(703)444-5555",
"phone": "(703) 444-4444",
"prefix": "Mr.",
"state": "VA",
"street": "44 Sample Drive",
"suffix": " ",
"userName": "johnqsample",
"zip": "22180"
}

JSON Response:

true

XML Request:

<Account xmlns="http://schemas.datacontract.org/2004/07/RTC" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AcctID xmlns="http://schemas.datacontract.org/2004/07/GSC">7440532</AcctID>
<AltLine1 xmlns="http://schemas.datacontract.org/2004/07/GSC"> </AltLine1>
<AltLine2 xmlns="http://schemas.datacontract.org/2004/07/GSC"/>
<BirthDate xmlns="http://schemas.datacontract.org/2004/07/GSC">05011980</BirthDate>
<City xmlns="http://schemas.datacontract.org/2004/07/GSC">Vienna</City>
<Country xmlns="http://schemas.datacontract.org/2004/07/GSC">USA</Country>
<Email xmlns="http://schemas.datacontract.org/2004/07/GSC">johnqsample@gmail.com</Email>
<FirstName xmlns="http://schemas.datacontract.org/2004/07/GSC">John</FirstName>
<FullName xmlns="http://schemas.datacontract.org/2004/07/GSC">Mr. John Q. Sample</FullName>
<Gender xmlns="http://schemas.datacontract.org/2004/07/GSC"/>M</Gender>
<ImageID xmlns="http://schemas.datacontract.org/2004/07/GSC">0</ImageID>
<LastName xmlns="http://schemas.datacontract.org/2004/07/GSC">Sample</LastName>
<LocalSession i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/GSC"/>
<MajorDonor xmlns="http://schemas.datacontract.org/2004/07/GSC"> </MajorDonor>
<MiddleName xmlns="http://schemas.datacontract.org/2004/07/GSC">Q.</MiddleName>
<Organization xmlns="http://schemas.datacontract.org/2004/07/GSC"/>
<Password i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/GSC"/>
<Phone xmlns="http://schemas.datacontract.org/2004/07/GSC">(703)444-4444</Phone>
<Prefix xmlns="http://schemas.datacontract.org/2004/07/GSC">Mr.</Prefix>
<State xmlns="http://schemas.datacontract.org/2004/07/GSC">VA</State>
<Street xmlns="http://schemas.datacontract.org/2004/07/GSC">44 Sample Drive</Street>
<Suffix xmlns="http://schemas.datacontract.org/2004/07/GSC"> </Suffix>
<Zip xmlns="http://schemas.datacontract.org/2004/07/GSC">22180</Zip>
<AboutMe xmlns="http://schemas.datacontract.org/2004/07/GSC">I am a sample account, a I wear a nice hat.</AboutMe>
<MobileNumber>(703)444-4445</MobileNumber>
<UserName>johnqsample</UserName >
</Account>

XML Response:

<boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean>

REST API: Accounts Set

Create a new Traillink.com account.  The required fields are firstName, lastName, email, userName, zipcode, and password.

Resource URI

/Accounts/

Set Filters

HTTP POST

Create a new account.

JSON Request:

{"aboutMe":" My name is John.",
"altLine1":" ",
"altLine2":"",
"city":"",
"country":"",
"email":"jmurphy8@generalsystems.com",
"firstName":"John",
"lastName":"Murphy",
"middleName":" ",
"mobileNumber":" ",
"password":"1234abcd",
"phone":" ",
"prefix":" ",
"state":"",
"street":"",
"suffix":" ",
"userName":"j8cm",
"zip":"22182"}

JSON Response:

7482870

XML Request:

XML Response: