Muting or Unmuting Telegram Notifications for Users

In some instances, you need to mute broadcasts for Telegram users having a dialog with the bot or an operator to avoid interruptions. And when required, the messaging shall be unmuted.

In our platform, these can be done for users with Telegram tokens. The feature is implemented through two API endpoints described below.

Muting Notifications

To mute notifications, send requests to the following endpoint:

  • POST /v1/apps/{app_uuid}/token/mute

📘

NOTE

Muted users or chats can receive transactional messages (smartsend, test).

The method’s parameters and their description are given in the following table.

ParameterTypeDescription
tokenstringRequired. User’s Telegram token.
durationlongOptional. Mute duration in seconds: The minimum value is 5 seconds. The maximum value is 31,536,000 seconds (approximately 1 year). If the duration is not specified, mute is set to 9999-12-31 23:59:59, disabling notifications "forever". To change the mute duration, send another request with the new value.

The response may return the following errors listed in the table.

StatusError message
400Wrong app uuid
400Tokens must be specified
400Duration must be positive int
404Not registered application

The muted contacts in the campaign reports are shown as Unavailable contacts with Other errors as the error type.

The error name in the details is CHANNEL_WAS_MUTED.

Unmuting Notifications

To unmute notifications, send requests to the following endpoint:

  • POST /v1/apps/{app_uuid}/token/unmute

The request must contain the following parameter:

ParameterTypeDescription
tokenstringRequired. User’s Telegram token.

The response may return the following errors listed in the table.

StatusError message
400Wrong app uuid
400Tokens must be specified
404Not registered application