Skip to content

Quick start guide

In this guide we will go through the following process:

  1. Creation of a Dock
  2. Subscribing to the Dock in Telegram
  3. Sending simple POST request via command line

Thesaurus

  • Dock - endpoint that belongs to your app or service.

It contains:

  • ID
    • necessary to subscribe to a Dock in Telegram Bot
    • necessary to send API requests
  • Secret key
    • necessary to send API requests
  • Link
  • Description

Step 1. Creation of a Dock

During this guide we will consider we are developing a service that sends weather forecast to users every day. Let's name it MyWeatherApp.

  1. Open PingDock Control Room
  2. Sign in if you haven't yet
  3. Now you should see a form named "Create a new Dock"
  4. Enter a name. For example "My Weather App"
  5. Optionally, enter a link. For example "https://my.weather.app"
  6. Set a description. For example "Web-based service that sends a weather forecast every day"
  7. Click button "Create".

Creation of a Dock form

  1. Now you will see a card with the new Dock

Creation of a Dock card

Step 2. Subscribing to the Dock in Telegram

There are multiple options on how to subscribe to the Dock in Telegram bot.

From Control Room

  1. Press the button Open in Telegram on your Dock's card.

Dock card

  1. It will redirect you in Telegram bot.

Telegram link opened in browser

  1. Open Telegram when your browser asks. You will see the prompt in Telegram bot.

Telegram link opened in bot

  1. Press "Yes" to subscribe.
  1. Press "Copy Dock ID" button or copy it manually from Control Room.

Dock card

  1. Type in the browser https://t.me/PingDockBot?start=<Your Dock's ID>. You will see prompt in Telegram bot.

Telegram link opened in bot

  1. Press "Yes" to subscribe.

Manual subscription via bot.

  1. Press "Copy Dock ID" button or copy it manually from Control Room.

Dock card

  1. Open Telegram bot @PingDockBot.
  2. Press "Subscribe" button.

Telegram bot manual subscription

  1. Paste you Dock's ID when requested.
  2. You are subscribed.

Step 3. Sending simple POST request via command line

Windows

  1. Copy Dock ID and Secret Key from Control Room.

Dock card

  1. Prepare this command by pasting Dock ID and Secret Key. Enter your message.
cmd
curl -X POST https://api.pingdock.io/ping ^
  -H "Content-Type: application/json" ^
  -d "{\"dock_id\":\"<Dock ID>\", \"secret_key\":\"<Dock Secert Key>\", \"msg\":\"<Message>\"}"

Message example:

Today: Sunny ☀️\nTemp: +24℃
  1. Open cmd
  2. Paste the prepared command and press Enter.
  3. You should now see a new message appear in your Telegram bot.

Telegram bot notification

To learn more about message format, please refer message format page

Linux

  1. Copy Dock ID and Secret Key from Control Room.

Dock card

  1. Prepare this command by pasting Dock ID and Secret Key. Enter your message.
cmd
curl -X POST https://api.pingdock.io/ping \
  -H "Content-Type: application/json" \
  -d "{\"dock_id\":\"<Dock ID>\", \"secret_key\":\"<Dock Secret Key>\", \"msg\":\"<Message>\"}"

Message example:

Today: Sunny ☀️\nTemp: +24℃
  1. Open Terminal (macOS) or your Linux shell.
  2. Paste the prepared command and press Enter.
  3. You should now see a new message appear in your Telegram bot.

Telegram bot notification