pablobarbera / instaR

Dev version of instaR package: Access to Instagram API via R
106 stars 47 forks source link

callAPI #25

Closed Matt-McNeill closed 8 years ago

Matt-McNeill commented 8 years ago

I am getting a "Error. User name not found." error when calling getUserMedia. I am running R 3.02 for Mac. It looks like the underlying error is generated because the function callAPI is not defined. Perhaps it is part of another package?

search() [1] ".GlobalEnv" "package:Rfacebook" "package:RCurl" "package:bitops"
[5] "package:httpuv" "package:instaR" "package:rjson" "package:httr"
[9] "tools:RGUI" "package:stats" "package:graphics" "package:grDevices" [13] "package:utils" "package:datasets" "package:methods" "Autoloads"
[17] "package:base"

Thanks for any help you can provide! Matt

pablobarbera commented 8 years ago

@Matt-McNeill see the note I just added to the README. Instagram changed their API and it appears most endpoints now require getting your app approved by Instagram. I'm still trying to figure out what is still available, but my guess is that this error message is related to this problem.

Matt-McNeill commented 8 years ago

Thanks.

On Dec 3, 2015, at 2:58 PM, Pablo Barberá notifications@github.com wrote:

@Matt-McNeill see the note I just added to the README. Instagram changed their API and it appears most endpoints now require getting your app approved by Instagram. I'm still trying to figure out what is still available, but my guess is that this error message is related to this problem.

— Reply to this email directly or view it on GitHub.

chainsawriot commented 8 years ago

https://www.instagram.com/developer/authorization/

An unapproved app (i.e. only with 'basic' scope authorized) can only get:

Edilmo commented 8 years ago

Hi, After debugging the code a little bit, I found two of the possible causes for this problem (could be more depending in the use case). Both of the causes are related to the changes that instagram made to their policies:

  1. Now you need, at least require scope="public_content" and the default of the library is scope="basic". So, this line r my_oauth <- instaOAuth(app_id="123456789", app_secret="1A2B3C4D", scope="public_content") is enough for the getUserMedia function.
  2. Now your application start running in a SANDBOX where you just have access to the public information of the people that are part of that SANDBOX. So if you want to access posts or general info from another user, it is necessary to edit your instagram application definition in Manage Clients and send invitations to all that users from the SANDBOX section. And after that ask them for permissions to access that data.
pablobarbera commented 8 years ago

Thanks everybody for contributing here! I have added information messages on all functions and documentation, to hopefully clarify this point!