How to send Telegram Messages from PowerShell script

Using the WhatsMate Telegram Gateway REST API



This article shows you how to send a Telegram message from a PowerShell script.

Before the recipient can receive your Telegram message, she will need to register with the WhatsMate Telegram Gateway. Instructions are available on the official site. Unregistered users will never receive messages from the Gateway.

To send a Telegram message from a PowerShell script, do this:

  1. Copy the following source code to your PowerShell script.
  2. Customize the TODO lines:
    • Specify your gateway instance ID on line 4.
    • Specify your client ID and secret on lines 5 and 6.
    • Specify your target recipient on line 1. Remember to include the country code.
    • Specify your message on line 2.
  3. Run the script in PowerShell to send your message: ./send-telegram.ps1

You will need a trial account to call the above API. Go sign up now.