我想链接到Instagram上的个人资料/用户帐户。我有用户标识,但我无法在开发人员API文档中找到答案。我试过了instagram / userID 和instagram/users / userID 但这些都不起作用。简单的问题:我只有一个< a> 标记,我想知道 href 中的内容为让用户访问特定的instagram个人资料。或者可能在JavaScript中包含 window.location 。
或者,如果有方法从ID中获取用户名,我想我也可以用这种方式来做...
,这使它成为一个简单的链接。您将需要使用Instagram API并注册您的应用程序,以便您拥有一个Client-ID。
接下来,您将需要以HTTP GET方式执行以下请求:
api.instagram/v1/users/userID?client_id=YourClientID这会返回一个JSON结果,它将在 data 部分中包含用户名。
现在您可以使用 instagram/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/userID and instagram/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:
api.instagram/v1/users/userID?client_id=YourClientIDThis will return a JSON-Result, which will contain the username inside the data section.
Now you can use instagram/username as your link.
更多推荐
使用用户ID链接到Instagram个人资料
发布评论