Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by OJ3D · Oct 30, 2015 at 03:09 AM · c#jsonapi

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 -https://code.google.com/p/oauth/.

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.:)

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 - http://technicalartistry.blogspot.be/2015/07/oauth2-unity-and-month-of-cursing.html?m=1

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by OJ3D · Nov 13, 2015 at 05:50 PM

Nevermind- Figured it out

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by TEvashkevich · Jan 14, 2016 at 06:41 AM

Thanks for the link to my blog :)
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 :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

33 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UnityWebRequest, C# request.accept equivalent? 1 Answer

,Call api and wait answer to return (async?) 1 Answer

Pass values as bool or number type using SimpleJSON 0 Answers

Having a MonoBehavior member named camera gives a warning no matter what. 0 Answers

Application.persistentDataPath 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges