List
To list the chat messages for a concrete room you need to execute a GET request against the /rooms/:id/chat endpoint.
Since potentially there could be thousands of messages, pagination is supported with limit, order and after arguments. Read about pagination to learn the details of it. By default maximum 100 chat messages will be returned in the response.
Request
curl --request GET \
--url https://api.digitalsamba.com/api/v1/rooms/c39d7c40-7ff7-4faa-b06f-698a639a9523/chat \
--user YOUR_TEAM_ID:YOUR_DEVELOPER_KEYimport com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.util.Base64;
import java.util.Map;
String TEAM_ID = "YOUR_TEAM_ID";
String DEVELOPER_KEY = "YOUR_DEVELOPER_KEY";
String authorizationHeader = "Bearer " + Base64.getEncoder().encodeToString((TEAM_ID + ":" + DEVELOPER_KEY).getBytes());
//Put your room id or friendly_url (name) here - this value is just an example
String roomId = "c39d7c40-7ff7-4faa-b06f-698a639a9523";
HttpRequest request = HttpRequest.newBuilder()
.GET()
.uri(new URI("https://api.digitalsamba.com/api/v1/rooms/" + roomId + "/chat"))
.header("Authorization", authorizationHeader)
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
System.out.println("Status code: " + response.statusCode());
System.out.println("Body: " + response.body());Response (200 OK)
{
"total_count": 6124,
"data": [
{
"id": "87664473-9064-4179-935e-ce78af687bef",
"message": "Hello!",
"participant_id": "77836281-486c-4d49-ba07-c66c87452256",
"external_participant_id": "ABCDEF",
"participant_name": "Cillian Doe",
"created_at": "2024-03-13T14:10:22Z"
},
{
"id": "eccf427e-9fa3-481d-912b-f35c15473a46",
"message": "dfdsf",
"participant_id": "722d9849-e94f-4cba-903a-9e8e61d8d861",
"participant_name": "John Smith",
"created_at": "2024-03-09T11:32:30Z"
},
...............98 more chat messages...............
]
} Last updated