无法获得Instagram基本显示API的access_token [英] Impossible to get an access_token for Instagram Basic Display API

查看:192
本文介绍了无法获得Instagram基本显示API的access_token的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Instagram获取access_token,以将其基本显示API用于新应用程序(只需在网页上显示推文).

I'm trying to get an access_token from Instagram to use their Basic Display API for a new app (simply display tweets on a webpage).

我按照以下步骤操作: https://developers.facebook .com/docs/instagram-basic-display-api/getting-started

I followed these steps: https://developers.facebook.com/docs/instagram-basic-display-api/getting-started

但是我陷入了第5步:将代码交换为令牌

But I'm stuck at Step 5: Exchange the Code for a Token

cURL请求始终返回400错误,并显示以下消息:找不到匹配代码或已经使用了匹配代码"

The cURL request always returns a 400 error with the message: "Matching code was not found or was already used"

但是,经过多次测试,我只获得了一次access_token,但是它在大约一个小时后过期了.这似乎是随机的.

However, after many tests, I got an access_token one time only, but it expired about one hour later. This seems to be very random.

Instagram基本显示API似乎很新.前一段时间,我使用了在 https://www.instagram.com/developer/网站,它曾经可以正常工作.现在,该网站显示以下消息:

The Instagram Basic Display API seems rather new. A while ago, I have used apps created on the https://www.instagram.com/developer/ website and it used to work. Now this site display this message:

更新:自2019年10月15日起,Instagram API平台上的新客户端注册和权限审查将终止,转而使用Instagram Basic Display API.

UPDATE: Starting October 15, 2019, new client registration and permission review on Instagram API platform are discontinued in favor of the Instagram Basic Display API.

...,并带有指向developers.facebook.com的链接.

... with a link to the developers.facebook.com.

推荐答案

当我尝试实现应用程序时遇到了这个问题.
我的问题是当您允许权限时生成的代码.
尝试从生成的代码末尾删除 #_ ,然后尝试再次生成令牌

I had this problem when i was trying implement a application.
My problem was the code generated when you allow the permissions.
Try to remove #_ from the end of the generated code and try generate the token again

生成的代码示例: AQBvrqqBJJTM49U1qTQWRMD96oRyMR3B_04JSfjc-nUIi0iGbSc3x_EceggQi9IyG3B3Rj3ocreMThQoPJbPpeXLUM4exJMy4o01fXcRtT_I9NovaNAqmWSneFt3MYv_k7ifAUUeMlC050n5xnjQP6oAvDBfCFQvTdrFaR95-5i71YsfQlmjYWDG6fcWRvOB9nqr6J9mbGMXMi9Y4tKlSfElaYm0YKRijZQDG2B5PaxQ8A的 #_

Generated code example: AQBvrqqBJJTM49U1qTQWRMD96oRyMR3B_04JSfjc-nUIi0iGbSc3x_EceggQi9IyG3B3Rj3ocreMThQoPJbPpeXLUM4exJMy4o01fXcRtT_I9NovaNAqmWSneFt3MYv_k7ifAUUeMlC050n5xnjQP6oAvDBfCFQvTdrFaR95-5i71YsfQlmjYWDG6fcWRvOB9nqr6J9mbGMXMi9Y4tKlSfElaYm0YKRijZQDG2B5PaxQ8A #_

已修改生成的代码: AQBvrqqBJJTM49U1qTQWRMD96oRyMR3B_04JSfjc-nUIi0iGbSc3x_EceggQi9IyG3B3Rj3ocreMThQoPJbPpeXLUM4exJMy4o01fXcRtT_I9NovaNAqmWSneFt3MYv_k7ifAUUeMlC050n5xnjQP6oAvDBfCFQvTdrFaR95-5i71YsfQlmjYWDG6fcWRvOB9nqr6J9mbGMXMi9Y4tKlSfElaYm0YKRijZQDG2B5PaxQ8A

Generated code edited: AQBvrqqBJJTM49U1qTQWRMD96oRyMR3B_04JSfjc-nUIi0iGbSc3x_EceggQi9IyG3B3Rj3ocreMThQoPJbPpeXLUM4exJMy4o01fXcRtT_I9NovaNAqmWSneFt3MYv_k7ifAUUeMlC050n5xnjQP6oAvDBfCFQvTdrFaR95-5i71YsfQlmjYWDG6fcWRvOB9nqr6J9mbGMXMi9Y4tKlSfElaYm0YKRijZQDG2B5PaxQ8A

这篇关于无法获得Instagram基本显示API的access_token的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆