English
English
Appearance
English
English
Appearance
https://api.repliz.com/public/chat/{chatId}/actionShows or hides the typing indicator in a conversation, or marks the person's messages as seen.
Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Replizchat:write| Parameter | Type | Required | Description |
|---|---|---|---|
chatId | string | Yes | ID of the chat to send the action to, the _id from Get Chat. |
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | typing_on shows the typing indicator, typing_off hides it, and mark_seen marks the person's messages as seen and clears the unreadCount of the chat in Repliz. |
| Platform | typing_on | typing_off | mark_seen |
|---|---|---|---|
| Yes, until you send a message or for about 20 seconds | Yes | Yes | |
| Yes, until you send a message or for about 20 seconds | Yes | Yes | |
| TikTok | Yes, for 5 seconds | No | Yes |
| Telegram | Yes, for 5 seconds or until you send a message | Yes | Yes |
To keep the indicator on while you prepare a longer reply, send typing_on again before it runs out. typing_off on TikTok returns 400 typing_off is not supported on tiktok. When the platform refuses an action, for example outside its reply window, the request fails with the platform's error.
mark_seen only marks the messages on the platform; it doesn't change the status of any message in Repliz. To clear the unread count without the person seeing it, use Read Chat instead.
curl -X POST "https://api.repliz.com/public/chat/680affa5ce12f2f72916f67e/action" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{
"action": "typing_on"
}'import axios from 'axios';
const chatId = '680affa5ce12f2f72916f67e';
const response = await axios.post(
`https://api.repliz.com/public/chat/${chatId}/action`,
{ action: 'typing_on' },
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.status);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const chatId = '680affa5ce12f2f72916f67e';
const response = await fetch(`https://api.repliz.com/public/chat/${chatId}/action`, {
method: 'POST',
headers: {
Authorization: `Basic ${credentials}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ action: 'typing_on' }),
});
console.log(response.status);Show the typing indicator for a moment, then send the reply with Send Message. Sending the message hides the indicator.
const auth = { username: 'YOUR_ACCESS_KEY', password: 'YOUR_SECRET_KEY' };
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
async function reply(chatId, text) {
await axios.post(
`https://api.repliz.com/public/chat/${chatId}/action`,
{ action: 'mark_seen' },
{ auth },
);
await axios.post(
`https://api.repliz.com/public/chat/${chatId}/action`,
{ action: 'typing_on' },
{ auth },
);
await sleep(3000);
await axios.post(
`https://api.repliz.com/public/chat/${chatId}/message`,
{ type: 'text', text },
{ auth },
);
}// No content returned on success// action is not one of typing_on, typing_off, mark_seen
{
"code": 400,
"message": "action must be one of the following values: typing_on, typing_off, mark_seen"
}
// typing_off on TikTok
{
"code": 400,
"message": "typing_off is not supported on tiktok"
}{
"code": 404,
"message": "chat not found"
}{
"code": 401,
"message": "unauthorized"
}