Open ghost opened 9 years ago
I strongly second this request. The API documentation is incomplete and in the current form not usable.
As example, I dump the get_lodging() request and save the raw XML returned by the API. Feeding the exact same XML back into the API to update a lodging object, returns:
401: invalid signature
Which, as I understand, has something to do with the way the XML is written. One example I figured out: in the XML returned by the API, the "id" is near the beginning of the XML, the "trip_id" is near the end. However when the update request is formed, the "trip_id" must be right after the "id". Now I'm just missing the correct order of a few dozen more fields ...
If you look into the XSD file, you can find that xs:complexType name="Object" shows "id" and then "trip_id", and then the other fields. https://api.tripit.com/xsd/tripit-api-obj-v1.xsd But having an XSD file is all about not having a specific element order in your XML, something which the TripIt API seems to enfore - but the correct order is not documented, and there are literally no examples available.
Question to TripIt: How do you build a valid Lodging (or for that matter: any other object) and update the object using your API? Including all possible fields, and everything?
Thanks, Andreas
I'm going to add my name to the list of people that are requesting better API documentation. I was able to use @andreasscherbaum's idea of exploring the XSD and assuming the same order to make my update job work - but without him mentioning that, I would have never gotten there.
I had a look at the API available at http://tripit.github.io/api/ however it doesn't provide me with the level of detail i was hoping it would. This is because i need to document the construct of each object for the purposes of a requirements specification before developing a client to consume the service. The clients in this instance are iOS and Android applications.
For example, if i need to see the constructs of the hotel object, e.g. BookingDate, SupplierName, etc, where would i be able to find all the constructs as well as human-readable and understandable descriptions e.g. BookingDate refers to the date the user made a booking.
So i would imagine for every object, i would have a table like specification i could put together
Object: Hotel Construct Description BookingDate Date the user made a booking SupplierName Name of the hotel
I would appreciate any help.
Thanks.
Igor