Skip to main content

I’m trying to update items in C# via api calls, but my query is not working, it returns a 500 Internal Server Error, Version: 1.1, but it works in the play ground:

{“query”: “mutation {change_multiple_column_values(item_id: 5720531888, board_id: 5720522778, column_values: “{"name":"Name changed","people":{"personsAndTeams":A{"id":"42575577","kind":"person"}]},"status":{"index":1},"numbers":"10"}” ){id} }”}


This the mutation that works in the play ground the exact mutation, which is not working it code, the values and format are all the same so they are correct:

mutation worksHere {change_multiple_column_values(item_id: 5720531888, board_id: 5720522778, column_values: “{"name":"Name changed","people":{"personsAndTeams":e{"id":"42575577","kind":"person"}]},"status":{"index":1},"numbers":"10"}” ){id} }


By the way, I am able to udpate the board in code, add_users_to_board or delete_subscribers_from_board and that works, including updating description and board name.


Looking forward to getting this working, thanks in advance for your help.

Hello there @sbryon and welcome to the community!


I hope you like it here 💪


I am not experienced with C# but I tried using your query in Postman and “translating” it to C# and this is what I get:


var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.monday.com/v2/");
request.Headers.Add("API-Version", "2023-10");
request.Headers.Add("Authorization", "APITOKEN");
var content = new StringContent("{\\"query\\":\\"{change_multiple_column_values(item_id: 5720531888, board_id: 5720522778, column_values: “{\\\\\\"name\\\\\\":\\\\\\"Name changed\\\\\\",\\\\\\"people\\\\\\":{\\\\\\"personsAndTeams\\\\\\":\{\\\\\\"id\\\\\\":\\\\\\"42575577\\\\\\",\\\\\\"kind\\\\\\":\\\\\\"person\\\\\\"}]},\\\\\\"status\\\\\\":{\\\\\\"index\\\\\\":1},\\\\\\"numbers\\\\\\":\\\\\\"10\\\\\\"}” ){id} }\\",\\"variables\\":{}}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Maybe you can compare this with your script and see what the differences are to see what you need to change 😁


Cheers,

Matias


Thanks Matias, I compared your Postman with my C#, the only difference I see is that your content does not contain the key work “mutation” and your have the empty variable property at the end, everything else is the say. I believe for update and create mutation is needed, so far that’s what has been working for me in other functions. Oh, you’re also doing a SendAsync() and I’m doing PostAsync(). Everything else is the same, I’ll do some further digging, but if anyone has this working in C# I’d really appreciate the help. Thanks.


Hello again,


Yes!!! I am sorry! I don’t know why the “mutation” was not included. It is indeed needed.


Then from what you say, on the monday side, it looks like everything is in order, so I hope


Thank you, it’s all good. I needed to work on my GraphQL syntax, but it’s all working now. Thanks again.


I am glad that is the case @sbryon !!


Reply