Agents

List all agents data

GET
/api/agents/
curl -i https://api.revechat.com/api/agents/ -u john@example.com:123456 
curl -i https://api.revechat.com/api/agents?page_no=2 -u john@example.com:123456

Parameter

Field
Type
Description

page_no optional

Number

The requested page number.

Default value: 1

Success 200

Field
Type
Description

agent_id

Number

The agent's id.

first_name

String

The agent's first name.

last_name

String

The agent's last name.

email

String

The agent's login email.

phone_no

String

The agent's phone number.

role

String

The agent's role.

status

String

The current status (Online/Offline) of agent.

last_login_time

Number

The agent's last login time in epoch time in millisecond.

concurrent_chat_limit

Number

The agent's concurrent chat limit.

create_time

TimeStamp

The timestamp when the agent's created.

designation

String

The agent's designation.

additional_info

String

The agent's additional information.

enabled

Number

The status of agent's account.

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 02 Jun 2015 07:41:54 GMT
[
    {
        "agent_id": 463,
        "first_name": "John",
        "last_name": "Oliver",
        "email": "john@example.com",
        "phone_no": "-",
        "role": "Super Admin",
        "status": "Offline",
        "last_login_time": 1458635771085,
        "concurrent_chat_limit": 1,
        "create_time": 2015,
        "designation": "-",
        "additional_info": "-",
        "enabled": 1
    },
    {
        "agent_id": 516,
        "first_name": "pappu-admin",
        "last_name": "123456",
        "email": "pappu-admin@revechat.com",
        "phone_no": "12312312",
        "role": "Admin",
        "status": "Offline",
        "last_login_time": 1439717812324,
        "concurrent_chat_limit": 1,
        "create_time": 2015,
        "designation": "admin",
        "additional_info": "admin",
        "enabled": 1
    },
    {
        "agent_id": 465,
        "first_name": "nurnabi",
        "last_name": "Siddiquee",
        "email": "nurnabi-admin@revechat.com",
        "phone_no": "013235566",
        "role": "Admin",
        "status": "Offline",
        "last_login_time": 1443586115181,
        "concurrent_chat_limit": 1,
        "create_time": 2015,
        "designation": "1223",
        "additional_info": "12312",
        "enabled": 1
    },
    {
        "agent_id": 464,
        "first_name": "Arafat",
        "last_name": "Mahmud",
        "email": "arafat-agent@revechat.com",
        "phone_no": "012333333",
        "role": "Agent",
        "status": "Offline",
        "last_login_time": 1436423804033,
        "concurrent_chat_limit": 1,
        "create_time": 2015,
        "designation": "",
        "additional_info": "",
        "enabled": 1
    },
    {
        "agent_id": 466,
        "first_name": "Subrata",
        "last_name": "Pappu",
        "email": "pappu-agent@revechat.com",
        "phone_no": "018333106042",
        "role": "Agent",
        "status": "Offline",
        "last_login_time": 1444631497126,
        "concurrent_chat_limit": 1,
        "create_time": 2015,
        "designation": "",
        "additional_info": "test",
        "enabled": 1
    }
]

Error 4xx

Field
Description

Unauthorized

Provided credentials are not valid

Forbidden

Not permitted

InvalidPageNumber

Invalid Page Number (if the input is not any positive number value, such as, -2 )

HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
WWW-Authenticate: Basic realm="revechat"
Content-Type: application/json
Content-Length: 15
Date: Tue, 02 Jun 2015 07:47:13 GMT
Bad credentials

Get a single agent details

GET
/api/agents/{id}
curl -i https://api.revechat.com/api/agents/463 -u john@example.com:123456

Parameter

Field
Type
Description

id

Number

The agent's id

Success 200

Field
Type
Description

agent_id

Number

The agent's id.

first_name

String

The agent's first name.

last_name

String

The agent's last name.

email

String

The agent's login email.

phone_no

String

The agent's phone number.

role

String

The agent's role.

status

String

The current status (Online/Offline) of agent.

last_login_time

Number

The agent's last login time in epoch time in millisecond.

concurrent_chat_limit

Number

The agent's concurrent chat limit.

create_time

TimeStamp

The timestamp when the agent's created.

designation

String

The agent's designation.

additional_info

String

The agent's additional information.

enabled

Number

The status of agent's account.

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 02 Jun 2015 04:12:57 GMT
{
    "agent_id": 463,
    "first_name": "John",
    "last_name": "Oliver",
    "email": "john@example.com",
    "phone_no": "-",
    "role": "Super Admin",
    "status": "Offline",
    "last_login_time": 1458635771085,
    "concurrent_chat_limit": 1,
    "create_time": 2015,
    "designation": "-",
    "additional_info": "-",
    "enabled": 1
}

Error 4xx

Name
Description

AgentNotFound

The id of the Agent was not found.

InvalidAgentid

Invalid Agent id (if the input is not Valid number value, such as, -14 ).

HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 02 Jun 2015 05:28:57 GMT
{
    "error":
	    [	
		{
		"code":404,
		"message": "No Record found for Agent Id = 463. Please enter a another Agent Id."
		}
	    ]
}

Any questions? Please email us at support@revechat.com

Last updated