使用用户ID链接到Instagram个人资料

编程入门 行业动态 更新时间:2024-10-20 07:40:19
本文介绍了使用用户ID链接到Instagram个人资料的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想链接到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=YourClientID

This 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个人资料

本文发布于:2023-10-11 23:09:57,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:个人资料   链接   用户   ID   Instagram

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!