php 您不是此客户端的沙盒用户。错误 Codeigniter-Instagram api

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39632333/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 01:58:23  来源:igfitidea点击:

You are not a sandbox user of this client. Error Codeigniter-Instagram api

phplogincodeigniter-2instagram-api

提问by Arun

In my codeigniterproject I am trying to use Instagram APIfor log in.

在我的codeigniter项目中,我试图Instagram API用于登录。

Thisis the library which I am using.

是我正在使用的库。

But when going to the login page, it is showing error

但是当进入登录页面时,它显示错误

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

{"code": 403, "error_type": "OAuthForbiddenException", "error_message": "您不是此客户端的沙箱用户"}

The sample url is

示例网址是

https://www.instagram.com/oauth/authorize/?client_id=[client ID]&redirect_uri=[your url]&response_type=code

Why it is working like this? Any help could be appreciated

为什么它是这样工作的?任何帮助都将不胜感激

回答by devpro

As per this error:

根据这个错误:

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

{"code": 403, "error_type": "OAuthForbiddenException", "error_message": "您不是此客户端的沙箱用户"}

First of all you need to create Sandbox User:

首先,您需要创建Sandbox User

Step1:

第1步:

Login your account from here "http://instagram.com/developer" and than click on Manage Clients for creating New Client, make sure status of client is Sandbox.

从这里“ http://instagram.com/developer”登录您的帐户,然后单击管理客户以创建新客户,确保客户状态为沙盒。

Step2:

第2步:

Fill all required fields and set OAuth redirect_urifield to "http://localhost" without using quotes. also unchecked Disable implicit OAuth

填写所有必填字段并将字段设置OAuth redirect_uri为“ http://localhost”而不使用引号。也未选中Disable implicit OAuth

Step 3:

第 3 步:

Now you can see the client id on Client Detail box, now you just need to generate Access Token for access API, you can use this URL:

现在您可以在客户端详细信息框中看到客户端 ID,现在您只需要为访问 API 生成访问令牌,您可以使用此 URL:

https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID_HERE]&redirect_uri=http://localhost&response_type=token

You can check the status of Client from here:enter image description here

您可以从这里检查客户端的状态:在此处输入图片说明

Reference: http://jelled.com/instagram/access-token

参考:http: //jelled.com/instagram/access-token

回答by Argus

In such error case:

在这种错误情况下:

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

{"code": 403, "error_type": "OAuthForbiddenException", "error_message": "您不是此客户端的沙箱用户"}

You need to add that Instagram user to Sandbox Users:

您需要将该 Instagram 用户添加到Sandbox Users

Step1:

第1步:

Go https://www.instagram.com/developer/clients/manage/

https://www.instagram.com/developer/clients/manage/

Press Manage.

Manage

Press Sandbox.

Sandbox

Step2:

第2步:

Type Instagram IDof user you getting that error add and press Save. You will see pendingin front of user you added.

Instagram ID您收到该错误的用户类型添加并按Save。您将pending在您添加的用户面前看到。

Step 3:

第 3 步:

Now you need to accept invitation. Login into that Instagram account on the https://www.instagram.com.

现在您需要接受邀请。在https://www.instagram.com上登录该 Instagram 帐户。

Go to https://www.instagram.com/developer/clients/sandbox_invites/

转到https://www.instagram.com/developer/clients/sandbox_invites/

http://joxi.ru/l2ZRDDPFzV9GK2.jpg

http://joxi.ru/l2ZRDDPFzV9GK2.jpg

Press Accept.

Accept

Done! Now should work.

完毕!现在应该工作。

回答by timofey.com

In addition to the already provided answers:

除了已经提供的答案:

Check the account you're logged in on Instagram

检查您在 Instagram 上登录的帐户

You cannot be logged in to account Aand request a token for account B.

您无法登录帐户A并为帐户B请求令牌。

This is a simple answer, but I just spent 15 minutes figuring this out, because I'm logged in to different accounts under different Chrome windows.

这是一个简单的答案,但我只花了 15 分钟就搞清楚了,因为我在不同的 Chrome 窗口下登录了不同的帐户。