{"_id":"58e4d5d3b9724d25001a3a82","category":{"_id":"58b04a023529383900a759b5","__v":0,"version":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-02-24T14:58:10.723Z","from_sync":false,"order":18,"slug":"telegram-messaging","title":"Telegram messaging"},"parentDoc":null,"user":"582ddb2f8653af2d00f5a9c5","project":"54eb50e5615ffc1900305a16","__v":0,"version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":28,"createdAt":"2015-02-23T17:30:32.501Z","releaseDate":"2015-02-23T17:30:32.501Z","categories":["54eb63b959b1172100334faf","54eb63b959b1172100334fb0","54eb63b959b1172100334fb1","54eb63b959b1172100334fb2","54ed8dd4ab373e2300f50eae","54ed99b2ab373e2300f50ede","55153a6de68daa2f00cff838","551546edbc466623002afe72","5515472ac28d6125001b8884","55154749c28d6125001b8885","555d9b4106dfec0d00d38ea7","5613e06e433e5735007c7708","5624bbb785a31117001c5403","56669e857cc81e0d00253f8e","568b8d837a42220d00498311","56a632277ef6620d00e2f18a","56d8147c3eb4dd0b00201aac","57a9ce2fac6db30e000d7efd","57a9cf4e944ea60e00dc3f74","58172386715dce0f00da4aa0","582dc59ee1b8692300c0dd03","589b19b4fec2730f0082e040","58b04a023529383900a759b5","58b92d1598157a0f004869bf","592e7685c58275000f20174f","59392839e376d4002f8a0474","59393064e376d4002f8a05a1","5947ae0d4005e2000f3a4fec","594a74df1d1de5001ab3517a","5954bc387a147f001b918915","59b8eeeb707542001076d3b6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-05T11:32:35.070Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"**Telegram messaging API** connects your CRM software, website or an application to the Telegram's messaging platform.\n\nIt enables direct communication with your customers on Telegram using the same platform that they already use when talking to their friends. It allows you to personally interact with them, keep them engaged with your business, and drive them to perform actions. The messages can be personal, informative, transactional, or promotional, and support text, images, buttons, and links.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Initial setup\",\n  \"body\": \"In order to start using an API for messaging you have to go through the initial setup which consists of:\\n1. [Sign up](https://telegram.org/) for Telegram using any application.\\n2. [Creating your Telegram Bot](#creating-your-telegram-bot)\\n3. [Registering the Telegram Bot on Infobip's platform](#registering-the-telegram-bot-on-infobips-platform)\\n3. [Setting up the configuration options for incoming messages](#configuration-process-for-receiving-messages)\"\n}\n[/block]\nBy using the Infobip API you can integrate your own solution for receiving and sending messages to your users by using two simple API methods:\n  * [Send message](/docs/send-telegram-message)\n  * [Receive message](/docs/receive-telegram-message)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Creating your Telegram Bot\"\n}\n[/block]\nThe first step in communicating with your users over Telegram is creating a **Telegram Bot**.\nBots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages. You control your Bots using our API methods; [Send message](/docs/send-telegram-message) and [Receive message](/docs/receive-telegram-message).\n\nTo create new Bots and manage existing ones, use the Telegram's **BotFather Bot** and follow a few simple steps. You can find the BotFather Bot by searching for it in Telegram Messenger App. \n\nOnce you've created a Bot and received your **Authorization Token**, you can proceed and register Your Bot on Infobip's platform.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Registering the Telegram Bot on Infobip's platform\"\n}\n[/block]\nRegistering of the Telegram Bot is done by creating an application on Infobip's platform that is associated with the Telegram Bot.\n\nA new application can be created with the single API call. Use **Authorization Token** from the previous step as a value of `authenticationToken` parameter.\n\nCreate an Infobip application request example:\n\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /telegram/1/applications HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n  \\\"telegram\\\": {\\n    \\\"bot\\\": {\\n      \\\"authenticationToken\\\": \\\"...\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n###Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"key\\\": \\\"8F0792F86035A9F4290821F1EE6BC06A\\\",\\n  \\\"telegram\\\": {\\n    \\\"bot\\\": {\\n      \\\"authenticationToken\\\":\\\"...\\\",\\n      \\\"id\\\": 1234,\\n      \\\"firstName\\\": \\\"First name\\\",\\n      \\\"lastName\\\": \\\"Last name\\\",\\n      \\\"username\\\": \\\"Username\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n**That's it!** You are now ready to send test messages over an API by performing a [Send message](/docs/send-telegram-message) API method. Before you can receive inbound messages you need to go through the [Configuration process for receiving messages](#configuration-process-for-receiving-messages).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configuration process for receiving messages\"\n}\n[/block]\nYou have successfully configured **message sending**, and now it's time to configure **message receiving** options:\n\n###Incoming message setup steps\n1. [**Configuration**](/docs/telegram-configuration) represents a container for a set of different Actions.\n2. [**Action**](/docs/telegram-action) represents collection of methods used to trigger different HTTP actions. Through the 'Action configuration' you can define how would you like to receive incoming messages - by Pull or Forward method.","excerpt":"","slug":"telegram-introduction-and-setup","type":"basic","title":"Introduction and setup"}

Introduction and setup


**Telegram messaging API** connects your CRM software, website or an application to the Telegram's messaging platform. It enables direct communication with your customers on Telegram using the same platform that they already use when talking to their friends. It allows you to personally interact with them, keep them engaged with your business, and drive them to perform actions. The messages can be personal, informative, transactional, or promotional, and support text, images, buttons, and links. [block:callout] { "type": "warning", "title": "Initial setup", "body": "In order to start using an API for messaging you have to go through the initial setup which consists of:\n1. [Sign up](https://telegram.org/) for Telegram using any application.\n2. [Creating your Telegram Bot](#creating-your-telegram-bot)\n3. [Registering the Telegram Bot on Infobip's platform](#registering-the-telegram-bot-on-infobips-platform)\n3. [Setting up the configuration options for incoming messages](#configuration-process-for-receiving-messages)" } [/block] By using the Infobip API you can integrate your own solution for receiving and sending messages to your users by using two simple API methods: * [Send message](/docs/send-telegram-message) * [Receive message](/docs/receive-telegram-message) [block:api-header] { "type": "basic", "title": "Creating your Telegram Bot" } [/block] The first step in communicating with your users over Telegram is creating a **Telegram Bot**. Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages. You control your Bots using our API methods; [Send message](/docs/send-telegram-message) and [Receive message](/docs/receive-telegram-message). To create new Bots and manage existing ones, use the Telegram's **BotFather Bot** and follow a few simple steps. You can find the BotFather Bot by searching for it in Telegram Messenger App. Once you've created a Bot and received your **Authorization Token**, you can proceed and register Your Bot on Infobip's platform. [block:api-header] { "type": "basic", "title": "Registering the Telegram Bot on Infobip's platform" } [/block] Registering of the Telegram Bot is done by creating an application on Infobip's platform that is associated with the Telegram Bot. A new application can be created with the single API call. Use **Authorization Token** from the previous step as a value of `authenticationToken` parameter. Create an Infobip application request example: ###Request example [block:code] { "codes": [ { "code": "POST /telegram/1/applications HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"telegram\": {\n \"bot\": {\n \"authenticationToken\": \"...\"\n }\n }\n}", "language": "json" } ] } [/block] ###Response [block:code] { "codes": [ { "code": "{\n \"key\": \"8F0792F86035A9F4290821F1EE6BC06A\",\n \"telegram\": {\n \"bot\": {\n \"authenticationToken\":\"...\",\n \"id\": 1234,\n \"firstName\": \"First name\",\n \"lastName\": \"Last name\",\n \"username\": \"Username\"\n }\n }\n}", "language": "json" } ] } [/block] **That's it!** You are now ready to send test messages over an API by performing a [Send message](/docs/send-telegram-message) API method. Before you can receive inbound messages you need to go through the [Configuration process for receiving messages](#configuration-process-for-receiving-messages). [block:api-header] { "type": "basic", "title": "Configuration process for receiving messages" } [/block] You have successfully configured **message sending**, and now it's time to configure **message receiving** options: ###Incoming message setup steps 1. [**Configuration**](/docs/telegram-configuration) represents a container for a set of different Actions. 2. [**Action**](/docs/telegram-action) represents collection of methods used to trigger different HTTP actions. Through the 'Action configuration' you can define how would you like to receive incoming messages - by Pull or Forward method.