Jeff McKay
Jeff McKay

Reputation: 295

Getting "parse error" when creating Gmail label

I am using the Gmail API to create a label, using URL https://www.googleapis.com/gmail/v1/users/me/labels. Works perfectly for me. However several customers are reporting this fails with http error 400, with the error:

"domain": "global", "reason": "parseError", "message": "Parse Error"

The json that is input to the call is very simple, example:

{"name":"Secretarial Misc."}

Any idea what the problem could be? Why would the exact same json work for me but not somebody else?

Upvotes: 0

Views: 685

Answers (1)

Tholle
Tholle

Reputation: 112927

The data you show should, according to the specification, not work for anyone. It's peculiar that is works for you! Try this:

POST https://www.googleapis.com/gmail/v1/users/me/labels?access_token={YOUR_API_KEY}

{
 "labelListVisibility": "labelShow",
 "messageListVisibility": "show",
 "name": "Secretarial Misc."
} 

Upvotes: 2

Related Questions