Rawan
Rawan

Reputation: 1639

How to integrate TripAdvisor with IOS APP?

In my app i need to integrate it with TripAdvisor API. i searched a lot about it, i found this in there website: https://developer-tripadvisor.com/content-api/ it's actually un useful!. I didn't find any example or demo for this integration! Anyone knows how to integrate with TripAdvisor in IOS? Or have any example about it? thanks

Upvotes: 0

Views: 2084

Answers (1)

brimstone
brimstone

Reputation: 3400

Well, just like most APIs, you first have to get your API key from TripAdvisor. So go to the Request API Access form and fill that out (You have to sign up for Trip Advisor first, or sign in with a Facebook or Google account). They will then contact you with your API key and info.

Now that you have the key, the more interesting part takes place. You can use the app in HTTP requests in your app (Example Here) with the URL of the request you want to make. For example, if I wanted to get results for hotels with my coordinates, I would use this URL:

http://api.tripadvisor.com/api/partner/2.0/map/42.33141,-71.099396/hotels?key=<YOUR KEY HERE>

The response would be some JSON code which you can parse with Swift's built-in JSON parser, NSJSONSerialization. With this data, you can now store and make use of what you needed from their API.

To see the full API documentation of all the requests you can do and their details, just visit the TripAdvisor API Documentation.

Hope this helps,

Gabriel

Upvotes: 1

Related Questions