Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Radu Albastroiu17,498 Points
Hi, yelp api doesn't use Oauth for authentication anymore. How should I authenticate my app ?
Since march 2018 Yelp doesn't use Oauth for authentication. They say it is easier now but i'm kind of lost. How should I authenticate now?
Pasan PremaratneTreehouse Teacher
I'm working on refreshing this course at the moment because of the API change. With the updates to Yelp Fusion API< you don't need to authorize yourself anymore. Once you get the API key all you have to do is sign each request with the api key by including a Authorization header.
Here's an example. Try this out and let me know if you have any follow up questions
let apiKey = "your_api_key" var url = URL(string: "https://api.yelp.com/v3/businesses/search?term=delis&latitude=37.786882&longitude=-122.399972")! var request = URLRequest(url: url) request.addValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")