Skip to main content

{“error_message”:“Unsupported query”,“status_code”:400}

  • July 31, 2020
  • 4 replies
  • 5269 views

Hi All

I’m using below code to upload file to monday.com with VB.NET

Dim client2 = New RestClient(“https://api.monday.com/v2/file”)
Dim request2 = New RestRequest(Method.POST)
request2.AddHeader(“Authorization”, “XXXXXXX”)
request2.AddHeader(“Content-Type”, “multipart/form-data”)
request2.AddFile(“variables[file]”, “C:/test.txt”)
request2.AddParameter(“query”, “mutation($file: File!) {add_file_to_column(file: $file,item_id:XXXXXXXX,column_id:”“files”“) {id}}”)
Dim response2 As IRestResponse = client2.Execute(request2)

I received an error {“error_message”:“Unsupported query”,“status_code”:400}

I tried with escape "\\ and that gave the same error with VB.NET.

Does anyone have an idea of what’s wrong here?

Din

This topic has been closed for replies.

4 replies

  • Community Expert
  • July 31, 2020

Hey @dinithij ,

monday API is graphQL, hence, your request is either a mutation or a query.
Reading data is “query”, changing data is “mutation”.

In general you can test your queries here:

monday.com

Greetings


AlexSavchuk
Forum|alt.badge.img
  • monday.com Team Member
  • August 1, 2020

Hey @dinithij 👋

Thank you for reaching out to us with this issue! It does seem like @TMNXT-Dev has a good point and it seems like your query is not declared just yet. Could you please try looking through the suggested steps and see if you can get this to worK?

-Alex


  • Author
  • Participating Frequently
  • August 4, 2020

Thanks everyone. I managed to fix my issue. It is due to Rest Client version I had.
Din


AlexSavchuk
Forum|alt.badge.img
  • monday.com Team Member
  • August 4, 2020

@dinithij amazing!

For anyone who is wondering about the solution here, you can find a working code example here as well:

How to use add_file_to_column in VB.NET (API Call)

-Alex