| Members: 230 |
|
Group categories:
|
| More group info » |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
|
| Dec 21 |
TripIt API Documentation - v1Index
OverviewThe TripIt API allows a developer to programatically create, delete, and retrieve objects from the TripIt platform. The v1 API supports all of the object types that the TripIt platform is currently capable of managing. The list of object types is as follows:
In addition to being capable of directly creating, deleting, and retrieving these objects the API can retrieve lists of objects such as all of a user's upcoming trips or all travel objects contained within a specific trip. For status on maintenance windows and operational issues related to the API please go to our status blog at status.tripit.com. AuthenticationWeb AuthenticationThe TripIt API offers a very simple way of authenticating the API that should only be used for testing and development purposes. When building an application you should ultimately use the OAuth authentication scheme for allowing TripIt users to grant access to their data for your application. Note that this authentication scheme is off by default for every TripIt user. If you want to have this turned on for your account so you can use it for development purposes please send email to support@tripit.com. Enabling Basic Authentication for an account does not disable OAuth authentication for that same account. The web authentication scheme relies on HTTP's authentication RFC to authenticate clients of the TripIt API using a TripIt username (i.e. email address) and password. This authentication scheme may be limited or turned off by default in future versions of the TripIt platform and therefore should not be relied upon for production application development. It is a very simple and useful way to get started with the API. To make a web authenticated request of the API simply add the following HTTP header into the request:
Authorization: Basic <base64 encoded token> Where <token> is a base64 encoded string that includes the TripIt user's email address and password separated by a colon (i.e. example@example.com:secretpassword). Here is an example: TripIt user example@example.com has a password of secretpassword. A client trying to authenticate with the API as this user would send the following HTTP Authorization header with each request: Authorization: Basic ZGVubWFya0B0cmlwaXQuY29tOnNlY3JldHBhc3N3b3Jk The API does not manage sessions so it is required that a client send the user's credentials on every request. Web Authentication ExampleHere is a simple example of how you might use curl to query the API via the web authentication scheme:
$ curl -k -D /dev/tty --user <username>:<password> https://api.tripit.com/v1/list/trip
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Wed, 03 Dec 2008 21:55:59 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
<Response>
<Trip>
<id>770827</id>
<start_date>2008-12-17</start_date>
<end_date>2008-12-27</end_date>
<display_name>New York, NY, December 2008</display_name>
<image_url>/images/places/general.jpg</image_url>
<is_private>false</is_private>
<is_traveler>true</is_traveler>
<primary_location>New York, NY</primary_location>
</Trip>
</Response>
$
OAuthReferencesFor more information about the OAuth specification the following references are useful:
It is beyond the scope of this document to describe the fundamental concepts of the OAuth specification. It is recommended that anyone trying to implement an OAuth Consumer of the TripIt API should be familiar with the documentation listed in the 'References' section as the rest of the documentation is written assuming the reader understands OAuth terminology and concepts. The following 4 steps is heavily modeled on the OAuth 1.0 specification document itself. The similarities are not a coincidence and each step tracks back to the relevant section in the spec so the reader can more easily follow along. Consumer Storage RequirementsDuring the following steps you will need to store data from the consumer and associate it with the user account in the consumer. Here's a summary of what the consumer needs to store, when it needs to store it, and for how long.
Step 1: Obtaining a Request Token (Section 6.1)To obtain a request token POST the following request parameters to the URL: https://api.tripit.com/oauth/request_token
The server will respond with the following in the response body: oauth_token=7d41de0eaf0d518786851a64bf7505e29177b75e&oauth_token_secret=2e8c29e961d02a1aa61b916c908c90200fcdef7eThese are the unauthorized access token and secret that will be needed to obtain user authorization in step 2. The Consumer should store both values for future use. Step 2: Obtain User Authorization (Section: 6.2)Using the unauthorized access token obtained in step 1 the Consumer application should redirect the user to the following page: https://www.tripit.com/oauth/authorize?oauth_token=<oauth_token>&oauth_callback=<oauth_callback>Alternatively, if you are trying to authorize on a mobile app such as an iPhone, direct the user to here: https://m.tripit.com/oauth/authorize?oauth_token=<oauth_token>&oauth_callback=<oauth_callback>The two request parameters have the following meaning: NOTE: It is extremely important that you clearly redirect the user to the TripIt URL so they have confidence that they aren't being phished for their TripIt username and password. This means you should make sure on a regular browser that the frame you use to redirect the user has the address bar of the frame clearly visible. On a mobile device such as an iPhone you should launch Safari and not use the embedded WebView class.
If the user is able to successfully log in to TripIt and chooses to grant authority to the Consumer application (or not), the user is redirected back to the oauth_callback or default URL with a single request parameter: oauth_token. At this point the Consumer does not know whether or not the oauth_token has been successfully authorized. To find out, the Consumer must implement step 3. Step 3: Obtaining an Access Token (Section 6.3)To obtain an authorized access token, POST the following request parameters to the URL: https://api.tripit.com/oauth/access_token
The server will respond with the following in the response body: oauth_token=c174450a65d9d5e72de2910fed22fb8879fb1439&oauth_token_secret=1d1291e53cf3f9e89c377109f0ccee244a95d273These are the authorized access token and secret that will be needed to make future API requests on behalf of the user that authorized them. The Consumer should store both values until the user asks for the Consumer to forget about them either directly or indirectly (e.g. the user delete's their account with the Consumer application). Step 4: Accessing Protected Resources (Section: 7)Once the Consumer has obtained an authorized access token from the service provider it can now make requests of the API on behalf of the user that authorized the acccess token. To make an OAuth authenticated request send the following parameters in the Authorization header of the request: Authorization: OAuth realm="https://api.tripit.com/",
oauth_consumer_key="consumer public key",
oauth_token="authorized access token",
oauth_signature_method="HMAC-SHA1",
oauth_signature="request signature",
oauth_timestamp="1229622199",
oauth_nonce="9b308304f41a4ac04fb4c4ce980c5277",
oauth_version="1.0"
The parameters in the Authorization header are defined as follows:
All other aspects of a successfully authenticated OAuth request are identical to a web authenticated request except that the authorized access token may grant the consumer less permission to read, create, and modify data than a web authenticated request which has the exact same permissions a user has when logged in to TripIt via the web. EncodingThe TripIt API expects all data to be encoded in UTF-8. Similarly, all data out of the API will be encoded in UTF-8. All data POSTed to the API must also be URL encoded. Resource URLsThere are currently four types of requests supported by the API (get, list, create, and delete). Each is explained below in greater detail. Common Query ParametersThere is one common query parameter: 'format'. It can be set to 'xml' or 'json' depending on what format the Request/Response objects are in. Note: If 'format' is not specified, 'xml' is assumed as the default. Even thought the default format is XML, we recommend JSON over XML. Using the JSON format will reduce the size of the response data by a large factor: 50% or more. Adding "Accept-Encoding: gzip" to the HTTP request headers will also reduce the size of the response by a large factor. Finally, please add an appropriate "User-agent" to the request headers with the name and version of your application. getA get request is used to retrieve a specific object from the TripIt API given its TripIt object ID. Since get requests do not change data they are all made via an HTTP GET request for a URL that takes the following form:
https://api.tripit.com/v1/get/<object type>/id/<TripIt Object ID> <object type> is one of the following strings:
<TripIt Object ID> is the object ID of the TripIt object being requested. The get request for a trip object can take an optional filter parameter called include_objects. The default value for this parameter is false but if it is set to true then the response from the API will include all objects (e.g. air, car, lodging, etc...) that are associated with that trip. This enables an API client to request a trip and all of its associated objects in a single call. Example:Here is a sample get request for a Note object:
$ curl -k -D /dev/tty --user <username>:<password> https://api.tripit.com/v1/get/note/id/586853
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Wed, 03 Dec 2008 23:05:30 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
<Response>
<NoteObject>
<id>586853</id>
<display_name>Note</display_name>
<DateTime>
<date>2008-12-09</date>
<time>14:00:00</time>
<timezone>America/Los_Angeles</timezone>
<utc_offset>-8:00</utc_offset>
</DateTime>
<Address>
<addr1>444 DeHaro St.</addr1>
<city>San Francisco</city>
<state>CA</state>
<zip>94107</zip>
<country>US</country>
<latitude>37.764169</latitude>
<longitude>-122.402021</longitude>
</Address>
<text>Test note.</text>
<url>http://www.tripit.com/</url>
</NoteObject>
</Response>
$
Here is another example using the include_objects filter parameter set to true. Notice how you get the <Trip> plus the <AirObject>, and <WeatherObject> sections that are associated with the trip.
$ curl -D /dev/tty --user <username>:<password> 'https://api.tripit.com/v1/get/trip/id/2785341/include_objects/true'
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 03 Nov 2009 00:31:35 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Cache-Control: private
<Response>
<timestamp>1257208295</timestamp>
<num_bytes>4630</num_bytes>
<Trip>
<TripInvitees>
<Invitee profile_ref="VPNrwg9_2vW2j3DHX_pAzA">
<is_read_only>false</is_read_only>
<is_traveler>true</is_traveler>
</Invitee>
</TripInvitees>
<id>2785341</id>
<relative_url>/trip/show/id/2785341</relative_url>
<start_date>2009-10-04</start_date>
<end_date>2009-11-23</end_date>
<display_name>Vienna, Austria, October 2009</display_name>
<image_url>http://www.tripit.com/images/places/general.jpg</image_url>
<is_private>true</is_private>
<primary_location>Vienna, Austria</primary_location>
</Trip>
<AirObject>
<id>4042627</id>
<trip_id>2785341</trip_id>
<is_client_traveler>true</is_client_traveler>
<relative_url>/reservation/show/id/4042627</relative_url>
<display_name>Your Flight</display_name>
<is_purchased>true</is_purchased>
<Segment>
<Status>
<EstimatedDepartureDateTime>
<date>2009-11-09</date>
<time>13:45:00</time>
<timezone>America/Los_Angeles</timezone>
<utc_offset>-08:00</utc_offset>
</EstimatedDepartureDateTime>
<EstimatedArrivalDateTime>
<date>2009-11-09</date>
<time>14:45:00</time>
<timezone>America/Chicago</timezone>
<utc_offset>-06:00</utc_offset>
</EstimatedArrivalDateTime>
<flight_status>401</flight_status>
<is_connection_at_risk>false</is_connection_at_risk>
<last_modified>1256770662</last_modified>
</Status>
<StartDateTime>
<date>2009-11-09</date>
<time>13:00:00</time>
<timezone>America/Los_Angeles</timezone>
<utc_offset>-08:00</utc_offset>
</StartDateTime>
<EndDateTime>
<date>2009-11-09</date>
<time>14:00:00</time>
<timezone>America/Chicago</timezone>
<utc_offset>-06:00</utc_offset>
</EndDateTime>
<start_airport_code>SFO</start_airport_code>
<start_airport_latitude>37.618889</start_airport_latitude>
<start_airport_longitude>-122.375</start_airport_longitude>
<start_city_name>San Francisco</start_city_name>
<end_airport_code>ORD</end_airport_code>
<end_airport_latitude>41.978056</end_airport_latitude>
<end_airport_longitude>-87.906111</end_airport_longitude>
<end_city_name>Chicago</end_city_name>
<marketing_airline>Other</marketing_airline>
<marketing_flight_number>1234</marketing_flight_number>
<alternate_flights_url>/trip_item/flightSearch/id/19691175/airline_code/UA</alternate_flights_url>
</Segment>
</AirObject>
<WeatherObject>
<id>19720471</id>
<trip_id>2785341</trip_id>
<is_client_traveler>true</is_client_traveler>
<relative_url>/trip_item/show/id/19720471</relative_url>
<display_name>Weather - Chicago, IL</display_name>
<date>2009-11-23</date>
<location>Chicago, IL</location>
<avg_high_temp_c>8.8888888888889</avg_high_temp_c>
<avg_low_temp_c>2.7777777777778</avg_low_temp_c>
<avg_wind_speed_kn>13</avg_wind_speed_kn>
</WeatherObject>
<Profile ref="VPNrwg9_2vW2j3DHX_pAzA">
<is_client>true</is_client>
<is_pro>true</is_pro>
<screen_name>denmark</screen_name>
<public_display_name>Andy Denmark</public_display_name>
<profile_url>people/denmark</profile_url>
<home_city>San Francisco, CA</home_city>
<photo_url>http://static.tripit.com/uploads/images/9/7/3/97319d8fb7045feb31172d9d7a6481f4608.jpg</photo_url>
<activity_feed_url>http://www.tripit.com/feed/activities/private/24562ADE-7DF3452DABC4E7D7FF372C1ACC/activities.atom</activity_feed_url>
<alerts_feed_url>http://www.tripit.com/feed/alerts/private/962356AA5-F101FC24E1C124532ACDE28C356AFB0/alerts.atom</alerts_feed_url>
<ical_url>webcal://www.tripit.com/feed/ical/private/96333224-33BA6E42F4ABCDDEFG12347E5EDA66/tripit.ics</ical_url>
</Profile>
</Response>
$
listA list request is used to retrieve multiple objects given an object type and set of filter parameters. Since list requests do not change data they are all made via an HTTP GET request for a URL that takes the following form:
https://api.tripit.com/v1/list/<object type>/<filter parameter>/<filter value> <object type> is one of the following strings:
Valid values for <filter parameter> and <filter value> depend on the <object type>. The following table describes the valid combinations:
Example:Here is a sample list request for a Trip object: $ curl -k -D /dev/tty --user <username>:<password> https://api.tripit.com/v1/list/trip
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Wed, 03 Dec 2008 23:10:45 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
<Response>
<Trip>
<id>770827</id>
<start_date>2008-12-17</start_date>
<end_date>2008-12-27</end_date>
<display_name>New York, NY, December 2008</display_name>
<image_url>/images/places/general.jpg</image_url>
<is_private>false</is_private>
<is_traveler>true</is_traveler>
<primary_location>New York, NY</primary_location>
</Trip>
<Trip>
<id>770828</id>
<start_date>2009-01-17</start_date>
<end_date>2009-01-27</end_date>
<display_name>Paris, France, January 2009</display_name>
<image_url>/images/places/general.jpg</image_url>
<is_private>false</is_private>
<is_traveler>true</is_traveler>
<primary_location>Paris, France</primary_location>
</Trip>
</Response>
$
Another example in which we're requesting all objects within Trip #115 that are of type air. $ curl -k -D /dev/tty --user <username>:<password> https://api.tripit.com/v1/list/object/trip_id/115/type/air
HTTP/1.1 200 OK
Server: nginx/0.6.35
Date: Thu, 07 May 2009 22:00:08 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Cache-Control: private
<Response>
<timestamp>1241733608</timestamp>
<AirObject>
<id>319</id>
<trip_id>115</trip_id>
<is_traveler>true</is_traveler>
<relative_url>/reservation/show/id/319</relative_url>
<display_name>Your Flight</display_name>
<is_purchased>true</is_purchased>
<Segment>
<StartDateTime>
<date>2009-05-27</date>
<time>06:15:00</time>
<timezone>America/Los_Angeles</timezone>
<utc_offset>-07:00</utc_offset>
</StartDateTime>
<EndDateTime>
<date>2009-05-27</date>
<time>08:20:00</time>
<timezone>America/Los_Angeles</timezone>
<utc_offset>-07:00</utc_offset>
</EndDateTime>
<start_airport_code>SFO</start_airport_code>
<start_city_name>San Francisco</start_city_name>
<end_airport_code>SEA</end_airport_code>
<end_city_name>Seattle</end_city_name>
<marketing_airline>United Airlines</marketing_airline>
<marketing_airline_code>UA</marketing_airline_code>
<marketing_flight_number>24</marketing_flight_number>
<aircraft>319</aircraft>
<distance>677 miles</distance>
<duration>2h, 05m</duration>
<stops>nonstop</stops>
</Segment>
</AirObject>
</Response>
$
createA create request is used to create new objects. To create objects, make an HTTP POST request to the following URL:
https://api.tripit.com/v1/create The client must POST a single Request object as the value of the request parameter xml in the POST body of the request. Example:Here is a sample create request for a Trip object: Here is what the post data would look like for a Trip creation: $ cat /var/tmp/trip.xml
xml=<Request>
<Trip>
<start_date>2008-12-09</start_date>
<end_date>2008-12-27</end_date>
<primary_location>New York, NY</primary_location>
</Trip>
</Request>
$
Here is a sample create request for a Trip object: $ curl -k -D /dev/tty -d@/var/tmp/trip.xml --user <username>:<password> https://api.tripit.com/v1/create
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Fri, 05 Dec 2008 22:12:35 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
<Response>
<Trip>
<id>770846</id>
<start_date>2008-12-09</start_date>
<end_date>2008-12-27</end_date>
<display_name>New York, NY, December 2008</display_name>
<image_url>/images/places/general.jpg</image_url>
<is_private>false</is_private>
<is_traveler>true</is_traveler>
<primary_location>New York, NY</primary_location>
</Trip>
</Response>
$
Here is a sample create request for a Air object: Here is what the post data would look like for a Air object creation: $ cat /var/tmp/air.xml
xml=<Request>
<AirObject>
<is_client_traveler>true</is_client_traveler>
<booking_site_name>United Airlines</booking_site_name>
<booking_site_phone>1-800-United-1</booking_site_phone>
<booking_site_url>http://www.united.com/</booking_site_url>
<supplier_conf_num>ABC123</supplier_conf_num>
<Segment>
<StartDateTime>
<date>2009-09-04</date>
<time>15:04:00</time>
</StartDateTime>
<EndDateTime>
<date>2009-09-04</date>
<time>17:47:00</time>
</EndDateTime>
<start_city_name>Chicago</start_city_name>
<end_city_name>San Francisco</end_city_name>
<marketing_airline>UA</marketing_airline>
<marketing_flight_number>137</marketing_flight_number>
<seats>23J</seats>
</Segment>
<Segment>
<StartDateTime>
<date>2009-09-08</date>
<time>16:32:00</time>
</StartDateTime>
<EndDateTime>
<date>2009-09-08</date>
<time>22:42:00</time>
</EndDateTime>
<start_city_name>San Francisco</start_city_name>
<end_city_name>Chicago</end_city_name>
<marketing_airline>UA</marketing_airline>
<marketing_flight_number>39</marketing_flight_number>
<seats>19B</seats>
</Segment>
<Traveler>
<first_name>John</first_name>
<last_name>Doe</last_name>
<frequent_traveler_num>1234567890</frequent_traveler_num>
</Traveler>
</AirObject>
</Request>
$
Here is a sample create request for a Air object: $ curl -k -D /dev/tty -d@/var/tmp/air.xml --user <username>:<password> https://api.tripit.com/v1/create
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 31 Aug 2009 23:51:39 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Cache-Control: private
<Response>
<timestamp>1251762699</timestamp>
<num_bytes>2470</num_bytes>
<AirObject>
<id>1413</id>
<trip_id>426</trip_id>
<is_client_traveler>true</is_client_traveler>
<relative_url>/reservation/show/id/1413</relative_url>
<display_name>Your Flight</display_name>
<booking_site_name>United Airlines</booking_site_name>
<booking_site_phone>1-800-United-1</booking_site_phone>
<booking_site_url>http://www.united.com/</booking_site_url>
<supplier_conf_num>ABC123</supplier_conf_num>
<is_purchased>true</is_purchased>
<Segment>
<Status>
<flight_status>200</flight_status>
<last_modified>1251762699</last_modified>
</Status>
<StartDateTime>
<date>2009-09-04</date>
<time>15:04:00</time>
<timezone>America/Chicago</timezone>
<utc_offset>-05:00</utc_offset>
</StartDateTime>
<EndDateTime>
<date>2009-09-04</date>
<time>17:47:00</time>
<timezone>America/Los_Angeles</timezone>
<utc_offset>-07:00</utc_offset>
</EndDateTime>
<start_airport_code>ORD</start_airport_code>
<start_city_name>Chicago</start_city_name>
<end_airport_code>SFO</end_airport_code>
<end_city_name>San Francisco</end_city_name>
<marketing_airline>United Airlines</marketing_airline>
<marketing_airline_code>UA</marketing_airline_code>
<marketing_flight_number>137</marketing_flight_number>
<aircraft>763</aircraft>
<aircraft_display_name>Boeing 767-300</aircraft_display_name>
<distance>1841 miles</distance>
<duration>4h, 43m</duration>
<seats>23J</seats>
<stops>nonstop</stops>
</Segment>
<Segment>
<Status>
<flight_status>200</flight_status>
<last_modified>1251762699</last_modified>
</Status>
<StartDateTime>
<date>2009-09-08</date>
<time>16:32:00</time>
<timezone>America/Los_Angeles</timezone>
<utc_offset>-07:00</utc_offset>
</StartDateTime>
<EndDateTime>
<date>2009-09-08</date>
<time>22:42:00</time>
<timezone>America/Chicago</timezone>
<utc_offset>-05:00</utc_offset>
</EndDateTime>
<start_airport_code>SFO</start_airport_code>
<start_city_name>San Francisco</start_city_name>
<end_airport_code>ORD</end_airport_code>
<end_city_name>Chicago</end_city_name>
<marketing_airline>United Airlines</marketing_airline>
<marketing_airline_code>UA</marketing_airline_code>
<marketing_flight_number>39</marketing_flight_number>
<aircraft>319</aircraft>
<aircraft_display_name>Airbus A319</aircraft_display_name>
<distance>1841 miles</distance>
<duration>4h, 10m</duration>
<seats>19B</seats>
<stops>nonstop</stops>
</Segment>
<Traveler>
<first_name>John</first_name>
<last_name>Doe</last_name>
<frequent_traveler_num>1234567890</frequent_traveler_num>
</Traveler>
</AirObject>
</Response>
$
Note the following about the response objects:
deleteA delete request is used to delete existing objects. To delete an object, make an HTTP GET request to the following URL:
https://api.tripit.com/v1/delete/<object type>/id/<TripIt Object ID> <object type> is one of the following strings:
<TripIt Object ID> is the object ID of the TripIt object being requested. Example:Here is a sample delete request for a Trip object:
$ curl -k -D /dev/tty --user <username>:<password> https://api.tripit.com/v1/delete/trip/id/770829 HTTP/1.1 200 OK Server: nginx/0.6.32 Date: Thu, 04 Dec 2008 04:49:08 GMT Content-Type: text/xml; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache $ HTTP Status CodesThe API will return the following HTTP Status Codes:
Request/Response ObjectsThere are two types of documents used to communicate with the API. A Request document is used when the client is asking something of the API (e.g. create a new object, get me a list of Trip objects, etc...). A Response document is what the API will send back to the client with an answer to the Request. The XML Schema that describe valid Request and Response documents may be found here:
These schemas completely describe all of the valid XML documents that can be posted to and received from the API. Request ObjectUsed for create operations, a Request object wraps one travel object in the xml parameter of an HTTP POST. Please note that a Request object may contain no more than one travel object. If a travel object contains a trip_id then the object will be placed in the trip with the matching id. If a travel object does not contain a trip_id and the TripIt user has their 'auto-import' account preference set to 'On', the travel object will be inserted into the trip in the user's account that it overlaps with in time. If the travel object does not overlap with any trips, and the 'auto-import' feature is turned 'Off' then the it will be placed under 'Unfiled items'. Response ObjectA Response object is used to wrap one or more travel objects as well as one or more Warning and/or Error objects in a response from either a get, create, or delete request. When creating a new object the response will contain the travel object you sent in plus the object IDs that they are now associated with that object. A client can use this ID in subsequent get operations. Warning ObjectThe presence of a Warning in a Response object means that the TripIt API was able to complete the request successfully but the API detected something about the data in the Request object that may produce unintended consequences. An example of a condition that would produce a Warning is if the Request object contained a check-in date for a LodgingObject that was after the check-out date for that LodgingObject. TBD - document more of these Error ObjectThe presence of an Error in a Response object means that the TripIt API was not able to persist the object in question in the Request. The entire request transaction will be failed. TBD - document examples of these Pro DataAny TripIt API client that is authorized to request data from the API on behalf of a TripIt user that happens to be a TripIt Pro subscriber will automatically receive Pro data in the <Response> objects. The Pro data that is currently available in the API is limited to the following:
Each one of these is discussed in more detail below. AirObject :: AirSegment :: FlightStatusThe FlightStatus object is defined here in the object XSD here: tripit-api-obj-v1.xsd. Here's a definition of all of the properties within the FlightStatus object:
There is one more property called flight_status that is a new object type that can have one of the following values:
AirObject :: AirSegment :: alternate_flights_urlThe alternate flights URL is a relative URL that a client application can use to provide alternate flight information for a specific AirSegment object. The URL can be used to reference the alternate flight information on both http://www.tripit.com/ and http://m.tripit.com/. Deprecation PolicyThis document describes the v1 version of the TripIt API. The v1 API may be continually updated in backwards-compatible ways that won't break v1 compliant clients. Backwards compatible means that the additions to the v1 API should not break a properly written v1 client. The types of changes that may be introduce include the addition of new methods, new object properties, and new travel objects. The types of changes that would not be possible in the v1 API would include things such as the changing of object names, object properties, or the removal of methods. The v1 API will continue to be supported until the v2 API is released and has been available in production for some period of time. After the v2 API becomes available, the v1 API will be considered deprecated and all v1 clients should migrate to use the v2 API. Within a reasonable period of time after being deprecated, TripIt may decide it's necessary to turn off the v1 API after which point v1 clients will cease to function. Any changes or deadlines for deprecation will be announced at the TripIt API Google group. Release NotesThis section covers all outstanding known issues and/or known gotchas that aren't more appropriately described elsewhere.
ExamplesTBD - we're going to include links to Hello, World type applications here
ID: $Id: index.html 19883 2009-11-03 20:16:26Z denmark $
Last Modified: $LastChangedDate: 2009-11-03 12:16:26 -0800 (Tue, 03 Nov 2009) $ Copyright 2006-2009, TripIt, Inc.
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |