Is there any method to get message ids? I could not find it, give please an example
Class Message has a field id, which is a unique message identifier. Are you looking for something other?
https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1message.html
https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1messages.html#a3a118c30298a91c982b4ee91880e450f
Next, you need to set up a match between the template and the data.
Most helpful comment
https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1message.html
https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1messages.html#a3a118c30298a91c982b4ee91880e450f
Next, you need to set up a match between the template and the data.