New to Monday.com, and I’m trying to use the API to create an item. I’ve tried with SQL server and PowerShell and always get a 500 error back.
I’ve read, and tried the code from this post: Using PowerShell to create an item in Monday.com?
with no luck. I’ve tried and re-tried using different formatting, but I’m sure the issue is with $query below (tried with escaping the quotes etc.).
Any help would be appreciated. This seems like it should be pretty easy, but I cannot get it to work and the error isn’t much help. I can query the board (return data) so I know the authentication works, and inserting using the API playground works so I think the query (mutation) is right (have tried adding “query:” before mutation as well). But I can’t get anything other 500 back.
with
$query=
mutation {
create_item(
board_id: “123456789”
item_name: “New Item 123”
column_values: “{“text”:“This is a new item”}”
) {
id
}
}
I can copy/paste the $query text into the playground and it works, but always get:
Invoke-RestMethod : The remote server returned an error: (500) Internal Server Error.
I do not have experience with that language, but this might be related to escaping outer quotes. Here is a cURL example you can use (if you want, you can import it to Postman, and then “translate” it to the language you want.
Thanks - using postman helped, it was related to escaping quotes. I have a proof of concept working, though automating the whole process may take a lot of work.
Thanks for help.