Getting unauthorized error trying to create a meeting with REST API

  • 1
  • Question
  • Updated 4 months ago
  • (Edited)
Newbie question here: I'm logging in with a username/password (long story) using the /oauth2/token?password endpoint, and getting back an authorization token.  I then try to post to /v1/user/{user_id}/scheduled_meeting to create a scheduled meeting- with user_id set to the value I got back from the oauth2 endpoint above, and the Authorization header set to "Bearer " + the auth token acquired from that same endpoint, and what looks to me like a valid body-{"attendees":[{"email":"bhurt@wrinkl.com"}],"start":1534970994000,"end":1534985394000,"title":"Test","description":"Meeting started with Wrinkl"}

I'm getting back a 401 "Unauthorized" error- help?  What am I doing wrong?
Photo of Brian Hurt

Brian Hurt

  • 90 Points 75 badge 2x thumb

Posted 4 months ago

  • 1
Photo of Ben Hutchison

Ben Hutchison, Official Rep

  • 2,038 Points 2k badge 2x thumb
Can you try sending the user auth token in an access_token query parameter instead of an Authorization header?

/v1/user/{user_id}/scheduled_meeting?access_token={access_token}
Photo of Brian Hurt

Brian Hurt

  • 90 Points 75 badge 2x thumb
So that moved the ball forward- I started getting a 415 unsupported media type, which I fixed by adding a Content-Type: application/json header.  Now I'm getting a 500 Internal Server Error, with an empty body.
Photo of Brian Hurt

Brian Hurt

  • 90 Points 75 badge 2x thumb
So this turns out to be because I wasn't providing required fields in my body (due to a bug in my code)- fixing that, and it works.  You might want to fix it so a bad JSON parse (required fields missing) returns a proper 4XX error.  But we're good here.  Thank you.