Support Chat Guide v1
Support Chat
Version 1

List Salesforce unread chats

Copy link

Retrieves a list of unread chats in Salesforce. Displays up to a maximum of one week's worth of unread chats.


HTTP headers

Copy link

A typical HTTP request to the Calls API includes the following headers:

GET v3/salesforce_unread_chats/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: api-{application_id}.sendbird.com
Content-Type: application/json;charset=utf-8
Content-Length: length
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Api-Token: {sendbird_api_token}
...


Resource representation

Copy link

The following table shows the list of properties in an unread chat resource.

List of unread chat properties

Copy link
Property nameTypeDescription

last_agent

object

The information of the agent in the channel.

channel_url

string

The url of the channel.

last_agent_activity_ts

string

Return the timestamp of the last message sent by the agent in seconds (UTC). If the last message was sent by the customer, return 0.

last_customer_activity_ts

string

Return the timestamp of the last message sent by the customer in seconds (UTC). If the last message was sent by the agent, return 0.

created_at

string

The timestamp of when the tag was created in ISO 8601 format.

next

string

Given the following list, return a token value if an item exists in the list; otherwise, return null.


HTTP request

Copy link
GET https://api-{{app_id}}.sendbird.com/v3/salesforce_unread_chats/?user_type=agent&no_response_duration=14&limit=2

Parameters

Copy link

The following table lists the parameters that this action supports.

Optional
Parameter nameTypeDescription

user_type

string

Specifies whether the last user is an agent or a customer for search purposes. Acceptable values are customer and agent.

no_response_duration

int

Specifies the duration in minutes for which a chat has been left unread.

token

string

Specifies a page token that indicates the starting index of results to retrieve. If not specified, the index is set to 0.

limit

int

Specifies the number of bots to return per page. Acceptable values are 1 to 100, inclusive. (Default: 10)


Response

Copy link

If successful, this action returns a list of unread chats in the response body as shown below.

{
    "activities": [
        {
            "last_agent": {
                "nickname": "User",
                "guest_id": "salesforce-agent-0057X0000083gZjQAI"
            },
            "channel_url": "sendbird_group_channel_131705763_06a9f3330c17fa2a4ef558bc5f22f4a4266e5728",
            "last_agent_activity_ts": 1730977059,
            "last_customer_activity_ts": 0,
            "created_at": "2024-11-07T10:57:39Z"
        },
        {
            "last_agent": {
                "nickname": "User",
                "guest_id": "salesforce-agent-0057X0000083gZjQAI"
            },
            "channel_url": "sendbird_group_channel_131705763_948fe149473e6db3bb3c219b6dff6833fc57ad80",
            "last_agent_activity_ts": 1730971554,
            "last_customer_activity_ts": 0,
            "created_at": "2024-11-07T09:22:30Z"
        }
    ],
    "next": "Zh0RRFZTS11HFkBaWVNdfg"
}