Telegram Firefox



Check Your Internet. Although Telegram web doesn’t rely on the Telegram mobile app on your.

  1. Note that you need an existing account to log in to Telegram Web. To sign up for Telegram, use one of our mobile apps. Keys are only generated once. This can take a few minutes on slower devices, please be patient. Welcome to the official Telegram web-client.
  2. 4 - Deprecated: Simple push (endpoint for firefox's simple push API) 5 - Ubuntu phone (token for ubuntu push) 6 - Blackberry (token for blackberry push) 7 - MTProto separate session; 8 - WNS (windows push) 9 - APNS VoIP (token for apple push VoIP) 10 - Web push (web push, see below) 11 - MPNS VoIP (token for microsoft push VoIP) 12 - Tizen.

Configuring the application

To be able to send APNS notifications to Apple servers or GCM notifications to Google servers, application certificates (APNS) or an application key (GCM) must be specified in the application settings.

Subscribing to notifications

To subscribe to notifications, the client must invoke the account.registerDevice query, passing in token_type and token as parameters that identify the current device. It is useful to repeat this query at least once every 24 hours or when restarting the application. Use account.unregisterDevice to unsubscribe.

The following modes are supported:

  • 1 - APNS (device token for apple push)
  • 2 - FCM (firebase token for google firebase)
  • 3 - MPNS (channel URI for microsoft push)
  • 4 - Deprecated: Simple push (endpoint for firefox's simple push API)
  • 5 - Ubuntu phone (token for ubuntu push)
  • 6 - Blackberry (token for blackberry push)
  • 7 - MTProto separate session
  • 8 - WNS (windows push)
  • 9 - APNS VoIP (token for apple push VoIP)
  • 10 - Web push (web push, see below)
  • 11 - MPNS VoIP (token for microsoft push VoIP)
  • 12 - Tizen (token for tizen push)

For 10 web push, the token must be a JSON-encoded object with the following keys:

  • endpoint: Absolute URL exposed by the push service where the application server can send push messages
  • keys: P-256 elliptic curve Diffie-Hellman parameters in the following object
    • p256dh: Base64url-encoded P-256 elliptic curve Diffie-Hellman public key
    • auth: Base64url-encoded authentication secret

Notification encryption

For FCM and APNS VoIP, an optional encryption key used to encrypt push notifications can be passed to account.registerDevice (secret). This key (auth_key) is used to encrypt the payloads using MTProto v2.

The FCM payload will be a JSON payload, containing a p field with the base64-encoded encrypted MTProto payload. After decryption, the result will be a JSON object, prefixed by a 32-bit little-endian integer with the length of the JSON payload. As usual, make sure to follow all security checks as described in the MTProto docs.

Example implementation.

As mentioned above, payloads can also be encrypted using P-256 Elliptic Curve Diffie-Hellman when using web push.

Notification structure

Firefox Telegram Dark Mode

An (optionally encrypted) notification is provided as a JSON object in the following format:

Each notification has several parameters that describe it.

Notification type

Telegram Firefox App

Telegram

data.loc_key - A string literal in the form /[A-Z_0-9]+/, which summarizes the notification. For example, CHAT_MESSAGE_TEXT.

Notification text arguments

data.loc_args - A list or arguments which, when inserted into a template, produce a readable notification.

Custom parameters

data.custom - Parameters which are be passed into the application when a notification is opened.

Sound

data.sound - The name of an audio file to be played.

User id

data.user_id - ID of the account to which the PUSH notification should be delivered, in case of clients with multiple accounts active and running.

Processing notifications

In principle, data.loc_key, data.custom, and an Internet connection are sufficient to generate a notification. Obviously, if possible, when generating a visual notification you need not use all of the transmitted data and may rely on the information already stored on the client. But if a user or a chat is not cached locally, the values passed in loc_args may also be used. data.user_id is the ID of the account to which the PUSH notification should be delivered, in case of clients with multiple accounts active and running.

Telegram Mozilla Firefox

Service notifications

The following notifications can be used to update app settings.

Telegram Firefox Extension

TypeExtra custom argumentsDescription
DC_UPDATEdc - number of the1. User name
2. Message body
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_TEXT{1} pinned '{3}' in the group {2}1. User name
2. Group name
3. Message body
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_NOTEXT{1} pinned a message1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_NOTEXT{1} pinned a message in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_PHOTO{1} pinned a photo1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_PHOTO{1} pinned a photo in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_VIDEO{1} pinned a video1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_VIDEO{1} pinned a video in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_ROUND{1} pinned a video message1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_ROUND{1} pinned a video message in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_DOC{1} pinned a file1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_DOC{1} pinned a file in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_STICKER{1} pinned a {2}sticker1. User name
2. Sticker emoji with included trailing space or empty string
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_STICKER{1} pinned a {3}sticker in the group {2}1. User name
2. Group name
3. Sticker emoji with included trailing space or empty string
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_AUDIO{1} pinned a voice message1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_AUDIO{1} pinned a voice message in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_CONTACT{1} pinned a contact {2}1. User name
2. Contact name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_CONTACT{1} pinned a contact {3} in the group {2}1. User name
2. Group name
3. Contact name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEO{1} pinned a map1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEO{1} pinned a map in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEOLIVE{1} pinned a live location1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEOLIVE{1} pinned a live location in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_POLL{1} pinned a poll {2}1. User name
2. Poll name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_POLL{1} pinned a poll {3} in the group {2}1. User name
2. Group name
3. Poll name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_QUIZ{1} pinned a quiz {2}1. User name
2. Quiz name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_QUIZ{1} pinned a quiz {3} in the group {2}1. User name
2. Group name
3. Quiz name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME{1} pinned a game1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME{1} pinned a game in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME_SCORE{1} pinned a game score1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME_SCORE{1} pinned a game score in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_INVOICE{1} pinned an invoice1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_INVOICE{1} pinned an invoice in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GIF{1} pinned a GIF1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GIF{1} pinned a GIF in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
CONTACT_JOINED{1} joined Telegram!1. Contact namecontact_id: contact identifier
AUTH_UNKNOWNNew login from unrecognized device {1}1. Device name
AUTH_REGIONNew login from unrecognized device {1}, location: {2}1. Device name
2. Location
ENCRYPTION_REQUESTYou have a new messageencryption_id: secret chat identifier
ENCRYPTION_ACCEPTYou have a new messageencryption_id: secret chat identifier
ENCRYPTED_MESSAGEYou have a new messageencryption_id: secret chat identifier
random_id: message identifier
LOCKED_MESSAGEYou have a new message
PHONE_CALL_REQUEST{1} is calling you!1. User namecall_ah: Call access hash
call_id: Call ID
PHONE_CALL_MISSEDYou missed a call from {1}1. User name
MESSAGE_ANNOUNCEMENT{1}1. Announcementannouncement: Announcement: roughly equivalent to a message received from the service notifications (Telegram Notifications, id 777000) user, but must be delivered via push notifications, without contacting the API.