The AWA (Advanced Work Assignment) Agent API provides endpoints to manage agent presence, channel availability, and workload.

This API requires the Advanced Work Assignment (com.glide.awa) plugin and the awa_integration_user role. For more information, refer to Advanced Work Assignment.

AWA Agent - GET /now/awa/agents/{user_id}

Returns the current agent presence state and channel availability.

URL format

Versioned URL: /api/now/{api_version}/awa/agents/{user_id}

Default URL: /api/now/awa/agents/{user_id}

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 1. Path parameters
Name Description
api_version Optional. 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

user_id Sys_id of the work item.
The work item must meet the following criteria:
  • Work item must be assigned to the specified agent.
  • Work item must be in Pending Accept state.

Data type: String

Table: AWA Work Item [awa_work_item]

Table 2. Query parameters
Name Description
None
Table 3. Request body parameters (XML or JSON)
Header Description
presence.channels.available Flag that indicates whether the channel is available.
Possible values:
  • true: Channel is available.
  • false: Channel isn't available.

Data type: Boolean

presence.channels.sys_id Channel sys_id.

Data type: String

Table: Service Channels [awa_service_channel]

presence.sys_id Presence state sys_id.

Data type: String

Table: Presence States [awa_presence_state]

Headers

The 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.

Table 4. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

Content-Type Data format of the request body. Supported types: application/json or application/xml.

Default: application/json

Table 5. Response headers
Header Description
None

Status codes

The 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.

Response body parameters (JSON or XML)

Example: Sample cURL request

curl -X GET \
https://instance.servicenow.com/api/now/awa/agents/46d44a23a9fe19810012d100cca80666 \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u 'username':'password'\
{
  "result": {
    "presence": {
      "name": "Available",
      "sys_id": "0b10223c57a313005baaaa65ef94f970",
      "available": true,
      "channels": [
        {
          "name": "Chat",
          "available": true,
          "sys_id": "27f675e3739713004a905ee515f6a7c3"
        }
      ]
    },
    "sys_id": "46d44a23a9fe19810012d100cca80666"
  }
}

AWA Agent - GET /now/awa/agents/{user_id}/capacities

Returns an agent's channel capacities, universal capacity, and the current workload to see if the agent can handle a case.

Use the AWA Agent - PUT /now/awa/agents/{user_id}/capacities method to modify the channel and universal capacities of an agent.

URL format

Versioned URL: /api/now/{api_version}/awa/agents/{user_id}/capacities

Default URL: /api/now/awa/agents/{user_id}/capacities

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 8. Path parameters
Name Description
api_version Optional. 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

user_id Sys_id of the agent listed.

Data type: String

Table: User [sys_user]

Table 9. Query parameters
Name Description
None
Table 10. Request body parameters (XML or JSON)
Name Description
None

Headers

The 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.

Table 11. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

Table 12. Response headers
Header Description
None

Status codes

The 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.

Response body parameters (JSON or XML)

Example: Sample cURL request

The following example shows how to get the capacity and workload values for a user.

curl "https://instance.service-now.com/api/now/awa/agents/46d44a23a9fe19810012d100cca80666/capacities" \
--request GET \
--header "Accept:application/json" \
--user 'username':'password'

A successful response includes capacity values and workload for each channel.

{
  "result": {
    "universal_workload": 2,
    "channels": [
      {
        "channel_sys_id": "27f675e3739713004a905ee515f6a7c3",
        "current_workload": 2,
        "max_capacity": 4
      }
    ],
    "universal_capacity": 10
  }
}

AWA Agent - GET /now/awa/agents/{user_id}/presence_states

Returns an agent's presence states and indicates whether the agent is available or in another presence state.

URL format

Versioned URL: /api/now/{api_version}/awa/agents/{user_id}/presence_states

Default URL: /api/now/awa/agents/{user_id}/presence_states

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 14. Path parameters
Name Description
api_version Optional. 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

user_id Sys_id of the agent listed.

Data type: String

Table: User [sys_user]

Table 15. Query parameters
Name Description
None
Table 16. Request body parameters (XML or JSON)
Name Description
None

Headers

The 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.

Table 17. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

Table 18. Response headers
Header Description
None

Status codes

The 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.

Response body parameters (JSON or XML)

Example: Sample cURL request

The following example shows how to get the presence states for a specified agent.

curl "https://instance.service-now.com/api/now/awa/agents/46d44a23a9fe19810012d100cca80666/presence_states" \
--request GET \
--header "Accept:application/json" \
--user 'username':'password'

The response body lists the agent's possible presence states and indicates that the agent is available.

{
  "result": [
    {
      "name": "Available",
      "order": 0,
      "show_channels": false,
      "sys_id": "0b10223c57a313005baaaa65ef94f970",
      "available": true,
      "channels": [
        {
          "name": "Chat",
          "available": true,
          "sys_id": "27f675e3739713004a905ee515f6a7c3",
          "restrict_update": false,
          "service_channel_type": "chat"
        }
      ],
      "disable_inactivity_check": false
    },
    {
      "name": "Away",
      "order": 1000,
      "show_channels": false,
      "sys_id": "41f9b8dfb31313005baa6e5f26a8dcac",
      "available": false,
      "channels": [],
      "disable_inactivity_check": false
    },
    {
      "name": "Offline",
      "order": 2000,
      "show_channels": false,
      "sys_id": "9cd83267575313005baaaa65ef94f98b",
      "available": false,
      "channels": [],
      "disable_inactivity_check": false
    }
  ]
}

AWA Agent - PUT /now/awa/agents/{user_id}

Sets the state of a specified agent’s presence and, if provided, sets the agent’s channel availability for that state.

URL format

Versioned URL: /api/now/{api_version}/awa/agents/{user_id}

Default URL: /api/now/awa/agents/{user_id}

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 20. Path parameters
Name Description
api_version Optional. 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

user_id Sys_id of the agent.

Data type: String

Table: User [sys_user]

Table 21. Query parameters
Name Description
None

Headers

The 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.

Table 23. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

Content-Type Data format of the request body. Supported types: application/json or application/xml.

Default: application/json

Table 24. Response headers
Header Description
None

Status codes

The 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.

Example

curl -X PUT \
 https://instance.servicenow.com/api/now/awa/agents/46d44a23a9fe19810012d100cca80666 \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u 'username':'password'\
-d '{"presence": {\
  "sys_id": "0b10223c57a313005baaaa65ef94f970",\
  "channels": [{ \
  "sys_id": "0bbdedbb3b892300a2bac9bb34efc445",\
  "available": true
}] 
}}
{
  "result": {
    "presence": {
      "name": "Available",
      "sys_id": "0b10223c57a313005baaaa65ef94f970",
      "available": true,
      "channels": [
        {
          "name": "Chat",
          "available": true,
          "sys_id": "27f675e3739713004a905ee515f6a7c3"
        }
      ]
    },
    "sys_id": "46d44a23a9fe19810012d100cca80666"
  }
}

AWA Agent - PUT /now/awa/agents/{user_id}/capacities

Enables updating an agent's maximum capacity (workload) for channel capacities and universal capacity.

Use the AWA Agent - GET /now/awa/agents/{user_id}/capacities method to retrieve the current channel and universal capacities of an agent.

URL format

Versioned URL: /api/now/{api_version}/awa/agents/{user_id}/capacities

Default URL: /api/now/awa/agents/{user_id}/capacities

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 27. Path parameters
Name Description
api_version Optional. 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

user_id Sys_id of the agent listed.

Data type: String

Table: User [sys_user]

Table 28. Query parameters
Name Description
None
Table 29. Request body parameters (XML or JSON)
Name Description
channels Mandatory if updating the maximum value of one or more channels for the specified agent. JSON object containing one or more key-value pairs mapping the channel to its maximum capacity for each channel assigned to the agent.

Data type: Object

The pair is in the following format:
  • Key (channel sys_id) – Channel sys_id.

    Data type: String

  • Value (maximum capacity) – Maximum workload on a specific service channel that the agent can be actively assigned to at a time.

    Data type: Number

channels: {"<channel_sys_id>": <max_capacity>}
universal_capacity Mandatory if universal capacity is being updated. Maximum capacity for the agent across all service channels. If an agent's current workload equals the maximum universal capacity, additional work items won't be assigned to the agent.

Data type: Number

Headers

The 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.

Table 30. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

Table 31. Response headers
Header Description
None

Status codes

The 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.

Table 32. Status codes
Status code Description
200 Successful. The request was successfully processed.
400 Bad Request. A bad request type or malformed request was detected.
404 Not found. The requested item wasn't found.

Response body parameters (JSON or XML)

Example: Sample cURL request

The following example shows how to change the agent's universal capacity and the maximum capacity for a specified channel.

curl "https://instance.service-now.com/api/now/awa/agents/46d44a23a9fe19810012d100cca80666/capacities" \
--request PUT \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
 \"channels\": { \"27f675e3739713004a905ee515f6a7c3\": 6 },
 \"universal_capacity\" : 12
}" \
--user 'username':'password'

A successful response includes the updated capacity values.

{
  "result": {
    "channels": [
      {
        "channel_sys_id": "27f675e3739713004a905ee515f6a7c3",
        "max_capacity": 6
      }
    ],
    "universal_capacity": 12
  }
}