My Trails offers 4 web services. To use these services you will firstly need to register for an 'API Key'. Click here and request your 'API Key'.
The My Trails Location Based Search will return a list of shared trails and markers found in the My Trails database based on latitude, longitude, radius and the associated information linked with each trail or marker using the HTTP GET method. Results are returned as XML.
Service address
https://mytrails.com.au/service/location.php
or (https://mytrails.com.au/service_location.php)
Format example
https://mytrails.com.au/service/location.php?apikey=<api-key>&latitude=<latitude>&longitude=<longitude>&radius=<search-radius-in-kms>&username=<user-name>&password=<password>&filter=<true>
Populated example
https://mytrails.com.au/service/location.php?apikey=12345678901234567890&latitude=-37.7524368&longitude=145.076019&radius=2&username=sample-user&password=12345&filter=true
Parameters
[ ] indicates your only options for this parameter.
( ) indicates additional information about this parameter.
apikey (required)
latitude (required)
longitude (required)
radius (required, search radius in kms)
username (optional)
password (optional, case sensitive)
filter [true] (optional)
The optional filter parameter will filter the search based on username. The optional username and password parameters will return ALL user's trails/markers - including 'private' and 'unlisted'.
Success
A successful response will be in XML format. If successful, the response will return nodes of <trail> and <marker> with information in each.The xml will always show <trail>'s before <marker>'s in the list of XML.
Example response
<?xml version="1.0" encoding="UTF-8"?> <myTrails> <trail> <name><![CDATA[Sample Trail]]></name> <description><![CDATA[Sample Description]]></description> <owner><![CDATA[SampleUser]]></owner> <lat>-37.740822</lat> <lon>145.136719</lon> <externalLink><![CDATA[https://mytrails.com.au/1000000]]></externalLink> <filePath>/trails/1000000/1000000000.xml</filePath> <distanceKms>31.75</distanceKms> <terrain>Off Road</terrain> <mode>Mountain Bike</mode> <views>140</views> </trail> <marker> <name><![CDATA[Sample Marker]]></name> <description><![CDATA[Sample Description]]></description> <owner><![CDATA[SampleUser]]></owner> <lat>-37.796441</lat> <lon>145.000262</lon> <externalLink><![CDATA[https://mytrails.com.au/search-location/37.79,145.00]]></externalLink> </marker> </myTrails>
Errors
If unsuccessful, you will see one or more of the following error messages:
Parameter missing: apikey = api key url parameter is missing
Parameter incorrect: apikey invalid = api key is incorrect
Parameter missing: latitude = latitude url parameter is missing
Parameter missing: longitude = longitude url parameter is missing
Parameter missing: radius = radius url parameter is missing
Nothing returned = the search returned no results
If you are having issues with this service - contact My Trails by clicking here.
The My Trails client upload service allows you to upload trails or markers to My Trails using the HTTP POST method.
Service address
https://mytrails.com.au/service/upload.php
or (https://mytrails.com.au/service_upload.php)
Form example
https://mytrails.com.au/service/test-upload.php
Process and parameters
You will be required to use the HTTP POST method with enctype="multipart/form-data".
[ ] indicates your only options for this parameter.
( ) indicates additional information about this parameter.
apikey (required)
username (required)
password (required,case sensitive)
name (required, trail or marker name)
description (optional)
share [0,1,2] (0 = private, 1 = public, 2 = unlisted:not publish on any lists or search results of My Trails)
type [marker,trail] (required)
If type = marker
latitude (required)
longitude (required)
If type = trail
terrain [Off Road,Path,Road,Snow,Water,Varied Terrain] (required)
mode [E Bike,E Mountain Bike,Hiking,Horse,Hybrid Bike,Inline Skates,Motorbike,Mountain Bike,Road Bike,Running,Skis,Snowboard,Walking,Watercraft,4WD] (required)
gpxfile (required, type=file, attached gpx format of less than 3Mb with either .gpx or .gz (gZip) file extension)
returnId [true] (optional)
includeWaypoints [true] (optional)
Success
If successful, the response will return the text 'success'.
If successful and you have requrested the 'returnId', the response will return the text 'success:<trail id>' (eg: success:1000000).
Errors
If unsuccessful, you will see one or more of the following error messages:
Parameter missing: apikey = api key parameter is missing
Parameter incorrect: apikey invalid = api key is incorrect
Parameter incorrect: apikey incorrect access privileges = api key does not have write permissions
Parameter missing: username = username parameter is missing
Parameter missing: password = password parameter is missing
Parameter incorrect: username or password = username or password is incorrect
Parameter missing: name = name parameter is missing
Parameter incorrect: name - illegal characters detected - 'value' = name contains illegal characters
Parameter incorrect: trail name already exists for current user = name already exists for user
Parameter incorrect: description - illegal characters detected - 'value' = description contains illegal characters
Parameter missing: share = share parameter is missing
Parameter incorrect: share - 'value' = share parameter does not match the accepted types
Parameter mising: type = type parameter is missing
Parameter incorrect: type - 'value' = type parameter does not match the accepted types
Error: lat/lon returned no value = the geocode lookup returned an error
If type = marker
Parameter missing: latitude = latitude parameter is missing
Parameter incorrect: latitude (is not a number) = latitude does not match the accepted type
Parameter missing: longitude = longitude parameter is missing
Parameter incorrect: longitude (is not a number) = longitude does not match the accepted type
If type = trail
Parameter missing: terrain = terrain parameter is missing
Parameter incorrect: terrain - 'value' = terrain parameter does not match the accepted types
Parameter missing: mode = mode parameter is missing
Parameter incorrect: mode - 'value' = mode parameter does not match the accepted types
Parameter missing: gpxfile = file parameter is missing
Parameter incorrect: file type 'value' = file type does not match the accepted types
parameter incorrect: file size [< 3Mb] = file is too large
Error: invalid XML = GPX/XML structure is incorrect
Error: incorrect trail length [> 0km/mi] = trail length is 0
If you are having issues with this service - contact My Trails by clicking here.
The My Trails client regiser service allows you to register a user at My Trails using the HTTP POST or HTTP GET method.
Service address
https://mytrails.com.au/service/register.php
or (https://mytrails.com.au/service_register.php)
Format example
https://mytrails.com.au/service/register.php?apikey=<api-key>&username=<requested-username>&password=<requested-password>&emailaddress=<email-address>
Populated example
https://mytrails.com.au/service/register.php?apikey=12345678901234567890&username=SampleUser&password=12345&emailaddress=SampleUser@email.com
Parameters
[ ] indicates your only options for this parameter.
( ) indicates additional information about this parameter.
apikey (required)
username (required, between 3 and 20 characters)
password (required, between 3 and 20 characters)
emailaddress (required)
Success
If successful, the response will return the text 'success'.
Errors
If unsuccessful, you will see one or more of the following error messages:
Parameter missing: apikey = api key parameter is missing
Parameter incorrect: apikey invalid = api key is incorrect
Parameter missing: username = username parameter is missing
Parameter incorrect: username - [length > 2 characters] = username is too short
Parameter incorrect: username - [length < 21 characters] = username is too long
Parameter incorrect: username is not alpha numeric = username is not alphanumeric
Parameter incorrect: username - illegal characters detected - 'value' = username contains illegal characters
Parameter incorrect: username 'value' is already taken = username is already in use
Parameter missing: password = password parameter is missing
Parameter incorrect: password - [length > 2 characters] = password is too short
Parameter incorrect: password - [length < 21 characters] = password is too long
Parameter incorrect: emailaddress - invalid = emailAddress is invalid
If you are having issues with this service - contact My Trails by clicking here.
The My Trails client regiser check service allows you to check the validity of a username and password using the HTTP GET method.
Service address
https://mytrails.com.au/service/register-check.php
or (https://mytrails.com.au/service_registrationcheck.php)
Format example
https://mytrails.com.au/service/register-check.php?apikey=<api-key>&username=<username>&password=<password>
Populated example
https://mytrails.com.au/service/register-check.php?apikey=12345678901234567890&username=SampleUser&password=12345
Parameters
[ ] indicates your only options for this parameter.
( ) indicates additional information about this parameter.
apikey (required)
username (required)
password (required)
Success
If successful, the response will return the text 'success'.
Errors
If unsuccessful, you will see one or more of the following error messages:
Parameter missing: apikey = api key parameter is missing
Parameter incorrect: apikey invalid = api key is incorrect
Parameter missing: username = username parameter is missing
Parameter missing: password = password parameter is missing
Parameter incorrect: username or password = account is invalid
If you are having issues with this service - contact My Trails by clicking here.