Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codebude
Copy link
Contributor

This PR contains a new recipe for connecting SAP CPI with Telegram's bot api. It should be handled as "Sample Integration Flow".

@aadinigam
Copy link
Contributor

Hello Raffael,
Season Greetings and a Happy new year to you!!!

Thank you for the commit. holiday season slows things down.
We appreciate your contribution and we will follow this up

Warm regards
aadi

@@ -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 ) \|
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this section

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@aadinigam
Copy link
Contributor

Dear @codebude
We have moved from CLA to DCO. Request you to please accept this agreement so that we can merge this into our repo.

Warm regards
aadi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants