Hello! I’ve been trying to work with API v2 and VBA. So far I’ve been able do connect to the server and query board fields and values. I’m now trying to creating items and changing column values using mutation, but haven’t had success yet. Hope someone could show me the way.
My general code is:
Public Pass As Variant
Sub monday()
Dim monday As New MSXML2.ServerXMLHTTP60
Dim response As Variant
Dim status As Variant
Dim query As String
query = query
With monday
.Open "POST", myurl , False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", mytoken
.Send query
response = .ResponseText
status = .status & " | " & .StatusText
End With
MsgBox response
MsgBox status
End Sub
When trying to change the columns values, I’ve tried querying the mutation in two different ways, getting different response texts and status.
1st try:
query = " { ""mutation"" : ""{change_simple_column_value (board_id: xxxxxxxx, item_id: xxxxxxxx, column_id: ""texto"", value: ""Ok"" {id}}""}"
With this I get a huge response text (looks like error) and status and status text: “500 | Internal Server Error”.
On the 2nd try, I’ve tried escaping the strings:
query = " { ""mutation"" : ""{change_simple_column_value (board_id: xxxxxxxx, item_id: xxxxxxxx, column_id: \""texto\"", value: \""Ok\"" {id}}""}"
This time I get the response text as: “{“errors”:[{“message”:“No query string was present”}],“account_id”:xxxxx}” and status and status text: “200 | OK”.
What I could possibly be doing wrong?