このフォーラムの投稿と同様: https ://developer.citrixonline.com/forum/request-not-expected-format
しかし、彼は自分のコードで何が間違っているのかを実際には説明しませんでした。
私はRestSharpを使用してAPI呼び出しを行っています。今後のウェビナーのリストを取得するためにうまく機能させることができましたが、参加者を登録しようとすると、予期しない形式のエラーではない400/Requestが発生し続けます。
このドキュメントhttps://developer.citrixonline.com/api/gotowebinar-rest-api/apimethod/create-registrantに従って、ここに私のコードがあります:
var client = new RestClient(string.Format("https://api.citrixonline.com/G2W/rest/organizers/{0}/webinars/{1}/registrants", "300000000000xxxxxx", btn.CommandArgument));
var request = new RestRequest(Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddHeader("Accept", "application/json");
request.AddHeader("Accept", "application/vnd.citrix.g2wapi-v1.1+json");
request.AddHeader("Authorization", "OAuth oauth_token=" + System.Configuration.ConfigurationManager.AppSettings["GoToWebinar"]);
request.AddParameter("firstName", LoggedInUser.FirstName);
request.AddParameter("lastName", LoggedInUser.LastName);
request.AddParameter("email", LoggedInUser.Email);
var response = client.Execute(request);
var statusCode = response.StatusCode;
なぜそのエラーが発生し続けるのかを理解する方法についての洞察はありますか?
ありがとうございました!