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
You are not a sandbox user of this client. Error Codeigniter-Instagram api
提问by Arun
In my codeigniter
project I am trying to use Instagram API
for 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_uri
field 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:
Reference: 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 ID
of user you getting that error add and press Save
.
You will see pending
in 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/
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 窗口下登录了不同的帐户。