{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":533,"path":"api-reference/rest-apis/queue-api.md","title":"AWA Routing API","bundle":null,"doc_type":null,"release":"australia","body":"\n# AWA Routing API\n\nThe AWA Routing API provides endpoints to route a document to a queue.\n\nThis API requires the Advanced Work Assignment plugin \\(com.glide.awa\\) and the awa\\_integration\\_user role.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## AWA Routing - POST /now/awa/queues/\\{queue\\_sys\\_id\\}/work\\_item\n\nIf an active work item exists, routes a document to a queue. If an active work item does not exist for the specified document, creates a work item and set its fields accordingly.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/awa/queues/{queue_sys_id}/work_item`\n\nDefault URL: `/api/now/awa/queues/{queue_sys_id}/work_item`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\nqueue\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the queue record.Data type: String\n\nTable: Queue \\[awa\\_queue\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndocument\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the document to route to the queue.Data type: String\n\n</td></tr><tr><td>\n\ndocument\\_table\n\n</td><td>\n\nName of the table associated with the document, such as incident.Data type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|404|Not found. The requested item wasn't found.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndisplay\\_name\n\n</td><td>\n\nName of the document to route by this work item, such as case record.Data type: String\n\n</td></tr><tr><td>\n\ndocument\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the document to route to the queue.Data type: String\n\n</td></tr><tr><td>\n\ndocument\\_table\n\n</td><td>\n\nName of the table associated with the document.Data type: String\n\n</td></tr><tr><td>\n\nqueue\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the queue on which to route a document.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td>\n\nSys\\_id of the work item assigned to the queue.Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl -X POST \\\n  https://instance.servicenow.com/api/now/awa/queues/339eed3f3b892300a2bac9bb34efc4c3/work_item \\\n-H 'Content-Type: application/json' \\\n-H 'Accept: application/json' \\\n-u 'username':'password'\n-d '{\n  \"document_sys_id\": \"9c573169c611228700193229fff72400\",\n  \"document_table\": \"incident\"\n}'\n```\n\n```\n{\n  \"result\": {\n    \"sys_id\": \"cd57f90ddbb26300db2051735e9619f0\",\n    \"document_table\": \"incident\",\n    \"document_sys_id\": \"9c573169c611228700193229fff72400\",\n    \"queue_sys_id\": \"339eed3f3b892300a2bac9bb34efc4c3\",\n    \"display_name\": \"Incident: INC0000001\"\n  }\n}\n```\n\n"}}