Hi,
Im writing a vbscript that should create QueueItems. I got it working using Postman, but I
m unable to make it work in my script.
I successfully retrieve the “access_token” using POST https://account.uipath.com/oauth/token and store the token in the variable access_token
I then make another call using POST https://platform.uipath.com/odata/Queues/UiPathODataSvc.AddQueueItem , which fails and this part looks like this:
jsonData2 = “{ ““itemData””: {”“Name”“: ““Queue””, ““Priority””: ““Normal””, ““SpecificContent””: { ““Name””: ““Solan Gundersen””, ““Age””: 54 }}}”
Set HTTP2 = CreateObject(“MSXML2.ServerXMLHTTP”)
HTTP2.Open “POST”, url2, False
HTTP2.setRequestHeader “Content-Type”, “application/json”
HTTP2.setRequestHeader “Authorization”, “Bearer " & access_token
HTTP2.setRequestHeader “X-UiPath-TenantName”, “”” & tenant_logical_name & “”"
HTTP2.setRequestHeader “X-UiPath-OrganizationUnitId”, “12345”
HTTP2.send jsonData2
msgbox "Status code: " & HTTP2.status & " Response: " & HTTP2.responseText’
I just get a 401-error - “You are not authenticated!”
The Json-string might be wrong, but I should get a 400-error when the json-string is wrong, but the authentication is correct.
Are there anyone that can see what I`m doing wrong?