使用用户ID链接到Instagram个人资料 [英] Link to Instagram profile with user ID
问题描述
我想链接到Instagram上的个人资料/用户帐户。我有用户标识,但我无法在开发人员API文档中找到答案。我试过了instagram.com / userID
和instagram.com/users / userID
但这些都不起作用。简单的问题:我只有一个< a>
标记,我想知道 href
中的内容为让用户访问特定的instagram个人资料。或者可能在JavaScript中包含 window.location
。
或者,如果有方法从ID中获取用户名,我想我也可以用这种方式来做...
,这使它成为一个简单的链接。您将需要使用Instagram API并注册您的应用程序,以便您拥有一个Client-ID。
接下来,您将需要以HTTP GET方式执行以下请求:
https://api.instagram.com/v1/users/userID?client_id=YourClientID
这会返回一个JSON结果,它将在 data
部分中包含用户名。
现在您可以使用 http://instagram.com/username
作为你的链接。
I want to link to a profile/user account on Instagram. I have the user ID, but the I can't find the answer in the developer API documentation. I've tried instagram.com/userID
and instagram.com/users/userID
but these aren't working. Simple question: I have just a single <a>
tag and I want to know what goes in the href
to take the user to a specific instagram profile. Or possibly a window.location
in javascript.
Or if there's a way to get the username from the ID, I suppose I could also do it in that round-a-bout way...
I am not aware of a solution, that makes it work as a simple link.
You will need to use the Instagram API and sign up your application so that you have a Client-ID.
Next, you will need to do the following request as HTTP GET:
https://api.instagram.com/v1/users/userID?client_id=YourClientID
This will return a JSON-Result, which will contain the username inside the data
section.
Now you can use http://instagram.com/username
as your link.
这篇关于使用用户ID链接到Instagram个人资料的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!