Call to AddQueueItem returns an HTML

I am trying to add an item to a queue on the orchestrator through an API call.
I am using an API call through POSTMAN to do that. The response that I receive is an HTML doc.

POST: https://platform.uipath.com/[Account Logical Name]/[Tenant Logical Name]/odata/Queues/UiPathODataSvc.AddQueueItem
Header:
=============
Content-Type: application/json
Authorization: Bearer: [Token]
X-UIPATH-FolderPath: Default
X-UIPATH-TenantName: [ ]
X-UIPATH-OrganizationUnitId: Default
=============

Body:
=============
{
	"itemData": {
		"Priority": "High",
		"DeferDate": null,
		"DueDate": null,
		"Name": "Test_Queue",
		"SpecificContent": {
			"id@odata.type": "#String",
			"id": "A12345"
		}
	}
}

There is no consistency in the documentation, so I have tried using both URLs https ://platform.uipath.com/[Account Logical Name]/[Tenant Logical Name]/odata/Queues/UiPathODataSvc.AddQueueItem and https://platform.uipath.com/odata/Queues/UiPathODataSvc.AddQueueItem

Tried with and without X-UIPATH-OrganizationUnitId: Default

My orchestrator is community version (UiPath 2020 Orchestrator 2020.1.16
Community License)

@Cosin Can you help on this?

Hi pranavj,

Hope you were able to find an answer to this well before now. I wanted to send a quick response as I was able to create an API call to create an Orchestrator queue item through Postman, partially thanks to the code you posted above. The following code (which is very similar to yours) was what I got to work:

curl --location --request POST 'https://platform.uipath.com/[Account Logical Name]/[Tenant Logical Name]/odata/Queues/UiPathODataSvc.AddQueueItem' \
--header 'Authorization: Bearer [Auth Token]' \
--header 'Content-Type: application/json' \
--data-raw '{
 	"itemData": {
		"Priority": "Normal",
		"DeferDate": null,
    	"DueDate": null,
    	"Name": "TestQueue",
		"SpecificContent": {
    		"id@odata.type": "#String",
    		"id": "0001"
    	}
    }
}'

I was able to get my API authorization token using the following code:

curl --location --request POST 'https://cloud.uipath.com/api/account/authenticate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tenancyName" : "[Tenant Logical Name]",
    "usernameOrEmailAddress" : "[CE Orchestrator Login UserName]",
    "password" : "[CE Orchestrator Login Password]"
}'

Again, this is very similar to your code so not sure if it will resolve the issue you are experiencing, but I wanted to post just to confirm that it is working for me and in case this can help anyone else.

Cheers,
Riley

Hi - You can check Odata Add queue item request URI not found thread as well.

I am providing all the details to authenticate api exactly the way you mentioned. I am using community version of orchestrator. Hence the username is an email ID. But every time i tried, getting invalid credentials error. After multiple tries, now it says as the user is locked out.

Please try below steps:

  • Login to Orchestrator manually.
  • On top right corner, you should have a button with Intials of your name. Click on that and click your name.
  • It should redirect you to profile page.
  • Copy the tenantName and userName from this page.

Thanks @mahesh.kumar for your response. I found the username now. But even when i provide that username, it says “invalid credentials, failed to login”