HTTP header parameters
Developers must verify the timestamp and sign in the header to determine whether the request is a legitimate request from DingTalk. This prevents malicious parties from impersonating DingTalk to call the developer’s HTTPS service and send data. The verification logic is as follows:
- If the timestamp differs from the current system timestamp by more than 1 hour, the request is considered invalid.
- If the sign does not match the value calculated by the developer, the request is considered invalid.
How to calculate the sign
Use the timestamp from the header + “\n” + the bot’s appSecret as the string to sign. Calculate the signature using the HmacSHA256 algorithm, then Base64-encode the result to obtain the final signature value. Sample signature calculation code (Java)HTTP Body
Parameter description
Supported message types for receiving
Bots currently support receiving text, voice, image, file, video, and rich text messages. The following tables explain the fields for each type of message that the bot receives. Apart from the message type and message body fields, all other parameter fields are the same as in the table above.Important
- In a group chat: when group members @mention the bot, the bot does not support receiving voice, file, or video types.
- In a person-to-person chat: the bot does not support receiving voice, file, or video types.
- In a person-to-bot chat: the bot supports receiving voice, file, and video types.