Set Call

Set Call allows you to set the SIP trunk information that you wish to get the incoming calls.

This can only work once our support team enabled the WhatsApp calling feature for your account.


Important information

  • In this endpoint you need to provide the SIP server information and enable the calling feature.

  • The WhatsApp calling feature is only available for numbers that their daily limit is at least 2000 conversations.

  • Your SIP server must be reachable from the internet at the public hostname or public IPv4.

  • All incoming calls will be coming (SIP signaling) and RTP media from IP: 34.165.246.158 , so don't forget to whitelist it.

  • Default codecs are PCMU and PCMA (G.711). You can change them with codec_pref parameter.

  • By default, you can have 1 concurrent call. if you need to upgrade your plan please contact support. calls above your limit are rejected.

  • Only the 'from' in the body is mandatory. send only what you want to change. everything you leave out stays as it is.


Settings:

URL

https://api.99digital.co.il/whatsapp/v2/setCall

Method

JSON via POST

Header

Key

Value

apiKey

Your API key for the service


Body:

Parameter

Description / Example

Maximum length

Remarks

from

your WhatsApp account. international number without +. for example: 972771234567


mandatory

status

boolean.

true to enable calling (show the calling icon)

false to disable the calling


Your settings are kept. this is purely the call icon on the top.

sip_host

Public hostname or IPv4 of your SIP server. cannot be empty. private/internal addresses are refused

256

Hostname or IP. for example: 153.265.210.652

sip_port

The port number for your SIP host.

5

Must be between 1-65535.

Usually the default is 5060 (UDP/TCP) or 5061 (TLS).

Cannot be empty.

sip_transport

The SIP transport value

available values:

udp / tcp / tls

3

Cannot be empty.

client_auth

{"username": "some-username", "password": "some-password"}

This is the username and password for digest authentication.

Letters, digits and -.@!#&*+=~:/?

128 each

This value is in case your server required authentication. this is not mandatory, but if username is provided, password must be provided too.

codec_pref

Comma-separated codecs in order of preference. Default is PCMU,PCMA.

Letters, digits and @.-

50

Cannot be empty.

for example: PCMU,PCMA,OPUS

call_hours

see below

see below

see blow


Call hours

  • The call_hours parameters control when customers can call you.

  • Without the call hours, customers will see the call icon 24/7 and will be able to call you.

  • The call hours allows you to hide this icon on specific times that you can't take those calls on your call center. WhatsApp will show that you are not available and show your call availability in the app.

  • The default is call hours off. so the call button is available 24/7.

  • A day you leave our is closed all day. in the example below, Saturday is closed.

  • Every call_hours you send in a new call replaces the entire list you previously provided, including the holidays. always send the complete object if you wish to update this param.

  • To remote the hours so customers can call you 24/7 you can simplty send "call_hours": {}. to keep the settings saved, but not force the call hours, send "status": "DISABLED"

  • Common mistakes: dont write "09:00", write "0900". dont write "2400", write "2359". dont write "SUN", write "SUNDAY" (capital). dont wrote holiday dayes in the past, otherwise you will get error with reason 13.


The call_hours is an object that contains status, timezone, working hours and holidays. when you enable this it will show the call button only during the provided hours.

Example on the call_hours object:

  "call_hours": {
    "status": "ENABLED",
    "timezone_id": "Asia/Jerusalem",
    "weekly_operating_hours": [
      { "day_of_week": "SUNDAY",    "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "MONDAY",    "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "TUESDAY",   "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "WEDNESDAY", "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "THURSDAY",  "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "FRIDAY",    "open_time": "0900", "close_time": "1300" }
    ],
    "holiday_schedule": [ { "date": "2027-04-22", "start_time": "0000", "end_time": "2359" } ]
  }


call_hours explain

Parameter

Description / Example

What to provide

Example

status

ENABLED (default)

or

DISABLED (this keeps the saved data but accept calls 24/7)


mandatory

timezone_id

IANA format time zone.

The timezone you wish the hours to take effect.

Asia/Jerusalem

weekly_operating_hours

Array of hours and days

1–14 entries.

day_of_week = MONDAY … SUNDAY.

open_time / close_time = 24-hour HHMM with no colon (0900, 1730; end of day is 2359).


Open must be before close. Up to 2 non-overlapping entries per day for split shifts, e.g. 0800–1200 and 1600–2000

      { "day_of_week": "SUNDAY",    "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "MONDAY",    "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "TUESDAY",   "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "WEDNESDAY", "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "THURSDAY",  "open_time": "0900", "close_time": "1700" },
      { "day_of_week": "FRIDAY",    "open_time": "0900", "close_time": "1300" }

holiday_schedule

Array of selected dates that will be closed

Optional, up to 20 dates that override the weekly hours. date = YYYY-MM-DD, today or later; start_time / end_time in HHMM. 0000–2359 closes the whole day

{ "date": "2027-04-22", "start_time": "0000", "end_time": "2359" }



Full setCall example request:

{
  "from": "972501234567",
  "sip_host": "sip.your-company.com",
  "sip_port": 5060,
  "sip_transport": "udp",
  "codec_pref": "PCMU,PCMA",
  "client_auth": {
    "username": "whatsapp",
    "password": "Str0ng-Pass!"
  }
}


Response:

{
  "status": "OK",
  "from": "972501234567",
  "calling": {
    "status": true,
    "sip_host": "sip.your-company.com",
    "sip_port": 5060,
    "sip_transport": "udp",
    "client_auth": null,
    "codec_pref": "PCMU,PCMA",
    "call_hours": null
  },
  "reason": 1
}

The response always carries the complete current settingsץ

Response-Explain:

Parameter

Description

status

OK or FAIL

calling

Your returned settings

reason

'reason' is the status explanation in case of FAIL

1

not FAIL. the status is OK

2

Your "from" number account does not exist or invalid JSON

3

wrong apiKey

4

'status' must be true/false

5

sip_host is empty, invalid or not reachable.

6

sip_port is empty, invalid or not reachable.

7

sip_transport must be udp/tcp/tls

8

client_auth is missing username/password or has characters that are not allowed.

9

codec_pref is empty or invalid

10

call_hours is not an object or its status is not ENABLED / DISABLED

11

timezone_id is missing for call_hours

12

weekly_operating_hours is missing or empty

13

holiday_schedule is invalid

14

WhatsApp error. please contact support

15

Calling is temporarily disabled for this number (calls quality or spam)

16

Support team did not enable calling for your number, please contact support

17

Settings rejected, please contact support