我正在尝试使用下面的代码关注Instagram中的用户ID,但它总是返回404错误。我的应用程序不是沙盒模式
public void doFollow(string userid)
{
NameValueCollection parameters = new NameValueCollection();
parameters.Add("access_token", ACCESS_TOKEN);
WebClient client = new WebClient();
string url = "https://api.instagram.com/v1/users/" + userid + "/follow";
//404 error happens in the next line
var result = client.UploadValues(url, "POST",parameters);
var response = System.Text.Encoding.Default.GetString(result);
var jsResult = (JObject)JsonConvert.DeserializeObject(response);
string incomStats = (string)jsResult["incoming_status"];
}
答案 0 :(得分:1)
根据Instagram API文档,端点是
https://api.instagram.com/v1/users/ {用户ID} /关系
并传入参数" ACTION = follow"。
https://www.instagram.com/developer/endpoints/relationships/#post_relationship