InstaR R包:重定向URI与注册的重定向URI不匹配

问题描述 投票:0回答:1

我正在探索你的InstaR包来访问R中的Instagram数据。

在Instagram中注册客户端并返回我的客户端ID和客户端密钥后,我收到了此错误。

{“error_type”:“OAuthException”,“code”:400,“error_message”:“重定向URI与注册的重定向URI不匹配”}

使用的脚本是这个(app_id和app_secret是虚构的)

install.packages("instaR")
library(instaR)


my_oauth <- instaOAuth(app_id="xxxxxxxx", app_secret="yyyyyyyy")
save(my_oauth, file="my_oauth")

alessandrozonin <- getUserMedia( username="alessandrozonin", token=my_oauth )
comments <- getComments( alessandrozonin$id[1], token=my_oauth )
r instagram-api instar
1个回答
1
投票

来自instaR's documentation的instaOAuth()函数:

细节

要使用app_id和app_secret,请执行以下步骤。首先,去http://instagram。 com / developer /并使用任何名称注册您的应用程序。然后,使用“Client ID”和“Client Secret”作为参数运行instaOAuth函数。它将返回一个URL,您需要将其粘贴到Instagram上的应用程序设置中的“OAuth redirect_uri”字段中。更改后,按下R中的Enter键。将打开一个新的浏览器窗口并对令牌进行签名。如果一切正常,您将收到一条消息,说您可以返回R.

根据您在问题中写的内容和错误消息,您似乎没有正确完成粗体步骤。

© www.soinside.com 2019 - 2024. All rights reserved.