Attempting to push a record (item) to a board from an Excel DB using VBA. The script adds an item as intended from the try-it-yourself utility. (I built the script in the code and captured it from the function [strJSON] just to make sure it was identical.) The token (strToken) was taken from my account page, and was used in the utility as well. So, I am certain that there are no errors in the script, but just for clarity, here it is:
mutation { create_item( board_id: XXXXXXX, group_id: “topics”, item_name: “My Company”, column_values: “{"text8":"Me","date4":{"date":"2019-11-10"}}”)}
I cannot get it to rpocess the added item using VBA. My code is:
Dim http As Object
Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
http.Open "POST", strURL, False
http.setRequestHeader "Content-Type", "application/json"
http.setRequestHeader "Authorization", strToken
http.Send strJSON
PushToMondayPM = http.responseText
strError = http.statusText
Set http = Nothing
The responseText is empty, and the statusText says “Bad Request”.
Also, FWIW, there is conflicting information if the APIv2 URL is api.monday.com/v2 or COMPANY.monday.com/v2.
Any help or sample code that you can provide is greatly appreciated. Thanks!
Don