简体   繁体   中英

facebook api exception #100-invalid parameter in c#

i developing a poster software, when i'm trying to post a link it give the following exception

facebook api exception #100-invalid

here's my code

     public static bool post(string accesstoken,string status,string link) {
        try
        {
            FacebookClient fb = new FacebookClient(accesstoken);

            Dictionary<string, object> postArgs = new Dictionary<string, object>();
            postArgs["message"] = status;
            if (link != "") {
                postArgs["link"] = link;
                MessageBox.Show(link);
            }
            fb.Post("/me/feed", postArgs);
            return true;
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
            return false;
        }
    }
}

you should check if the Stream post URL security option is on your app's dashboard, if it is turn it off: https://developers.facebook.com/apps , clic on settings and then migrations.

仪表板

See more information in the Migrations > Stream post URL security bullet : https://developers.facebook.com/docs/facebook-login/security#surfacearea

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM