Get Agents

Get all agents with pagination, filter, and sort

Resource

https://api.infobip.com/ccaas/agents

Query Params

Property name Type Description
limit int (10) Size of the result page
page int (0) Index of the result page
orderBy array_string (2) property, direction(ASC, DESC)
queueIds array_string optional filter
userIds array_string
optional filter
displayName string
optional filter
status string optional filter ACTIVE, BUSY, OFFLINE, AWAY
role string optional filter AGENT, SUPERVISOR
enabled boolean optional filter
createdBefore datetime optional filter (yyyy-MM-dd'T'HH:mm:ss.SSSZ)
createdAfter datetime optional filter (yyyy-MM-dd'T'HH:mm:ss.SSSZ)
updatedBefore datetime optional filter (yyyy-MM-dd'T'HH:mm:ss.SSSZ)
updatedAfter datetime optional filter (yyyy-MM-dd'T'HH:mm:ss.SSSZ)

Request Example

					GET /ccaas/1/agents HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
					
				

Response

					{
    "agents": [
        {
            "id": "9030551F327704A0F262995A1A4B4596",
            "displayName": "Malcolm Young",
            "status": "OFFLINE",
            "role": "AGENT",
            "enabled": true,
          	"createdAt": "2019-05-10T07:45:23.777+0000",
            "updatedAt": "2019-05-10T09:53:58.463+0000"
        },
        {
            "id": "97457D13B1FC79AF3C1A1096AE7E77AB",
            "displayName": "Angus Young",
            "status": "AVAILABLE",
            "role": "SUPERVISOR",
            "enabled": true,
          	"createdAt": "2019-05-10T07:45:23.777+0000",
            "updatedAt": "2019-05-10T09:53:58.463+0000"
        },
        {
            "id": "E83E787CF2613450157ADA3476171E3F",
            "displayName": "Bon Scott",
            "status": "OFFLINE",
            "role": "AGENT",
            "enabled": true,
          	"createdAt": "2019-05-10T07:45:23.777+0000",
            "updatedAt": "2019-05-10T09:53:58.463+0000"
        },
        {
            "id": "F66D67327326FCCB027BEAA916B94542",
            "displayName": "Phil Rudd",
            "status": "AVAILABLE",
            "role": "AGENT",
            "enabled": true,
          	"createdAt": "2019-05-10T07:45:23.777+0000",
            "updatedAt": "2019-05-10T09:53:58.463+0000"
        },
        {
            "id": "F66D67327326FCCB027BEAA916B94542",
            "displayName": "Brian Johnson",
            "status": "AVAILABLE",
            "role": "AGENT",
            "enabled": true,
          	"createdAt": "2019-05-10T07:45:23.777+0000",
            "updatedAt": "2019-05-10T09:53:58.463+0000"
        },
        {
            "id": "7E77AB97457D13B1FC79AF3C1A1096AE7E77AB",
            "displayName": "Neil Young",
            "status": "ACTIVE",
            "role": "AGENT",
            "enabled": false,
          	"createdAt": "2019-03-10T07:45:44.744+0000",
            "updatedAt": "2019-03-10T09:33:58.374+0000"
        }
    ],
    "pagination": {
        "totalItems": 6,
        "page": 0,
        "limit": 10,
        "orderBy": "id:ASC"
    }
}
					
				
					{
    "statusCode": "ERROR",
    "message": "Page size must not be less than one!"
}
					
				

Use this method to get a list of agents with pagination and filtering option. Using a filter is optional. The result can be filtered by one or many optional filters described in parameters.

Parameters

Property name Type Description
limit integer Size of the result page. If a limit count is given, no more than that many rows will be returned (but possibly less, if the query itself yields fewer rows). The default value is 10, the max value is 999.
page integer This parameter says to skip that many rows before beginning to return rows. If both page and limit appear, then page rows are skipped before starting to count the limit rows that are returned. The default value is 0.
orderBy string This parameter is used to order your results. If an order is not given, the default order id:asc will be applied. Possible ordering fields are properties. Ordering direction can be specified with modifiers asc for the ascending ordering or desc for the descending one.
queueIds array of strings Optional filter. List of queues Id to match result.
userIds array_string
optional filter
displayName string
Optional filter. Agent displayName to match result. This is case insensitive and will search for substring anywhere within string, 255 characters max.
status string Optional filter. Match any of status with the result. Possible values: ACTIVE, BUSY, OFFLINE, AWAY.
role string [Optional filter. Match any of role with the result. Possible values: AGENT, SUPERVISOR.](http://google.com) 
enabled boolean Optional filter. Match any of enabled with the result. Possible values: TRUE, FALSE
createdBefore datetime Optional filter. Filter result with created after dateTime. Format: yyyy-MM-dd'T'HH:mm:ss.SSSZ
createdAfter datetime optional filter (yyyy-MM-dd'T'HH:mm:ss.SSSZ)
updatedBefore datetime optional filter (yyyy-MM-dd'T'HH:mm:ss.SSSZ)
updatedAfter datetime optional filter (yyyy-MM-dd'T'HH:mm:ss.SSSZ)

Additional Example:

Request example:
Searching for agents with displayName "young", role "AGENT",  and created before 22.05.2019. The result must be sorted by date of agent creation in ascending order.
NOTE: Filtering by displayName will filter any agent contains "young" anywhere in displayName ignoring case.

GET /ccaas/1/agents?displayName=young&role=AGENT&createdAfter=2019-04-16T12:04:38.815+0000&orderBy=createdAt:asc HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==	
  

Response:

{
    "agents": [
        {
            "id": "9030551F327704A0F262995A1A4B4596",
            "displayName": "Malcolm Young",
            "status": "OFFLINE",
            "role": "AGENT",
            "enabled": true,
          	"createdAt": "2019-05-10T07:45:23.777+0000",
            "updatedAt": "2019-05-10T09:53:58.463+0000"
        },
        {
            "id": "7E77AB97457D13B1FC79AF3C1A1096AE7E77AB",
            "displayName": "Neil Young",
            "status": "ACTIVE",
            "role": "AGENT",
            "enabled": false,
          	"createdAt": "2019-03-11T07:45:44.744+0000",
            "updatedAt": "2019-03-12T09:33:58.374+0000"
        }
    ],
    "pagination": {
        "totalItems": 2,
        "page": 0,
        "limit": 10,
        "orderBy": "createdAt:ASC"
    }
}