Receive a call

Configuration

Set the parameter voice_start on your voice-enabled Virtual Phone Number to https://yourapp.io/elks/calls (or wherever your webhook code is). We'll make an HTTP POST request to this URL every time someone calls your number.

Alternatively, you can set the value of voice_start to a stringified JSON object of call actions.

Request

POST https://yourapp.io/elks/calls
Example payload
direction=incoming&
callid=sf8425555e5d8db61dda7a7b3f1b91bdb&
from=%2B46706861004&
to=%2B46706861020&
created=2018-07-13T13%3A57%3A23.741000

Request parameters

Parameter Description
callid The unique id of the call in our systems.
from The sender of the call.
to The phone number receiving the call.
created The time in UTC when the call object was created in our systems.

Response structure

You must respond with a valid JSON struct of call actions. For example:

{
  "play": "http://yourapp.io/message.mp3",
  "next": {
    "connect": "+46766860001",
    "busy": {
      "connect": "+46766860002"
    }
  }
}

Your webhook code must respond with a HTTP status in the range 200-204. If not, the API will consider the request failed and keep trying for up to 24 hours.