Updated on 2025-11-13 GMT+08:00

Receiving a Telegram Message

Scenario

This interface is invoked to receive a Telegram message.

Method

POST

URI

https://Domain name/apiaccess/api/telegram/message/{chanId} (For example, the domain name is service.besclouds.com.)

Table 1 URI parameter

No.

Parameter

Type

Mandatory or Not

Description

1

chanId

String

No

Channel ID

Request Description

Table 2 Request parameters

No.

Parameter

Type

Mandatory or Not

Description

1

requestBody

Object

No

Request body in JSON format

1.1

update_id

Number

No

Unique update ID

1.2

message

Object

No

Message body in JSON format

1.2.1

message_id

Number

No

Unique message ID

1.2.2

from

Object

No

Sender information in JSON format

1.2.2.1

id

Number

No

Sender ID

1.2.2.2

is_bot

Boolean

Yes

Whether the sender is the chatbot

1.2.2.3

first_name

String

No

Name

1.2.2.4

username

String

No

Username

1.2.2.5

language_code

String

No

User language ID

1.2.3

chat

Object

No

Dialog to which the message belongs

1.2.3.1

id

Number

Yes

Message ID

1.2.3.2

first_name

String

No

Name

1.2.3.3

username

String

No

Username

1.2.3.4

type

String

No

Message type

1.2.4

date

Number

No

Sending time

1.2.5

photo

Array [Object]

No

Image array

1.2.5.1

file_id

String

No

Image ID

1.2.5.2

file_unique_id

String

No

Unique image ID

1.2.5.3

file_size

Number

No

Image size

1.2.5.4

width

Number

No

Width

1.2.5.5

height

Number

No

Height

1.2.6

text

String

No

Text message content

1.2.7

voice

Object

No

Audio information in JSON format

1.2.7.1

duration

Number

No

Audio duration

1.2.7.2

mime_type

String

No

Audio MIME type

1.2.7.3

file_id

String

No

Audio ID

1.2.7.4

file_unique_id

String

No

Unique audio ID

1.2.7.5

file_size

Number

No

Audio size

1.2.8

video

Object

No

Video information in JSON format

1.2.8.1

duration

Number

No

Video duration

1.2.8.2

width

Number

No

Width

1.2.8.3

height

Number

No

Height

1.2.8.4

file_name

String

No

Video name

1.2.8.5

mime_type

String

No

Video MIME type

1.2.8.6

thumb

Object

No

Video thumbnail information in JSON format

1.2.8.6.1

file_id

String

No

Thumbnail ID

1.2.8.6.2

file_unique_id

String

No

Unique thumbnail ID

1.2.8.6.3

file_size

Number

No

Thumbnail size

1.2.8.6.4

width

Number

No

Thumbnail width

1.2.8.6.5

height

Number

No

Thumbnail height

1.2.8.7

file_id

String

No

Video ID

1.2.8.8

file_unique_id

String

No

Unique video ID

1.2.8.9

file_size

Number

No

Video size

1.2.9

forward_from

Object

No

Original message information in JSON format. This parameter applies to forwarded messages.

1.2.9.1

id

Number

No

Message ID

1.2.9.2

is_bot

Boolean

No

Whether the forwarder is the chatbot

1.2.9.3

first_name

String

No

Name

1.2.9.4

username

String

No

Username

1.2.9.5

language_code

String

No

User language ID

1.2.10

forward_date

Number

No

Time when the original message is sent. This parameter applies to forwarded messages.

Response Description

  • Status code: 200
  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • Status code: 401

    Unauthorized operation. 1. Check whether you have purchased related services. 2. Contact customer service to check the status of your account.

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

Request parameters:

{
    "update_id": 731746899,
    "message": {
        "message_id": 15,
        "from": {
            "id": 5903736207,
            "is_bot": false,
            "first_name": "TianWe",
            "username": "tianwe3263",
            "language_code": "zh-hans"
        },
        "chat": {
            "id": 5903736207,
            "first_name": "TianWe",
            "username": "tianwe3263",
            "type": "private"
        },
        "date": 1671505017,
        "text": "."
    }
}

Response parameters:

{"resultMsg": "200"}