2
$\begingroup$

recently I've encountered with very unpleasant issue trying getting access to the data from Instagram. As you now, to get access you must have an authentication key, so when I use "ServiceConnect["Instagram"]" for signing in, I get the message:

"{"error_type": "OAuthForbiddenException", "code": 403, "error_message": "You are not a sandbox user of this client"}"

BTW, I tried accessing other social media data, It worked. So, what's wrong? How to make this thing work?

P.C. Not a native speaker, sorry for mistakes.

$\endgroup$
  • $\begingroup$ What MMA Version do you use? I have 11.0.1 for Windows and when I evaluate ServiceConnect["Instagram"] I get the ServiceConnect::disc message: "Due to restrictions added by Instagram, this service is currently not available". $\endgroup$ – JEM_Mosig Jun 29 '17 at 23:58
2
$\begingroup$

The issue here is that Instagram has changed its terms of use and Wolfram's redirect URI no longer works.

I went into the paclet itself to tweak things:

FileNameJoin[{
   PacletFind["ServiceConnection_Instagram"][[1]]["Location"],
   "Kernel",
   "Instagram.m"
   }] // SystemOpen

I made compatibility changes that would have fixed it if they had a valid redirect URI then reloaded:

Quiet[
  Once[OAuthClient`Private`oauthservicedata["Instagram"]] =.;
  ];
ServiceConnections`Private`findandloadServicePaclet["Instagram"];

But when you run it you get this response:

{"error_type": "OAuthException", "code": 400, "error_message": "Redirect URI does not match registered redirect URI"}

I then tried to make my own app on Instagram, because I could trivially port over what Wolfram had to my own server space on the cloud, but Instagram's captcha system is borked up (it seems like this is a common occurrence for them) and couldn't do it.

So once that's fixed, here's how you can patch it.

Step 1, register your own app with Instagram

Go here and fill out the form: https://www.instagram.com/developer/clients/register/

It'll ask you for a redirect URI. Feel freem to use mine:

https://www.wolframcloud.com/objects/b3m2a1/o/oauthflow/oauth2callback-access_token

Step 2, copy the current paclet

Duplicate this directory:

PacletFind["ServiceConnection_Instagram"][[1]]["Location"]

Step 3, tweak the core paclet file

You'll need to update the "ClientID", "RedirectURI", and "Scope" basically. The first two are obvious. The last can only be "basic" per Instagram's new terms of use.

Step 4, update the PacletInfo.m file

Increment the "Version" so yours is loaded preferentially


If you don't want to do all this, comment on this sometime when Instagram's CAPTCHA system isn't glitchy anymore and I'll take 20 minutes to make an updated version of the paclet and stick it on my paclet server.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.