Get Yelp API via Oauth in Unity- signature help needed

My cs file’s can found on the scripting forum- http://forum.unity3d.com/threads/yelp-oauth-and-unity-c-2015.364816/

Yelp still uses OAuth 1.0 for authenticating - https://www.yelp.com/developers/api_console. I’ve taken a stab at utilizing the yelp API to pull information into a simple test I’m conducting. A search for food and city and pull in the JSON information. There’s virtually no information on this process except for an attempt in 2013 by Steve Yaus - https://stevenyau.wordpress.com/2013/08/29/accessing-the-yelp-api-with-oauth-within-unity/
Which utilizes an OauthBase.cs script to assist with key, and token signature generation. The problem is that the OauthBase group repository isn’t properly maintained anymore -Google Code Archive - Long-term storage for Google Code Project Hosting..

Anyway, I went ahead and updated the original script to reflect what all the contributors indicated as bugs along with replacing the HTTP stuff with WWW class. To my knowledge this is the most up to date OauthBase script.:slight_smile:

Yelp has C# sample code - https://www.yelp.com/developers/documentation/v2/examples but the libraray references are .NET compatible and not compatible with Unity ( SimpleOauth.net in addition to newtonsoft.JSON.net - Can’t find a single DLL or nuget package to come into Monodevelop)

Anyway, I feel that I’m razor thin of getting it to work but I’m getting the follow Error - “INVALID_SIGNATURE”, “description”: “Invalid signature. Expected signature base string: GET\u…”

It’s clearly an issue with the the generation method, just can’t figure it out/troubleshoot it. I would definitely appreciate some feedback, and please feel free to try it out yourself. Just bring the scripts into your project, slap the “Yelp_BasicSearch.cs” script to any gameobject in your scene, and run the scene. It’ll print out results in the console and as a text file on your desktop . You may need to do a quick Yelp Dev signup to get keys/tokens to test it- https://www.yelp.com/developers/api_console

P.S. - Found this unrelated Oauth example with fitbit and unity in unityscript though - Things for the Games Industry: Fitbit, OAuth2, Unity and a Month of Cursing.

Nevermind- Figured it out

Thanks for the link to my blog :slight_smile:
I’ve been checking to make sure that I update around the web where I have posted an answer to the OAuth/Unity question.

Anyways, I’m here to also pass on a way to do it without the use of an asset from the Asset store or the use of a Webview (mainly because Fitbit, which that other post was written for, changed their Terms and can no longer allow Webviews.).

The new post can be found at
http://technicalartistry.blogspot.ca/2016/01/fitbit-unity-oauth-2-and-native.html

This covers the creation and “basic” use of an Android plugin that will grab the Access Token generated in OAuth 2 and then pass to Unity.

Hope it helps :slight_smile: