Calls by API

A program’s call is a line call like an operator’s: it goes into the call log, the dialogue history and the CRM. The program sees only its key’s lines and only the dialogues an operator sees.

Calls by API work on WhatsApp Web and Telegram lines.

What the program can do

  • Accept an incoming call, decline it or hang up.
  • Call a client from a line: the call belongs to the program from the first ring.
  • Speak and listen to the client in real time, and go quiet when they interrupt.
  • Transfer the client to the line’s people: the client hears the ringback, the operators’ phones ring as for a usual incoming call.
  • Choose which employee the call rings first.
  • Learn about calls from events — on your webhook or by polling, even without a server of your own.
  • Search the history by what happened in the conversation and recognise a client’s repeat calls.
  • Get the call summary — the conversation in numbers, computed from the recording’s sound, no AI.

Step 1. Get a key for calls

  1. The owner or an administrator opens Settings → API.
  2. Press Key for calls.
  3. Tick the lines the program will work on.
  4. Copy the gw_… key: it is shown once. You can revoke it in the same place.
  5. Run the check command next to the key: it shows the calls going on on its lines right now.

You will see: the check command returns the calls going on right now on the key’s lines.

A key for calls has two permissions: calls:voice — take and place calls, speak in them, and channels:read — see the lines.

Step 2. The first request

The API address is https://dialogs.tehprof.kz/api/v1/gw/. Every request carries the header Authorization: Bearer gw_….

curl https://dialogs.tehprof.kz/api/v1/gw/calls/ \
  -H "Authorization: Bearer gw_xxx"

{ "calls": [] }

You will see: the reply { "calls": [] } when there are no calls right now, or a list of the calls in progress.

Next: a first bot

Install TehProf Dialogs in your CRM

Installing the app and connecting WhatsApp by QR code are free. The line subscription is billed separately.