Curl 400 Bad Request

Hi Support,

Currently I am trying to use Curl to send a simple query GraphQL via API V2.
However , I encountered 400 Bad Request.
I ran this command in Windows 10 command mode directly as following.

curl -X POST -H “Content-Type:application/json” -H “Authorization:xxxxx” “https://api.monday.com/v2” -d ‘{“query”:"{boards{id,name}}"}’ -v

Please kindly advise where should I adjust.
Thank you.

Best Regards,
Steven

Hey @steven.su :slight_smile: Welcome to the community, glad to have you here!

Other clients have also had trouble with that example, I believe the Windows command prompt is picky about quotation marks… :sweat_smile:

Can you try the following command instead (using double quotes and no single quotes) and let me know if it works?

curl -X POST -H “Content-Type:application/json” -H “Authorization:xxxxx” “https://api.monday.com/v2” -d "{\"query\":\"{boards{id,name}}\"}" -v

Hi @dipro-monday.com ,

Yes, it works !
Actually I had tried to change single-quote to double-quote , but I did not add \ in in front of each double-quote between this two double-quotes.
Thanks a lot !

Steven

2 Likes

Amazing! Good to know :slight_smile:

1 Like