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 /
avatar image
1
Question by tmalhassan · Aug 10, 2018 at 08:09 PM · apiauthenticationusertwitterusername

Twitter SDK for Unity: Bad Authentication Data, error code 215

So i am simply trying to get the user's name. Not the screen_name, just the name that the user could change constantly. According to the docs, i could get it by retrieving the User Object which contains all the user's data. The problem here is whenever i try to retrieve it using ("https://api.twitter.com/1.1/users/show.json?screen_name=userName"), i always get the following error: {"errors":[{"code":215,"message":"Bad Authentication data."}]}.

Here i am using Unity SDK. Which after authentication gives me access to userName, authToken, and id.

i can't find anything useful on the internet regarding this, since using Twitter API in a game is very rare.

This is the code that i am using at the moment:

 IEnumerator GetDisplayName(string userID)
 {
     using (WWW www = new WWW("https://api.twitter.com/1.1/users/show.json?screen_name=" + userID))
     {
         yield return www;
         string json = www.text;
         JsonUtility.FromJson<WWW>(json);

         yield return www;

         foreach (var item in json)
         {
             Debug.Log(www.text);
         }
     }
 }

Note: i call this function after i successfully authenticate.

So is it even possible to do this in Unity? and if so, what am i doing wrong?

Any help is very much appreciated.

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
1
Best Answer

Answer by tmalhassan · Mar 06, 2019 at 02:17 PM

Hello @Geads. Yes I managed to solve the issue and successfully send the request and get the response. There is an asset on the Assets store that shows you how to do it in details. From that code and the Twitter API docs, you can figure out all that you need to do... here’s the link to the asset.

Please support the owner of the asset as well, all credits go to them. And do let me know if you need further help.

Comment
Add comment · Show 6 · 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 Geads · Mar 06, 2019 at 06:28 PM 0
Share

Thank you for your help! I was able to authenticate correctly, but I'm having trouble figuring out how to do GET and POST requests from the API. Can we private message on here somehow?

avatar image Geads · Mar 06, 2019 at 09:44 PM 0
Share

Or if you could just post the code you used to complete your get request of

"https://api.twitter.com/1.1/users/show.json?screen_name=userName"

I should be able to figure it out from there.

avatar image tmalhassan Geads · Mar 06, 2019 at 10:06 PM 0
Share

@Geads did you download the asset? It literally has the entire code from A-Z

avatar image Geads tmalhassan · Mar 06, 2019 at 10:11 PM 0
Share

It has the code to log in and post a tweet, I did not see anything for GET requests to make your own api calls. $$anonymous$$aybe we have a different version. I tried to change it to fit what I need and I get error code 32

Show more comments
avatar image
0

Answer by Geads · Mar 06, 2019 at 04:07 AM

Did you ever figure this 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

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

89 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 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 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

Unity and TweetSharp / Twitter 2 Answers

Authenticate steam user ID to avoid "fraud" 1 Answer

How to implement authorization URL opening in browser to get auth code? 0 Answers

Upload photo to Twitter 0 Answers

MYSQL for webplayer 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