TripTracker API
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 APIShow all
AddUser
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
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
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
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
Login
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
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
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
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
DeleteGallery
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
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
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
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
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
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
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
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
GeoLookupCircle
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
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
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
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
GetRequiredAPIVersion
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
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
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
PutMediaItemStats
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
GetTimezoneFromLocation
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
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 & 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
GetGpsFormats
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
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
DeleteTrip
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
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
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
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
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
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
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
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
GetRequiredAppVersion
Authentication
This method requires application key.Arguments
- (String)appkey(required) - The partner's application key
Example response
Code example
...
RestApi service = RestApi.GetRestApi();
System.Version version = service.GetRequiredAppVersion("Application key");
...
Login
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
Code example
...
RestApi service = RestApi.GetRestApi();
User user = service.Login("username", Utils.GetSHA("password"), "Application key", "Application name");
...
CreateNewTrip
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
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
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
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
Authentication
This method requires authentication (gets it from User property authToken).Arguments
- (User)user(required) - The TripTracker user
Example response
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
Authentication
This method requires authentication token.Example response
Code example
... RestApi service = RestApi.GetRestApi(); List <GPSFormat> supportedFormats = service.GetGPSFormats(); ...
GetUserSpaceInfo
Authentication
This method requires authentication token.Arguments
- user(required) - The TripTracker user
Example response
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
Arguments
- (Trip)trip(required) - The trip
- (User)user(required) - The TripTracker user
Example response
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
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
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
Example response
Code example
... RestApi service = RestApi.GetRestApi(); ...
SetApplicationIdentifier
Authentication
This method require authentication (gets it from User property authToken)Arguments
- (User)user(required) - The TripTracker user
Example response
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
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
GPSFormat
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
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
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
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
Constructors
- TripItem (string filepath)
Properties
- (String)FilePath - represents the file path
- (String)OrigFileName - represents the original file name
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
Properties
- (String)RestURL - rest URL
- (int)TimeOut - time out
- (String)TripURL - trip URL
Utils
Methods
- GetSHA(string password) - returns the encrypted user password (required for login authentication method)
Get your API key