アプリでイベントを作成しようとしていますが、「無効なパラメーター」エラーが発生し続けます:
(OAuthException - #100) (#100) Invalid parameter
ヒットしたとき:
JsonObject result = facebookClient.Post("/me/events", createEventParameters) as JsonObject;
パラメータを数回変更しましたが、それでも助けにはなりません。誰でもアドバイスできます:
public string CreateEvent()
{
var accessToken = accessTok;
FacebookClient facebookClient = new FacebookClient(accessToken);
Dictionary<string, object> createEventParameters = new Dictionary<string, object>();
createEventParameters.Add("owner", "Me");
createEventParameters.Add("name", "Test Event");
createEventParameters.Add("description", "This is a test event.");
createEventParameters.Add("start_time", DateTime.Now.AddDays(2).ToUniversalTime().ToString());
createEventParameters.Add("end_time", DateTime.Now.AddDays(2).AddHours(4).ToUniversalTime().ToString());
createEventParameters.Add("location", "A Street");
// Sample venue
JsonObject venueParameters = new JsonObject();
venueParameters.Add("street", "19 Phipps St");
venueParameters.Add("city", "Toronto");
venueParameters.Add("state", "ON");
venueParameters.Add("zip", "L2A 2V2");
venueParameters.Add("country", "Canada");
venueParameters.Add("latitude", "43.6654507");
venueParameters.Add("longitude", "-79.38569580000001");
createEventParameters.Add("venue", venueParameters);
createEventParameters.Add("privacy", "SECRET");
createEventParameters.Add("updated_time", DateTime.Now.ToString());
//Add the event logo image
FacebookMediaObject logo = new FacebookMediaObject()
{
ContentType = "image/png",
FileName = @"D:/Downloads/bb.png"
};
logo.SetValue(File.ReadAllBytes(logo.FileName));
createEventParameters[@"D:/Downloads/bb.png"] = logo;
JsonObject result = facebookClient.Post("/me/events", createEventParameters) as JsonObject;
return result["id"].ToString();
}