Instagram API - 重定向网址 [英] Instagram API - Redirect url

查看:30
本文介绍了Instagram API - 重定向网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个插件需要我的应用程序的一些 instagram 信息.这个插件只显示照片提要.

I have a plugin that need some instagram infos of my application. This plugin just show photo feed.

我已经在 instagram 开发人员上创建了应用程序并获取了我的客户端 ID,但是,重定向 url 是什么?我放了我的网站链接,因为我真的不明白那是什么.

I have created the application on the instagram developers and get my client id, but, what's the redirect url? I put my website link because i really don't understand what is that.

我需要的是:

id: 'MY PROFILE ID',
redirectUrl: 'http://www.kyriosfestival.com.br',
clientId: 'MY CLIENT ID FROM MY APPLICATION',
accessToken: 'GENERATED FROM INTERNET'

而且它不起作用.我使用了从互联网生成的访问令牌,不知道是不是这个问题.

And it's not working. I have used a access token generated from internet, and i don't know if is this the problem.

使用它的真正形式是什么?

What is the real form to use that?

有人吗?谢谢!

推荐答案

必须迟到,但会发布一个答案,这样也许有一天它会帮助任何人.

Must be late, but will post an answer, so that maybe it will help anyone some day.

对于所有 Instagram API 调用,您都需要接收有效的访问令牌.

For all your Instagram API calls, you need to receive a valid access token.

您可以通过实现身份验证(客户端或服务器端)来获得一个,完整指南可以在 这里.

You can get one by implementing authentication (client-side or server-side), full guide can be found here.

例如,如果您选择使用客户端身份验证,您应该将用户定向到身份验证 URL,如下所示:

So for example, if you choose to go with client-side authentication, you should direct a user to authentication URL, which will looks like this:

https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token

之后,用户将被重定向到您的重定向页面 (REDIRECT-URI).此 REDIRECT-URI 应与您在管理客户端"部分中指定的 URL 匹配.

After that, user will be redirected to your redirect page (REDIRECT-URI). This REDIRECT-URI should match the URL you have specified in Manage Clients section.

重定向发生后,您将在重定向到的页面的 URL 中获得访问令牌.

After the redirect happens, you will get the access token in the URL of the page you've been redirected to.

http://your-redirect-uri#access_token=ACCESS-TOKEN

然后您可以从 url 中提取您的 ACCESS-TOKEN 并开始进行 API 调用.

You can then extract your ACCESS-TOKEN from url and start making API calls.

这篇关于Instagram API - 重定向网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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