Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7895331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:37:02+00:00 2026-06-03T07:37:02+00:00

Similar to this forum post: https://developer.citrixonline.com/forum/request-not-expected-format However he didn’t really explain what he found

  • 0

Similar to this forum post:
https://developer.citrixonline.com/forum/request-not-expected-format

However he didn’t really explain what he found was wrong with his code.

I’m using RestSharp to make API calls. I’ve been able to get it to work great to pull an list of upcoming webinars however when I try to register participant I keep getting a 400/Request not in expected format error.

Following this documentation https://developer.citrixonline.com/api/gotowebinar-rest-api/apimethod/create-registrant, here is my code:

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;

Any insights on how I can figure out why I keep getting that error?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:37:03+00:00Added an answer on June 3, 2026 at 7:37 am

    Instead of using AddParamter (which adds key/value parameters to the request body), you need to write JSON instead:

    request.DataFormat = DataFormat.Json;
    request.AddBody(new {
        firstName = LoggedInUser.FirstName,
        lastName = LoggedInUser.LastName,
        email = LoggedInUser.Email
    });
    

    You’ll also need to clear the handlers (which automatically set the Accept header) if you want to specify them directly:

    client.ClearHandlers();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been through numerous similar questions on this forum but my issue still
Similar to this thread, but not exactly: How To Cache Information In A Threadsafe
Similar to this question: link However I have already mastered that. My problem is
Note: This is similar to this question but it is not the same. I
I'm referring to a problem similar to the one in this post , because
brand new on this forum and this is my first post! At work we're
Background: This is a request for something that may not exist yet, but I've
I've similar requirement as posted in this Question. How to open IE with post
My issue is somewhat similar to this SO question. However, since my implementation is
I'm using code similar to code mention at http://www.dutch-creatives.com/post/2009/08/11/Export-ListView-to-Excel.aspx to export Listview to excel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.