-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add recipe for connecting Telegram's bot api with SAP CPI #9
base: master
Are you sure you want to change the base?
Conversation
Hello Raffael, Thank you for the commit. holiday season slows things down. Warm regards |
@@ -0,0 +1,37 @@ | |||
# Connect to Telegram Bot API (via Webhook) | |||
\| [Recipes by Topic](../../readme.md ) \| [Recipes by Author](../../author.md ) \| [Request Enhancement](https://github.com/SAP-samples/cloud-integration-flow/issues/new?assignees=&labels=Recipe%20Fix,enhancement&template=recipe-request.md&title=Improve%20Connect%20to%20Amazon%20DynamoDB ) \| [Report a bug](https://github.com/SAP-samples/cloud-integration-flow/issues/new?assignees=&labels=Recipe%20Fix,bug&template=bug_report.md&title=Issue%20with%20Connect%20to%20Amazon%20DynamoDB ) \| [Fix documentation](https://github.com/SAP-samples/cloud-integration-flow/issues/new?assignees=&labels=Recipe%20Fix,documentation&template=bug_report.md&title=Docu%20fix%20Connect%20to%20Amazon%20DynamoDB ) \| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please search and replace "Issue%20with%20Connect%20to%20Amazon%20DynamoDB" with "Connect%20to%20telegrambot%20via%20webhook
![Raffael Herrmann](https://github.com/codebude.png?size=50 )|[Raffael Herrmann](https://people.sap.com/r_herrmann)| | ||
----|----| | ||
|
||
Amazon DynamoDB is a fully managed non-relational database service that provides fast and predictable performance with seamless scalability. It is a schema-less database that only requires a table name and primary key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description needs to be modified to align with the recipe i.e., connecting to the telegram bot
Configure bot token in the IFlow via the configuration screen | Sample configuration: ![Telegram IFlow configuration screen](TelegramBot_Token_Connectivity_Snapshot.JPG) | The bot token is needed to identify yourself/target your bot via Telegram's api. | ||
Deploy the IFlow & register the webhook | `https://api.telegram.org/bot{telegram_api_token}/setWebhook?url=https://{cpi_user}:{cpi_pass}@{iflow_endpoint}` | Telegram needs to know where to push the message at, the users send to your bot. Replace the {pattern} parts of the url with actual values and call the url in a webbrowser. The {telegram_api_token} is the one you received from the botfather when initially setting up your bot. The {cpi_user} and {cpi_pass} are user credentials of a user which is able to access your interface. (I know, it seems like bad practice, but Telegram doesn’t support another way of accessing secured endpoints right now…). The {iflow_endpoint} is your IFlows "webhookhandler"-endpoint url, but without the trailing “https://” part. | ||
|
||
### Related Recipes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this section
## Sample Integration Flow | ||
![iflowimage](TelegramBot_IFlow_Snapshot.JPG) | ||
|
||
After you registered the Webhookhandler as described in step 2 of the recipe, your IFlow is triggered everytime a user sends a message to your Telegram bot. If a user sends the command `/start` he will be registered for the boardcast list. If a user sends `/stop` he will be removed from the broadcast list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move description above image, else it may get missed.
|
||
[Download the Sample Integration Flow](Telegram_to_CPI_WebhookHandler.zip) | ||
|
||
### Sample Output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this section
|
Dear @codebude Warm regards |
This PR contains a new recipe for connecting SAP CPI with Telegram's bot api. It should be handled as "Sample Integration Flow".