Hi I am trying to use the API to create a request via the API and the MSXML2.ServerXMLHTTP in Excel VBA.
Sub create_ticket()
Dim headers As String
Dim objHTTP As Object
Dim result As String
Key = "517AC905-BE76-4EF7-BC46-02C93A7CDCD2"
input_data = "{""request"":{""subject"":""API Test VBA"",""description"":""I am unable to fetch mails from the mail server"",""category"":{name:""Software""},""requester"":{""id"":""4"", ""name"":""administrator"" }, ""resolution"":{""content"":""Mail Fetching Server problem has been fixed"" }, ""status"":{""name"":""Open"" }}}"
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "authtoken", Key
objHTTP.send input_data
result = objHTTP.responseText
'FOR debugging
Range("A1").Value = result
Range("A2").Value = input_data
Set objHTTP = Nothing
End Sub