Telegram Integration with Oracle

 How to Integrate Telegram with Oracle Apex


1) create Telegram Account in your Mobile like whatsapp


2) Ones you register in telegram apps serach for BotFather


3) To Create New Bot u need to enter below command 

/newbot 


Alright, a new bot. How are we going to call it? Please choose a name for your bot.


Macsbot


Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot.


MacsOmanBot


Done! Congratulations on your new bot. You will find it at t.me/MacsOmanBot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.


Use this token to access the HTTP API:<Here you will prompt with your api>



4) /mybots (this command will return the list of bots which you have created)


Choose a bot from the list below:


@MacsOmanBot


5)Dobule click on output @MacsOmanBot --> You will get API TOKENT, Edit Bot, Bot Setting ,Pyament etc option 


6) Click on Edit bot  and define the description and about of bot if you need


Name: Macsbot

Description: Modern Advance Computer System LLC

About: Oracle based ERP Solution Provider (Apex Consultant)


7) Now Set t.me/MacsOmanBot to your user to whom you wan to add or send the messsage on future 



8) Lets u have send this to your friend by message who having the account in Telegram . He/she has to click on our link and press start to be par of our group


9) Go to POSTMAN and check what is id of  he/she  has 


https://api.telegram.org/bot<Your API which gerneated in bot>/getUpdates


https://api.telegram.org/bot110000000:XXXXX/getUpdates


U will get response line this  take the id as reference for future message sending  here in below example is 110000000


"ok": true,

    "result": [

        {

            "update_id": 694550660,

            "message": {

                "message_id": 7,

                "from": {

                    "id": 110000000,

                    "is_bot": false,

                    "first_name": "Jigs",

                    "username": "jignesh1983",

                    "language_code": "en"

                },

                "chat": {

                    "id": 110000000,

                    "first_name": "Jigs",

                    "username": "jignesh1983",

                    "type": "private"

                },

                "date": 1595169986,

                "text": "hi"

            }


10) Open the Telegram Integration.Sql Script  and change in package TLEGRAM  p_token value with Bot API


create or replace PACKAGE  "TELEGRAM" AS  

    v_err_msg CLOB;  

    p_url CLOB := 'https://api.telegram.org/bot';  

    p_token VARCHAR(200) := '110000000:XXXXX';  

   

11 ) Run the Telegram Integration.Sql Script  (pls message or email me for this script)


==========================

send message by script

=========================

12) Now test with below script in sql


begin

  telegram.sendmessage

    (p_chat_id  => 1334495090

    ,p_text  => '<b>Leave Application - Sick Leave </b>

<pre>Mr.John has applied for 2 Sick Leave from 19-JUL-2020 to 20-JUL-2020. Request you to process it further.</pre>

<a href="https://localhost:8443/ords/f?p=4500">Process Leave</a>'

    );

  commit;

end;



Comments

Popular posts from this blog

The username or password for the connection pool named |apex||, are invalid, expired, or the account is locked

Enabled SQL Developer Web (SDW) & ORDS Database API ORDS 19.4