How can I send a JSON PUT request to pipedrive from ACCESS using VBA?

Question asked on StackOverflow
(How can I send a JSON PUT request to pipedrive from ACCESS using VBA? - Stack Overflow)

I use this converter: GitHub - VBA-tools/VBA-JSON: JSON conversion and parsing for VBA

I can get the json data but i have got some text fields whith some text which schould update the data in pipedrive

Dim jsonUpload As String

Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")

jsonUpload = txt_pipedrive_id & ";"

jsonUpload = jsonUpload & txt_firma & ";"

jsonUpload = jsonUpload & txt_ansprechpartner & ";"

jsonUpload = jsonUpload & txt_adresse & ";"

jsonUpload = jsonUpload & txt_email & ";"

jsonUpload = jsonUpload & txt_telefon

Dim Json As Object
Set Json = JsonConverter.ConvertToJson(MyRequest.responseText)

MyRequest.Open "put", "" & txt_pipedrive_id & "?api_token={api_token}"

From omegastripes

What is the exact question? Why do you get MyRequest.responseText value prior to MyRequest.Open and MyRequest.Send? MyRequest.Send.Json is wrong syntax.

You can check the JSON is correct here:!/Persons/get_persons_id

Set Json = JsonConverter.ConvertToJson(jsonUpload )

URL is wrong;
'https://" & YourPipedriveCompany & “” & txt_pipedrive_id & “?api_token=” & YourAPIToken

With CreateObject(“MSXML2.XMLHTTP”)
.Open “PUT”, strURL, False
.setRequestHeader “Content-Type”, “application/json”
.Send (strSql)
txt = .responseText
End With’

1 Like