SDP API VBA script "input_data" format

SDP API VBA script "input_data" format

Hi,

I've been banging my head against the wall for a few days now trying to get a VBA script to add a new request with a certain template. I keep getting below error:

{"response_status":{"status_code":4000,"messages":[{"status_code":4001,"field":"input_data","type":"failed","message":"Value not provided"}],"status":"failed"}}

If anyone could give me an example how to build the httprequest in VBA, it would be greatly appreciated. Below is what I currently have:


Public Sub httpclient()

Dim xmlhttp As New MSXML2.XMLHTTP60, myurl As String, inputData As String


xmlhttp.Open "POST", myurl, False
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.setRequestHeader "authtoken", "########-####-####-####-############"

inputData = "{input_data:{""request"":{" _
    & """subject"":""Onboard Lord Sauron""," _
    & """description"":""Please give Lord Sauron all necessary permissions to forge the ring""," _
    & """requester"":{""id"":1}," _
    & """status"":{" _
    & """name"":""Open""" _
    & "}," _
    & """template"":{""id"":1}," _
    & """technician"":{""id"":1}," _
    & """udf_fields"":{" _
    & """udf_date_1808"":{""value"":42609919896000}," _
    & """udf_sline_1809"":""test""," _
    & """udf_sline_1810"":""test""," _
    & """udf_pick_1807"":""test""" _
    & "}," _
    & """site"":{""id"":1}" _
    & "}}"
  
'MsgBox inputData
  
xmlhttp.send inputData



                  New to ADSelfService Plus?