Username:
Password:
 

TripTracker API

The TripTracker API is available for non-commercial use by outside developers. Commercial use is possible by prior arrangement.

The TripTracker API consists of a set of callable methods, and some API endpoints.
To perform an action using the TripTracker API, you need to select a calling convention, send a request to its endpoint specifying a method and some arguments, and will receive a formatted response.
All request formats, listed on the API index page, take a list of named parameters.

PDF Documents

  • Rest API Documentation [PDF]
  • NET Library Documentation [PDF] [CHM]

REST APIShow all

Administration

AddUser

Creates TripTracker user account. The username must be unique with length inbetween 4 and 24 characters. Note that user registration confirmation is not performed here.

Authentication

This method requires administrative privileges

Arguments

  • username (required) - The TripTracker username
  • password (required) - The TripTracker plaintext password
  • email (required) - User's email address

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<userprofile>
		<id>240</id>
		<username>bozo</username>
		<email>bozo@yahoo.com</email>
	</userprofile>
</rsp>   

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

DeleteUser

Removes user's profile and all associated data from the filesystem and database. Operation cannot be undone!

Authentication

This method requires administrative privileges

Arguments

  • username (required) - Username of the account to be removed from the TripTracker repository

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

ReloadConfig

Reloads updated settings from the TripTracker server configuration.

Authentication

This method requires administrative privileges

Arguments

  • username (required) - Username of the account to be removed from the TripTracker repository

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

UpdateSearchIdx

Forces TripTracker fulltext search index to be updated and/or optimized. Normally the index is already dynamically updated so that rebuild should be activated only when index is out of sync with the underlying database. Note that this operation can be quite time consuming.

Authentication

This method requires administrative privileges

Arguments

  • rebuildIdx (required) - Whether entire search index should be rebuilt from the database
  • optimizeIdx (required) - Whether search index should be optimized for faster searching

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed
Authentication

Login

Authenticates given user with the TripTracker server. Password is hashed.

Authentication

This method does not require authentication.

Arguments

  • username (required) - The TripTracker username
  • password (required) - The TripTracker SHA-1 hashed password

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<authToken>1867757637</authToken>
<	profileId>309</profileId>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

LoginPlainText

Authenticates given user with the TripTracker server. Password is sent in cleartext.

Authentication

This method does not require authentication

Arguments

  • username (required) - The TripTracker username
  • password (required) - The TripTracker plaintext password

Example response

See Login

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

Logout

Disconnects user making the request from the TripTracker server. Inactive users are automatically disconnected when their session expires after some period of time.

Authentication

This method requires user to be authenticated

Arguments

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 104 : Server error
  • 108 : Authentication failed

SetApplicationIdentifier

Sets application identifier acting as a temporary user authentication token (used from TripTracker uploader). Note that identifier becomes invalid when the session expires.

Authentication

This method requires user to be authenticated

Arguments

  • applicationIdentifier (required) - Temporary application identifier

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed
Gallery

DeleteGallery

Deletes gallery with all associated items.

Authentication

This method requires user to be authenticated

Arguments

  • id (required) - Identifier of the gallery to be deleted

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GetGalleries

Retrieves list of galleries from the TripTracker repository.

Authentication

This method requires user to be authenticated

Arguments

  • maxhits (required) - Max number of hits to return
  • ownername (optional) - Name of the gallery owner
  • tags (optional) - Comma separated list of tags that the returned galleries must be associated with

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<galleries>
		<gallery>
			<ownerId>7</ownerId>
			<owner>fiction</owner>
			<name>testGallery</name>
			<description>test gallery description</description>
			<creationDate>1170338576000</creationDate>
			<lastModified>1170338578000</lastModified>
			<viewCount>173</viewCount>
				<tags>
					<tag>
						<tagId>13</tagId>
						<name>Kaktus</name>
					</tag>
					<tag>
						<tagId>37</tagId>
						<name>Tek</name>
					</tag>
				</tags>
		</gallery>
	</galleries>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GetGalleryItems

Retrieves media items associated with the specified gallery.

Authentication

This method requires user to be authenticated

Arguments

  • galleryId (required) - The ID of the gallery
  • maxhits (required) - Max hits to return
  • featuredOnly (optional) - If only featured items are requested. Values: 1 => featured only; any other value or omitted argument means all galleries.

Example response

<?xml version="1.0" encoding="utf-8" ?>
	<rsp stat="ok">
		<galleryItems><galleryItem>
			<galleryId>123</galleryId>
			<id>61484</id>
			<title>Tadzikistanska svatba</title>
			<description>Kako smo se imeli na dogodku v mestu...</description>
			<creationDate>1170340749000</creationDate>
			<imageWidth>68</imageWidth>
			<imageHeight>71</imageHeight>
			<urlOrigImg>http://media.localhost/7/originals/7dbe9fc20a00000c0153d79c6e89fac4.flv</urlOrigImg>
			<urlWebImg>http://media.localhost/7/cropped/web-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlWebImg>
			<urlThumbImg>http://media.localhost/7/thumbs/thumb-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlThumbImg>
			<viewCount>16</viewCount>
			<featured>0</featured>
		</galleryItem>
		<galleryItem>
			<galleryId>23</galleryId>
			<id>61485</id>
			<title>Domaca burleska</title>
			<description>Pasti na glavo ni hec.</description>
			<creationDate>1170340749000</creationDate>
			<imageWidth>128</imageWidth>
			<imageHeight>128</imageHeight>
			<urlOrigImg>http://media.localhost/7/originals/7dbea0bc0a00000c00e1ed5bbb5dd811.flv</urlOrigImg>
			<urlWebImg>http://media.localhost/7/cropped/web-7dbea0bc0a00000c00e1ed5bbb5dd811.jpg</urlWebImg>
			<urlThumbImg>http://media.localhost/7/thumbs/thumb-7dbea0bc0a00000c00e1ed5bbb5dd811.jpg</urlThumbImg>
			<viewCount>66</viewCount>
			<featured>1</featured>
		</galleryItem>
	</galleryItems>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GetMediaItem

Retrieves media item associated with the specified trip or gallery.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip or -1 if galleryId holds a valid gallery identifier
  • galleryId (required) - The ID of the gallery or -1 if tripId holds a valid trip identifier
  • mediaItemId (required) - Media item identifier of the item to be retrieved

Example response

<?xml version="1.0" encoding="utf-8" ?>
	<rsp stat="ok">
		<tripEntyElements>
			<galleryItem>
				<galleryId>123</galleryId>
				<id>61484</id>
				<title>Tadzikistanska svatba</title>
				<description>Kako smo se imeli na dogodku v mestu...</description>
				<creationDate>1170340749000</creationDate>
				<imageWidth>68</imageWidth>
				<imageHeight>71</imageHeight>
				<urlOrigImg>http://media.localhost/7/originals/7dbe9fc20a00000c0153d79c6e89fac4.flv</urlOrigImg>
				<urlWebImg>http://media.localhost/7/cropped/web-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlWebImg>
				<urlThumbImg>http://media.localhost/7/thumbs/thumb-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlThumbImg>
				<viewCount>16</viewCount>
				<featured>0</featured>
			</galleryItem>
		</tripEntyElements>
	</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GetMediaItems

Retrieves media items associated with the specified trip or gallery.

Authentication

This method requires user to be authenticated

Arguments

  • itemType (optional) - Media item type(values: photo|video|all) that the returned items must match
  • searchType (required) - Media item search type(user|recent|location|topviewed)
  • searchContext (optional) - Media item search context(trip|gallery|all)
  • maxhits (optional) - Max number of hits to return
  • user (required if searchType is "user") - User which's media items to retrieve
  • continent (required if searchType is "location") - Continent that the media items are associated with
  • country (required if searchType is "location") - Country that the media items are associated with
  • sort (optional) - Sort by parameter(values: ony "created" is currently available)
  • tags (optional) - Comma separated list of tags that the returned items must be associated with

Example response

<?xml version="1.0" encoding="utf-8" ?>
	<rsp stat="ok">
		<mediaItems>
			<galleryItem>
				<galleryId>123</galleryId>
				<id>61484</id>
				<title>Tadzikistanska svatba</title>
				<description>Kako smo se imeli na dogodku v mestu...</description>
				<creationDate>1170340749000</creationDate>
				<imageWidth>68</imageWidth>
				<imageHeight>71</imageHeight>
				<urlOrigImg>http://media.localhost/7/originals/7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlOrigImg>
				<urlWebImg>http://media.localhost/7/cropped/web-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlWebImg>
				<urlThumbImg>http://media.localhost/7/thumbs/thumb-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlThumbImg>
				<viewCount>16</viewCount>
				<featured>0</featured>
			</galleryItem>
			<tripEntryElement>
				<tripId>12</tripId>
				<timezoneId>36</timezoneId>
				<continent></continent>
				<country>191</country>
				<state>0</state>
				<city>3</city>
				<distance>25215</distance>
				<longitude>24.39288</longitude>
				<latitude>44.374706</latitude>
				<locationSource>1</locationSource>
				<rating>0</rating>
				<id>61484</id>
				<title>To smo mi</title>
				<description>Res, to smo mi.</description>
				<creationDate>1170340749000</creationDate>
				<imageWidth>68</imageWidth>
				<imageHeight>71</imageHeight>
				<urlOrigImg>http://media.localhost/7/originals/7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlOrigImg>
				<urlWebImg>http://media.localhost/7/cropped/web-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlWebImg>
				<urlThumbImg>http://media.localhost/7/thumbs/thumb-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlThumbImg>
				<viewCount>16</viewCount>
				<featured>0</featured>
			</tripEntryElement>
		</mediaItems>
	</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

DeleteMediaItem

Removes media item from TripTracker repository.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip or -1 if galleryId holds a valid gallery identifier
  • galleryId (required) - The ID of the gallery or -1 if tripId holds a valid trip identifier
  • mediaItemId (required) - Media item identifier of the item to be deleted

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

PutGallery

Inserts new gallery.

Authentication

This method requires user to be authenticated

Arguments

  • name (required) - Gallery name
  • description (required) - Description of the gallery
  • accessrights (required) - Access rights (can be either public, private or friends)

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<galleryId>21</galleryId>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

UpdateGallery

Updates an existing gallery.

Authentication

This method requires user to be authenticated

Arguments

  • id (required) - Gallery identifier
  • name (required) - Gallery name
  • description (required) - Description of the gallery
  • accessrights (required) - Access rights (can be either public, private or friends)

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<galleryId>21</galleryId>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed
GEO lookup

GeoLookupCircle

Search for places in area, where area is specified with longitude, latitude and radius (in meters)

Authentication

This method requires user to be authenticated

Arguments

  • longitude (required) - The geographic longitude (-180 - +180)
  • latitude (required) - The geographic latitude (90 - -90)
  • radius (required) - Search for places in the specified radius only (in meters)
  • maxhits (required) - Upper limit to the number of geo hits

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<gnsfeature>
		<name>Ljubljana</name>
		<latitude>46.0553</latitude>
		<longitude>14.5144</longitude>
		<population>255115</population>
		<featurecode>P</featurecode>
		<featureclass>PPLC</featureclass>
		<elevation>0</elevation>
		<adminunitcode>00</adminunitcode>
		<country>Slovenia</country>
	</gnsfeature>
	<gnsfeature>
		<name>Ig pri Ljubljana (Ig)</name>
		<latitude>45.9603</latitude>
		<longitude>14.5289</longitude>
		<population>2078</population>
		<featurecode>P</featurecode>
		<featureclass>PPL</featureclass>
		<elevation>0</elevation>
		<adminunitcode>00</adminunitcode>
		<country>Slovenia</country>
	</gnsfeature>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GeoLookupName

Search for places named like this city. Search hits can further be limited to single country only.

Authentication

This method requires user to be authenticated

Arguments

  • country (required) - Search for cities in the specified country only
  • city (required) - City to search for
  • maxhits (required) - Upper limit to the number of geo hits

Example response

see GeoLookupCircle

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GeoLookupPoint

Search for the most significant places near the point, specified with longitude/latitude pair. Radius specifies how many places closest to the target point should be considered. Specify zero to retrieve closest maxhits points.

Authentication

This method requires user to be authenticated

Arguments

  • longitude (required) - The geographic longitude (-180 - +180)
  • latitude (required) - The geographic latitude (90 - -90)
  • radius (required) - Search only through the specified number of the nearest cities
  • maxhits (required) - Upper limit to the number of geo hits

Example response

See GeoLookupCircle

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GeoLookupRect

Search for places in area, where area is specified with a pair of longitude and latitude points, defining extremes of a rectangular section of the Earth.

Authentication

This method requires user to be authenticated

Arguments

  • longitudeFrom (required) - Geo longitude of the first rectangle corner
  • latitudeFrom (required) - Geo latitude of the first rectangle corner
  • longitudeTo (required) - Geo longitude of the second rectangle corner
  • latitudeTo (required) - Geo latitude of the second rectangle corner
  • maxhits (required) - Upper limit to the number of geo hits

Example response

See GeoLookupCircle

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed
Info

GetRequiredAPIVersion

Returns version of the REST API running on the TripTracker server.

Authentication

This method is public.

Arguments

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<version>1.7.0</version>
</rsp>  

Error codes

  • 100 : Internal error
  • 104 : Server error

ShowMethods

Returns a list of all exported REST methods.

Authentication

This method is public

Arguments

  • showParameters (required) - Whether parameter descriptions should be returned as well

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<methods>
		<method>
			<name>getGpsFormats</name>
			<description>This method shows all possible GPS formats.</description>
			<parameters>
				<parameter>
					<name>authToken</name>
					<type>long</type>
					<description>The authentication token.</description>
				</parameter>
			</parameters>
		</method>
		<method>
			<name>getTimezones</name>
			<description>This method shows all timezones.</description>
				<parameters>
					<parameter>
						<name>authToken</name>
						<type>long</type>
						<description>The authentication token.</description>
					</parameter>
				</parameters>
		</method>
	</methods>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
Search

Search

Performs a fulltext search through the TripTracker repository. Scope of the search includes trips, trip entries, media item descriptions, comments and user profiles, but can be limited to specific needs.

Authentication

This method requires user to be authenticated

Arguments

  • searchScope (required) - Search scope (trip, tripentry, mediaitem, all)
  • searchQuery (required) - Search query (Apache Lucene query syntax or simply a string to search for)

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<searchEntries>
		<trips>
			<trip>
				<level>0</level>
				<rating>7.17647058823529</rating>
				<tripId>303</tripId>
				<tripEntryId>0</tripEntryId>
				<owner>braco</owner>
				<ownerId>16</ownerId>
				<name>Hiking from Ljubljana to Ankaran</name>
				<desc>The legendary hike from Ljubljana to Ankaran...</desc>
				<altDesc>This is the story of our three day hike from Ljubljana to Ankaran -- three days of sweat, blisters and all-out suffering, ending in one of the most well-deserved beers of our lives. </altDesc>
				<creationDate>1090580660000</creationDate>
				<lastModified>1150284304000</lastModified>
				<countries>
				</countries>
			</trip>
		</trips>
		<tripEntries>
			<tripEntry>
				<level>1</level>
				<rating>0.0</rating>
				<tripId>303</tripId>
				<tripEntryId>4739</tripEntryId>
				<owner>braco</owner>
				<ownerId>16</ownerId>
				<name>The horse whisperer</name>
				<desc>Dragan certainly made some new friends during the trip to Ankaran.</desc>
				<creationDate>1090773728000</creationDate>
				<lastModified>0</lastModified>
				<city>Kastelec</city>
				<continent>Europe</continent>
			</tripEntry>
		</tripEntries>
		<tripEntryElements>
			<tripEntryElement>
				<level>1</level>
				<rating>0.0</rating>
				<tripId>303</tripId>
				<tripEntryId>0</tripEntryId>
				<owner>braco</owner>
				<ownerId>16</ownerId>
				<name></name>
				<desc></desc>
				<creationDate>1090795818000</creationDate>
				<lastModified>0</lastModified>
			</tripEntryElement>
		</tripEntryElements>
	</searchEntries>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed
Statistics

PutMediaItemStats

Updates media item view statistics. Accepts input text file with media filename and view count tuples.

Authentication

This method requires user to be authenticated

Arguments

  • timestamp (required) - View statistics timestamp
  • file (required) - File holding view statistics tuples

Example response

<?xml version="1.0" encoding="utf-8" ?>  <rsp stat="ok">  </rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 105 : Wrong HTTP method
  • 107 : File not found
  • 108 : Authentication failed
Timezones

GetTimezoneFromLocation

Determines to which timezone the specified geographic location belongs to.

Authentication

This method is public

Arguments

  • longitude (required) - The geographic longitude (-180 - +180)
  • latitude (required) - The geographic latitude (90 - -90)

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<timezone>
		<id>41</id>
		<caption>Athens, Bucharest, Helsinki, Istanbul, Kyiv, Riga, Sofia, Tallin</caption>
		<isBorder>false</isBorder>
		<offset>+2:0</offset>
		<dst>true</dst>
	</timezone>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error

GetTimezones

Returns the list of all geographic timezones.

Authentication

This method is public

Arguments

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<timezone>
		<id>11</id>
		<description>Central Time(US &amp; Canada); Guadalajara, Mexico City, Monterray</description>
		<gmtOffset>-6:0</gmtOffset>
		<dst>1</dst>
	</timezone>
	<timezone>
		<id>67</id>
		<description>Beijing, Chongqing, Hong Kong, Urumqi</description>
		<gmtOffset>+8:0</gmtOffset>
		<dst>0</dst>
	</timezone>
	<timezone>
		<id>50</id>
		<description>Moscow, St. Petersburg, Volgograd</description>
		<gmtOffset>+3:0</gmtOffset>
		<dst>1</dst>
	</timezone>
</rsp>  

Error codes

  • 100 : Internal error
  • 104 : Server error
Tracks

GetGpsFormats

Returns a list of GPS track formats supported by TripTracker.

Authentication

This method is public

Arguments

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<format>
		<code>gpx</code>
		<extension>gpx</extension>
		<description>GPS Exchange Format (GPX)</description>
	</format>
	<format>
		<code>kml</code>
		<extension>kml</extension>
		<description>Google Earth (KML)</description>
	</format>
	<format>
		<code>cst</code>
		<extension>cst</extension>
		<description>CarteSurTable data file</description>
	</format>
	<format>
		<code>coastexp</code>
		<extension>xml</extension>
		<description>CoastalExplorer XML</description>
	</format>
	<format>
		<code>emtactrine</code>
		<extension>txt</extension>
		<description>Emtac Trine (text format)</description>
	</format>
</rsp>  

Error codes

  • 100 : Internal error
  • 104 : Server error

UploadTrack

Uploads GPS track or just part of the track and associates it with the specified trip.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip
  • format (required) - The name of the GPS format used
  • file (required) - The actual track file

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 105 : Wrong HTTP method
  • 107 : File not found
  • 108 : Authentication failed
Trips

DeleteTrip

Removes trip from the TripTracker repository, including all of the associated data residing on the filesystem. The operation cannot be undone!

Authentication

This method requires administrative privileges

Arguments

  • tripId (required) - Id of the trip to be removed from the TripTracker repository

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok"></rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GetTrip

Returns information on the specified trip.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<trip>
		<ownerId>4</ownerId>
		<owner>cile</owner>
		<name>Djerba</name>
		<mood>0</mood>
		<distance>40398627</distance>
		<longDesc>Suspendisse vestibulum, massa sit eleifend, tellus lectus consequat dolor, a congue purus ante molestie eros.</longDesc>
		<shortDesc>Trip description in a couple of words.</shortDesc>
		<numComments>2</numComments>
		<rating>4.5</rating>
		<creationDate>1472037709000</creationDate>
		<startTime>1149634703000</startTime>
		<finishTime>1149698809000</finishTime>
		<countries>
			<country>TN</country>
			<country>TZ</country>
		</countries>
	</trip>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GetTripEntryElements

Returns trip entry elements (media items) for the specified trip. Location source returned with the response can be one of the following : none, track, EXIF, Flickr, manual.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<tripEntyElements>
		<tripEntyElement>
			<id>61182</id>
			<tripId>1189</tripId>
			<timezoneId>49</timezoneId>
			<continent>AF</continent>
			<country>TZ</country>
			<city>Zanzibar</city>
			<distance>7008991</distance>
			<featured>1</featured>
			<longitude>39.191580573</longitude>
			<latitude>-6.159470882</latitude>
			<locationSource>track</locationSource>
			<creationDate>1149688009000</creationDate>
			<imageWidth>480</imageWidth>
			<imageHeight>640</imageHeight>
			<rating>2.0</rating>
			<urlOrigImg>http://media.localhost/7/originals/7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlOrigImg>
			<urlWebImg>http://media.localhost/7/cropped/web-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlWebImg>
			<urlThumbImg>http://media.localhost/7/thumbs/thumb-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlThumbImg>
		</tripEntyElement>
		<tripEntyElement>
			<id>61139</id>
			<tripId>1189</tripId>
			<timezoneId>37</timezoneId>
			<continent>AF</continent>
			<country>TN</country>
			<city>Triffa</city>
			<distance>26979</distance>
			<featured>1</featured>
			<longitude>10.991913</longitude>
			<latitude>33.842018</latitude>
			<locationSource>manual</locationSource>
			<creationDate>1124130026000</creationDate>
			<imageWidth>1024</imageWidth>
			<imageHeight>768</imageHeight>
			<rating>3.0</rating>
			<urlOrigImg>http://media.localhost/7/originals/7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlOrigImg>
			<urlWebImg>http://media.localhost/7/cropped/web-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlWebImg>
			<urlThumbImg>http://media.localhost/7/thumbs/thumb-7dbe9fc20a00000c0153d79c6e89fac4.jpg</urlThumbImg>
		</tripEntyElement>
	</tripEntyElements>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

GetTrips

Returns a list of trips based on the specified selection criteria. When presented with guest user account, only public trips will be returned.

Authentication

This method requires user to be authenticated

Arguments

  • tripType (required) - Trip selection criteria. This can be either user, toprated, recent or recommended.
  • maxhits (required) - Upper limit to the number of trips returned

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<trips>
		<trip>
			<id>959</id>
			<name>100 years of Bohinj railway</name>
			<owner>stanesc</owner>
			<ownerId>289</ownerId>
			<rating>4.0</rating>
			<numTripEntries>7</numTripEntries>
			<numMediaItems>22</numMediaItems>
			<numComments>4</numComments>
			<starttime>1151836613000</starttime>
			<longDesc>Put some long description in here.</longDesc>
			<shortDesc>Descrive me in a couple of words.</shortDesc>
		</trip>
		<trip>
			<id>901</id>
			<name>A Trip From Denmark</name>
			<owner>matey</owner>
			<ownerId>147</ownerId>
			<rating>0.0</rating>
			<numTripEntries>20</numTripEntries>
			<numMediaItems>125</numMediaItems>
			<numComments>0</numComments>
			<starttime>1150390219000</starttime>
			<longDesc>It was time for Arijana to come home after her long stay in Denmark as an exchange student. I came from Ljubljana to Denmark by plane and we decided to take a little detour to Netherlands on our way back home by car.</longDesc>
			<shortDesc>Denmark welcomes exchange students.</shortDesc>
		</trip>
	/trips>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

OrganizeTripEntryElements

Automatically reorganizes trip entries and media items, so that they are closely grouped based on distance and time criteria.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

PutMediaItem

Inserts or updates an existing media item. Media item can either be associated with trip or gallery.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip
  • galleryId (required) - The ID of the gallery (alternative ID)
  • timezoneId (required) - The ID of the timezone the media item was acquired in
  • file (required) - The actual media filename

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<mediaItemId>32214</mediaItemId>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 105 : Wrong HTTP method
  • 107 : File not found
  • 108 : Authentication failed

PutLocalMediaItem

Inserts or updates an existing local media item. Media item can either be associated with trip or gallery.

Authentication

This method requires user to be authenticated

Arguments

  • tripId (required) - The ID of the trip
  • galleryId (required) - The ID of the gallery (alternative ID)
  • timezoneId (required) - The ID of the timezone the media item was acquired in
  • file (required) - The actual local media filename

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<mediaItemId>32214</mediaItemId>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 105 : Wrong HTTP method
  • 107 : File not found
  • 108 : Authentication failed

PutTrip

Insert or updates an existing trip.

Authentication

This method requires user to be authenticated

Arguments

  • tripName (required) - The name of the trip
  • description (required) - A description of the trip. Uppon conflict this has precendence over shortor long description
  • shortDescription (optional) - A short description of the trip
  • longDescription (optional) - A long description of the trip

Example response

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
	<tripId>1200</tripId>
</rsp>  

Error codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 108 : Authentication failed

NET LibraryShow all

Rest methods

GetRequiredAppVersion

Returns required application version.

Authentication

This method requires application key.

Arguments

  • (String)appkey(required) - The partner's application key

Example response

Returns a System.Version object.

Code example

...
RestApi service = RestApi.GetRestApi();
System.Version version = service.GetRequiredAppVersion("Application key");
...

Login

Authenticates given user with the TripTracker server. Password is hashed.

Authentication

This method requires application key.

Arguments

  • (String)username (required) - The TripTracker username
  • (String)hashedpassword (required) - The TripTracker SHA-1 hashed password
  • (String)appkey (required) - The partner's application key
  • (String)appname(required) - The partner's application name

Example response

Returns a User object.

Code example

...
RestApi service = RestApi.GetRestApi();
User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");
...

CreateNewTrip

Creates a new trip on the TripTracker server.

Authentication

This method requires authentication (gets it from User property authToken)

Arguments

  • (Trip)trip (required) - The trip
    • Trip name length: max(64)
    • Trip description length: max(10240)
  • (User)user (required) - The TripTracker user

Example response

Does not return an object. Sets the trip ID.

Code example

...
RestApi service = RestApi.GetRestApi();

User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");

Trip newTrip = new Trip();
newTrip.Name = "tripname";
newTrip.Description = "tripdescription";

//pathToUploadPhoto is same as pathToOriginalPhoto if we do not create temporary photo file for uploading
Photo photo = new Photo("pathToOriginalPhoto", "pathToUploadPhoto");

trip.AddItem(photo);

GPSTrack track = new GPSTrack("pathToOriginalTrackFile", "pathToUploadTrackFile", "GPS format");

trip.AddItem(track);

service.CreateNewTrip(newTrip, user);

for(int nI = 0; nI < newTrip.Items.Count; nI ++)
{
	service.UploadItem(newTrip.Items[nI], user);
}

service.FinalizeTrip(newTrip, user);
...

UploadItem

Uploads a new item to the trip

Authentication

This method require authentication (gets it from User property authToken)

Arguments

  • (Trip)trip (required) - The trip
  • (TripItem)item (required) - Trip item
  • (User)user (required) - The TripTracker user

Example response

Does not return an object. Just uploads an item.

Code example

...
RestApi service = RestApi.GetRestApi();

User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");

Trip newTrip = new Trip();
newTrip.Name = "tripname";
newTrip.Description = "tripdescription";

//pathToUploadPhoto is same as pathToOriginalPhoto if we do not create temporary photo file for uploading
Photo photo = new Photo("pathToOriginalPhoto", "pathToUploadPhoto");

trip.AddItem(photo);

GPSTrack track = new GPSTrack("pathToOriginalTrackFile", "pathToUploadTrackFile", "GPS format");

trip.AddItem(track);

service.CreateNewTrip(newTrip, user);

for(int nI = 0; nI < newTrip.Items.Count; nI ++)
{
	service.UploadItem(newTrip.Items[nI], user);
}

service.FinalizeTrip(newTrip, user);
...

GetUserTrips

Returns a list of user trips.

Authentication

This method requires authentication (gets it from User property authToken).

Arguments

  • (User)user(required) - The TripTracker user

Example response

Returns a List<Trip> object.

Code example

...
RestApi service = RestApi.GetRestApi();

User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");

List<Trip> userTrips = service.GetUserTrips(user);
...

GetGPSFormats

Returns a list of GPS formats.

Authentication

This method requires authentication token.

Example response

Returns a List<GPSFormats> object.

Code example

...
RestApi service = RestApi.GetRestApi();
List <GPSFormat> supportedFormats = service.GetGPSFormats();
...

GetUserSpaceInfo

Gets info about user space on server.

Authentication

This method requires authentication token.

Arguments

  • user(required) - The TripTracker user

Example response

Does not return an object. Just sets a QuotaTotal and QuotaUsed property to the User object.

Code example

...
RestApi service = RestApi.GetRestApi();

User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");

service.GetUserSpaceInfo(user);
//Sets a user.QuotaTotal and user.QuotaUsed parameters
...

FinalizeTrip

Finalize trip after upload.

Arguments

  • (Trip)trip(required) - The trip
  • (User)user(required) - The TripTracker user

Example response

Does not return an object. Finalize the trip.

Code example

...
RestApi service = RestApi.GetRestApi();

User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");

Trip newTrip = new Trip();
newTrip.Name = "tripname";
newTrip.Description = "tripdescription";

//pathToUploadPhoto is same as pathToOriginalPhoto if we do not create temporary photo file for uploading
Photo photo = new Photo("pathToOriginalPhoto", "pathToUploadPhoto");

trip.AddItem(photo);

GPSTrack track = new GPSTrack("pathToOriginalTrackFile", "pathToUploadTrackFile", "GPS format");

trip.AddItem(track);

service.CreateNewTrip(newTrip, user);

for(int nI = 0; nI < newTrip.Items.Count; nI ++)
{
	service.UploadItem(newTrip.Items[nI], user);
}

service.FinalizeTrip(newTrip, user);
...

AppendTrack

Appends new track points to the existing GPS track. Appended points must be declared in GPS track file.

Authentication

This method require authentication (gets it from User property authToken)

Arguments

  • (Trip)trip(required) - The trip
  • (String)gpsformatfilepath(required) - Path to the GPS track file which must be in Triptracker supported format.
  • (User)user(required) - The TripTracker user

Example response

Does not return an object. Appends new track points to the trip.

Code example

...
RestApi service = RestApi.GetRestApi();

User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");

List<Trip> userTrips = service.GetUserTrips(user);

Trip tripToUpdate = userTrips[0];

//append track method supports TripTracker format file
service.AppendTrack(tripToUpdate, "pathToTrackFile", user);

service.FinalizeTrip(tripToUpdate, user);
...

GetRestApi

Creates a new instance of RemoteApi object which contains TripTracker rest methods. If instance of RemoteApi object already exists, method returns the existing RemoteApi object.

Example response

Returns RemoteApi object.

Code example

...
RestApi service = RestApi.GetRestApi();
...

SetApplicationIdentifier

Sets the identifier on TripTracker server so that the user can be automatically logged in and redirected to trip page.

Authentication

This method require authentication (gets it from User property authToken)

Arguments

  • (User)user(required) - The TripTracker user

Example response

Does not return an object. Sets the identifier on server.

Code example

...
RestApi service = RestApi.GetRestApi();

User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");

Trip newTrip = new Trip();
newTrip.Name = "tripname";
newTrip.Description = "tripdescription";

//pathToUploadPhoto is same as pathToOriginalPhoto if we do not create temporary photo file for uploading
Photo photo = new Photo("pathToOriginalPhoto", "pathToUploadPhoto");

trip.AddItem(photo);

GPSTrack track = new GPSTrack("pathToOriginalTrackFile", "pathToUploadTrackFile", "GPS format");

trip.AddItem(track);

service.CreateNewTrip(newTrip, user);

for(int nI = 0; nI < newTrip.Items.Count; nI ++)
{
	service.UploadItem(newTrip.Items[nI], user);
}

service.FinalizeTrip(newTrip, user);

service.SetApplicationIdentifier(user);

//navigate to created trip
System.Diagnostics.Process.Start("http://www.triptracker.net/applogin/?id=" + user.AuthToken + "&tripId=" + newTrip.ID);
...

Errors

Possible errors

Codes

  • 100 : Internal error
  • 102 : Required parameter missing
  • 103 : Required parameter bad
  • 104 : Server error
  • 105 : Wrong HTTP method (get or post)
  • 107 : File not found
  • 108 : Authentication failed
Model items

GPSFormat

Represents a GPS Format.

Constructors

  • GPSFormat(string ID, string fileextension, string description)

Properties

  • (String)ID - represents a GPS Format ID
  • (String)FileExtension - represents a GPS Format file extension
  • (String)Description - represents a GPS Format description

GPSTrack

Represents GPS Track. Extended from TripItem.

Constructors

  • GPSTrack(string filepath, GPSFormat gpsformat)
  • GPSTrack(string filepath, GPSFormat gpsformat, long timezoneoffset)

Properties

  • (String)FilePath - represents the file path
  • (GPSFormat)GPSFormat - represents the GPS track format
  • (Long)TimeZoneOffset - represents timezone offset in seconds
  • (String)OrigFileName - represents the original file name

Photo

Represents a photo. Extended from TripItem.

Constructors

  • Photo(string filepath)
  • Photo(string filepath, DateTime timetaken)

Properties

  • (DateTime)TimeTaken - represents the time photo was taken
  • (String)FilePath - represents the temporary file path
  • (String)OrigFileName - represents the original file name

Trip

Represents a Trip

Constructors

  • Trip()

Methods

  • AddItem(TripItem item) - adds TripItem to the trip
  • ToString() - returns a String that represents the current Object name

Properties

  • (List<TripItem>)Items - represents the list of items
  • (Boolean)NewTrip - if new, boolean value is true, else the value is false
  • (Integer)ID - trip ID
  • (String)Name - trip name
  • (String)Description - trip description
  • (Long)Size - the trip items size in bytes

TripItem

Represents an abstract object Trip Item

Constructors

  • TripItem (string filepath)

Properties

  • (String)FilePath - represents the file path
  • (String)OrigFileName - represents the original file name

User

Represents a User.

Constructors

  • User(string name, string authToken, string profileID, long quotaTotal, long quotaUsed)

Properties

  • (String)AuthToken - represents authorization token
  • (String)ProfileID - represents profile ID
  • (String)Name - represents user name
  • (List<Trip>)Trips - represents the list of user trips
  • (Long)QuotaTotal - represents the total user space on server in bytes
  • (Long)QuotaUsed - represents the used user space on server in bytes

Settings

Represents a RestURL, TimeOut and TripURL properties.

Properties

  • (String)RestURL - rest URL
  • (int)TimeOut - time out
  • (String)TripURL - trip URL

Utils

Directory of methods

Methods

  • GetSHA(string password) - returns the encrypted user password (required for login authentication method)

Get your API key

Fill in the following form to recieve API KEY. Once your request is processed, we will get back to you.