Instagram api oauth 405不允许

时间:2015-05-19 21:27:21

标签: instagram instagram-api

我尝试将instagram api与postman一起使用。

我发了一个帖子请求:

https://api.instagram.com/oauth/access_token

client_id : "client_id"
client_secret : "client_secret"
grant_type : authorization_code
redirect_uri : "redirect_uri"
code : "code"

和resut是:405方法不允许

我能做些什么才能做出正确的回应?

6 个答案:

答案 0 :(得分:2)

据我所知,这是不正确的。我们使用POST到这个端点的生产应用程序刚刚开始破坏大约15分钟前。我尝试发布GET无济于事。响应中的'Allow'标题确实说POST,所以我认为这是我们打算做的,但似乎有问题。

答案 1 :(得分:1)

这是因为点击“api.instagram.com”的302重定向。

您应该使用网址:

/**
 * {@inheritdoc}
 */
protected function getAuthUrl($state)
{
    return $this->buildAuthUrlFromBase(
        'https://instagram.com/oauth/authorize', $state
    );
}

/**
 * {@inheritdoc}
 */
protected function getTokenUrl()
{
    return 'https://instagram.com/oauth/access_token';
}

代码取自覆盖Laravel的Instagram社交名流插件。 (socialiteproviders.github.io/providers/instagram /)

答案 2 :(得分:1)

现在似乎正常工作。很可能是一个临时的Instagram内部问题。 Instagram deleveloper的博客没有报道任何内容。

答案 3 :(得分:0)

是否存在此问题,这是由于从api.instagram.com重定向到instagram.com。我们删除了" api。"从网址的开头(所以https://instagram.com/oauth/access_token),它又开始工作了。

答案 4 :(得分:0)

你尝试哪个端点可能并不重要

https://api.instagram.com/oauth/access_token重定向您 https://instagram.com/oauth/access_token 要么 https://instagram.com/oauth/access_token

端点仅允许您使用POST请求但由于某种原因它无法正常工作。我有类似的问题,我使用方法POST很长一段时间,现在它也没有工作。它看起来像是一些Instagram API问题。

答案 5 :(得分:0)

我在使用select distinct a.val1 , (select rtrim(b.val2) + '' from tableval b where b.val1=a.val1 for xml path ('')) as val2 from tableval a Django==1.7.8时遇到了这个问题。我通过将django-allauth==0.24.1access_token_url更改为使用authorize_url子域而不仅仅是api.instagram.com来修复此问题。