This is a full functional example of telegram with Nettalk, need jfiles, very important telegram only run with https so you need a secure server for test your program.
The other part is with telegram you need create a bot with Bot Father for create your bot and obtain the Api key is very simple, after create your bot you can obtain the API key
Then you need to indicate telegram your webhook address with this url:
https://api.telegram.org/bot<yourApitoken>/setWebhook?url=https://<YourURL>/hook <--your procedure name
Then call a bot and test the response, the example find by customer id.