在 c# 中关注 Instagram id return 404

Following an Instagram id return 404 in c#

我正在尝试使用以下代码在 Instagram 中关注用户 ID,但它总是 return 404 error.My 应用未处于沙盒模式

        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"];
    }

根据 Instagram API 文档,端点是

https://api.instagram.com/v1/users/{user-id}/关系

你传入一个参数"ACTION=follow".

https://www.instagram.com/developer/endpoints/relationships/#post_relationship