NAV
Developers
RAW cURL

REST API

API endpoint:

https://core.callpage.io/api/v1/external

This documentation helps you implement the RESTful CallPage API v1. This API uses a JSON format for output and is capable of handling CORS (Cross-Origin Resource Sharing) requests. The API is stateless – all requests are validated against an API key. The API key can be obtained manually from the CallPage app.

Each response sent from the API contains a hasError parameter which is of boolean type, indicating whether the request was carried out or not. Upon success being false, an optional errorCode parameter (string) and message (string) may be given. In case of success being true, the response is always contained within a data parameter, and an additional meta parameter may be carried alongside. You can use pretty_output=1 parameter in the GET-arguments to ask for an indented response – however using the pretty output in an actual integration is strongly discouraged as it is intended for debugging purposes and gets served slower.

Authentication

API Key

Make sure to replace xxxxxxxxxxxx with your API Key.

Every request should have required header for authorization (API Key), which can be obtained from Dashboard.

Authorization: xxxxxxxxxxxx

Scopes

In order to give users more secure and flexible tool, token scopes have been introduced to the RESTful API v1.

Below one may find the full list of scopes:

Scope Meaning
calls.view Allows to get information about calls.
managers.view Allows to get information about managers.
managers.edit Allows to create and modify managers.
sms.view Allows to get information about SMS Messages.
sms.edit Allows to create and modify SMS Messages.
voice.view Allows to get information about Voice Messages.
voice.edit Allows to create and modify Voice Messages.
widgets.view Allows to get information about widgets.
widgets.edit Allows to create and modify widgets.
widgets.call Allows to perform widget calls.

Endpoints /users use permissions of provided API Token’s user.

Examples

GET /api/v1/external HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

You should receive this as a response:

{
  "hasError": false,
  "errorCode": 0,
  "message": "Hello there! I am the CallPage API. To fully grasp my superpowers, head down to https://developers.callpage.io for documentation.",
  "data": []
}

We present some examples of how to make correct request to our endpoints.

Calls

Call Statuses

Status Description
new New call.
scheduled A visitor picked up a timeslot for a call with manager. System will automatically call the visitor and connect you at the right time. Before a call visitor will receive an SMS notification.
in-progress The call is in progress. Manager is talking with user right now.
ringing Call is being established.
completed The call was successfully completed. Feel free to listen for call recording and analyze it.
manager-failed Unfortunately, your managers didn’t answer the call. Contact the visitor ASAP, he is still waiting for call from your company.
user-failed Visitor of your website doesn’t answer the call or was busy at that moment.
failed Call has failed because of lack of permissions, operator error etc.
cancelled Scheduled call, which has been cancelled.

Get History

Get calls history. By default this endpoint returns all calls for all users’ widgets.

Example request:

GET /api/v3/external/calls/history?display_hidden=1&date_from=1506981600&date_to=1509227999&limit=15&offset=0&widget_ids[]=2&statuses[]=completed&statuses[]=in-progress&tag_ids[]=107&tag_ids[]=106&tag_ids[]=105&user_ids[]=2&user_ids[]=15&call_id=12&phone_number=%2B48123123123 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v3/external/calls/history?display_hidden=1&date_from=1506981600&date_to=1509227999&limit=15&offset=0&widget_ids[]=2&statuses[]=completed&statuses[]=in-progress&tag_ids[]=107&tag_ids[]=106&tag_ids[]=105&user_ids[]=2&user_ids[]=15&call_id=12&phone_number=%2B48123123123" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
  "hasError": false,
  "errorCode": 0,
  "message": "",
  "data": [
    {
      "data": {
        "id": 10507595,
        "to": "+48123456789",
        "utm": {
          "data": {
            "utm_medium": null,
            "utm_source": null,
            "utm_content": null,
            "utm_campaign": null
          }
        },
        "call": {
          "data": {
            "id": 8826249,
            "type": 1,
            "rating": {
              "data": []
            },
            "billing_time": 0,
            "call_attempt": {
              "data": {
                "id": 15806093,
                "manager": {
                  "data": []
                }
              }
            }
          }
        },
        "tags": {
          "data": []
        },
        "notes": {
          "data": []
        },
        "referer": {
          "data": {
            "medium": null,
            "source": "internal"
          }
        },
        "request": {
          "data": {
            "id": 2093773134,
            "ip": "62.121.131.18",
            "url": "https://core.callpage.io/sample/8hQk_VGwTHvIkHn2vZmsWez6EGVbr_xEFyKPUeaU0AM?_gl=1*el9a5d*_gcl_aw*R0NMLjE2NjY3ODk0ODkuQ2owS0NRand0ZU9hQmhEdUFSSXNBREJxUmVpbUJaYm5fdUpYQ0RfMVlPX2tWYTJFM2tiT1JNd21GX01XU08zNmVGNWplWmxvMExlRnJsOGFBaV9ZRUFMd193Y0I.&_ga=2.158319866.1764798750.1673788438-682260383.1661860039",
            "locale": "en",
            "geo_loc": "50.0585,19.9342",
            "geo_org": "CETI s.c.",
            "geo_city": "Krakow",
            "geo_full": "PL, Krakow, Lesser Poland, 31-008",
            "geo_postal": "31-008",
            "geo_region": "Lesser Poland",
            "geo_country_code": "PL",
            "geo_country_name": "Poland",
            "user_agent_device": "Macintosh, Chrome, OS X",
            "geo_continent_code": "EU",
            "geo_continent_name": "Europe",
            "user_agent_device_type": "desktop"
          }
        },
        "feedback": {
          "data": []
        },
        "extension": {
          "data": []
        },
        "created_at": "2023-01-17 10:59:07",
        "department": {
          "data": []
        },
        "leadable_id": 47317,
        "traceroutes": {
          "data": [
            {
              "url": "https://core.callpage.io/sample/8hQk_VGwTHvIkHn2vZmsWez6EGVbr_xEFyKPUeaU0AM?_gl=1*el9a5d*_gcl_aw*R0NMLjE2NjY3ODk0ODkuQ2owS0NRand0ZU9hQmhEdUFSSXNBREJxUmVpbUJaYm5fdUpYQ0RfMVlPX2tWYTJFM2tiT1JNd21GX01XU08zNmVGNWplWmxvMExlRnJsOGFBaV9ZRUFMd193Y0I.&_ga=2.158319866.1764798750.1673788438-682260383.1661860039",
              "count": 1,
              "title": null
            }
          ]
        },
        "cancelled_at": null,
        "human_status": "manager-failed",
        "scheduled_at": null,
        "to_formatted": "+48 533 815 443",
        "leadable_type": "Widget",
        "scheduled_success": false,
        "call_request_fields": {
          "data": [
            {
              "id": 110014,
              "hint": null,
              "slug": "email",
              "label": "E-mail",
              "value": "test@test.com",
              "field_value": "test@test.com",
              "placeholder": null
            },
            {
              "id": 110015,
              "hint": null,
              "slug": "name",
              "label": "Your name",
              "value": "dfdsfvvasd",
              "field_value": "dfdsfvvasd",
              "placeholder": null
            },
            {
              "id": 113855,
              "hint": "Jak podobała ci się rozmowa",
              "slug": "rating",
              "label": "",
              "value": "4.5",
              "field_value": "4.5",
              "placeholder": null
            }
          ]
        },
        "leadable_description": "plan"
      },
      "id": 10507595
    },
    {
      "data": {
        "id": 10616808,
        "to": "+48123123123",
        "utm": {
          "data": {
            "utm_medium": null,
            "utm_source": null,
            "utm_content": null,
            "utm_campaign": null
          }
        },
        "call": {
          "data": []
        },
        "tags": {
          "data": []
        },
        "notes": {
          "data": []
        },
        "referer": {
          "data": {
            "medium": null,
            "source": "internal"
          }
        },
        "request": {
          "data": {
            "id": 2128289791,
            "ip": "62.121.131.18",
            "url": "https://core.callpage.io/sample/8hQk_VGwTHvIkHn2vZmsWez6EGVbr_xEFyKPUeaU0AM?_gl=1*1lhalth*_gcl_aw*R0NMLjE2NjY3ODk0ODkuQ2owS0NRand0ZU9hQmhEdUFSSXNBREJxUmVpbUJaYm5fdUpYQ0RfMVlPX2tWYTJFM2tiT1JNd21GX01XU08zNmVGNWplWmxvMExlRnJsOGFBaV9ZRUFMd193Y0I.&_ga=2.33846753.1550484862.1675670387-992258436.1675325019",
            "locale": "pl",
            "geo_loc": "50.0585,19.9342",
            "geo_org": "CETI s.c.",
            "geo_city": "Krakow",
            "geo_full": "PL, Krakow, Lesser Poland, 31-008",
            "geo_postal": "31-008",
            "geo_region": "Lesser Poland",
            "geo_country_code": "PL",
            "geo_country_name": "Poland",
            "user_agent_device": "Macintosh, Chrome, OS X",
            "geo_continent_code": "EU",
            "geo_continent_name": "Europe",
            "user_agent_device_type": "desktop"
          }
        },
        "feedback": {
          "data": []
        },
        "extension": {
          "data": {
            "email": "john5@callpage.io",
            "message": "test"
          }
        },
        "created_at": "2023-02-09 09:45:56",
        "department": {
          "data": []
        },
        "leadable_id": 47317,
        "traceroutes": {
          "data": [
            {
              "url": "https://core.callpage.io/sample/8hQk_VGwTHvIkHn2vZmsWez6EGVbr_xEFyKPUeaU0AM?_gl=1*1lhalth*_gcl_aw*R0NMLjE2NjY3ODk0ODkuQ2owS0NRand0ZU9hQmhEdUFSSXNBREJxUmVpbUJaYm5fdUpYQ0RfMVlPX2tWYTJFM2tiT1JNd21GX01XU08zNmVGNWplWmxvMExlRnJsOGFBaV9ZRUFMd193Y0I.&_ga=2.33846753.1550484862.1675670387-992258436.1675325019",
              "count": 1,
              "title": null
            },
            {
              "url": "https://core.callpage.io/sample/8hQk_VGwTHvIkHn2vZmsWez6EGVbr_xEFyKPUeaU0AM?_gl=1*1lhalth*_gcl_aw*R0NMLjE2NjY3ODk0ODkuQ2owS0NRand0ZU9hQmhEdUFSSXNBREJxUmVpbUJaYm5fdUpYQ0RfMVlPX2tWYTJFM2tiT1JNd21GX01XU08zNmVGNWplWmxvMExlRnJsOGFBaV9ZRUFMd193Y0I.&_ga=2.1373809.1550484862.1675670387-992258436.1675325019",
              "count": 1,
              "title": null
            }
          ]
        },
        "cancelled_at": null,
        "human_status": "new",
        "scheduled_at": null,
        "to_formatted": "+48 123 123 123",
        "leadable_type": "Widget",
        "scheduled_success": false,
        "call_request_fields": {
          "data": [
            {
              "id": 110014,
              "hint": null,
              "slug": "email",
              "label": "E-mail",
              "value": "agent.mulder@callpage.io",
              "field_value": "agent.mulder@callpage.io",
              "placeholder": null
            },
            {
              "id": 110015,
              "hint": null,
              "slug": "name",
              "label": "Your name",
              "value": "Mulder",
              "field_value": "Mulder",
              "placeholder": null
            }
          ]
        },
        "leadable_description": "plan"
      },
      "id": 10616808
    }
  ],
  "meta": {
    "offset": null,
    "limit": "2",
    "count": 172
  }
}

Action

GET https://core.callpage.io/api/v3/external/calls/history

Query Parameters

All the parameters presented below are optional and they do filter returned calls.

Parameter Type Required Description Default
display_hidden int false Determine if should display hidden calls 1
call_id array false Show calls by id e.g. call_id[]=107
phone_number string false A phone number in E.164 format with escaped special chars e.g. %2B48123123123. Fill one field (tel or phone_number)
user_ids array false Show calls for specified users e.g. user_ids[]=107&user_ids[]=106
statuses array false Call status. Click here to check all available call statutes. e.g. statuses[]=completed&statuses[]=in-progress
tag_ids array false Show calls for specified tags e.g. tag_ids[]=107&tag_ids[]=106 100
date_from timestamp false Start date as timestamp. e.g. 1473779438.
date_to timestamp false End date as timestamp string. e.g. 1473779438.
widget_ids array false Widget identifiers. You can find it in widgets tab. e.g widget_ids[]=2&widget_ids[]=3
limit int false If set, the result will be limited. 100
offset int false If set, the result will be offset by this value. 0
url string false Widget installation URL.
incoming_number_ids array false Show calls for specified incoming numbers e.g. incoming_number_ids[]=66&incoming_number_ids[]=69
tel string false Deprecated. Equivalent to phone_number.
widget_id int false Deprecated. Equivalent to widget_ids.

Get Single Call

Example request:

GET /api/v1/external/calls/234532 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v3/external/calls/234532" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "data": {
            "id": 11925829,
            "to": "+48512737669",
            "utm": {
                "data": {
                    "utm_medium": null,
                    "utm_source": null,
                    "utm_content": null,
                    "utm_campaign": null
                }
            },
            "call": {
                "data": {
                    "id": 10014869,
                    "sid": "f09078efb8770f624b008e1334ea316bbd428f34",
                    "type": 1,
                    "rating": {
                        "data": []
                    },
                    "transcribed": false,
                    "billing_time": 8,
                    "call_attempt": {
                        "data": {
                            "id": 18876778,
                            "manager": {
                                "data": {
                                    "id": 95653,
                                    "user": {
                                        "data": {
                                            "id": 71727,
                                            "tel": "+48535019417",
                                            "name": "ada",
                                            "email": "adriana.swierczek@outlook.com",
                                            "avatar": null,
                                            "caller_id": {
                                                "data": {
                                                    "id": 82533,
                                                    "tel": "+48535019417",
                                                    "activated_at": "2023-02-21 15:35:58",
                                                    "tel_formatted": "+48 535 019 417"
                                                }
                                            },
                                            "tel_formatted": "+48 535 019 417"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "tags": {
                "data": []
            },
            "notes": {
                "data": []
            },
            "referer": {
                "data": {
                    "medium": null,
                    "source": "internal"
                }
            },
            "request": {
                "data": {
                    "id": 2574382511,
                    "ip": "62.121.131.18",
                    "url": "https://cpnow.me/d/JV4k",
                    "locale": "pl",
                    "geo_loc": "50.0571,19.935",
                    "geo_org": "CETI s.c.",
                    "geo_city": "Krakow",
                    "geo_full": "PL, Krakow, Lesser Poland, 31-002",
                    "geo_postal": "31-002",
                    "geo_region": "Lesser Poland",
                    "geo_country_code": "PL",
                    "geo_country_name": "Poland",
                    "user_agent_device": "Macintosh, Chrome, OS X",
                    "geo_continent_code": "EU",
                    "geo_continent_name": "Europe",
                    "user_agent_device_type": "desktop"
                }
            },
            "feedback": {
                "data": []
            },
            "extension": {
                "data": []
            },
            "created_at": "2023-12-19 10:46:56",
            "department": {
                "data": []
            },
            "leadable_id": 47317,
            "traceroutes": {
                "data": [
                    {
                        "url": "https://cpnow.me/d/JV4k",
                        "count": 1,
                        "title": null
                    }
                ]
            },
            "cancelled_at": null,
            "human_status": "completed",
            "scheduled_at": null,
            "to_formatted": "+48 512 737 669",
            "leadable_type": "Widget",
            "scheduled_success": false,
            "call_request_fields": {
                "data": []
            },
            "leadable_description": "plan"
        },
        "id": 11925829
    },
    "meta": []
}

Get single call details.

Action

GET https://core.callpage.io/api/v3/external/calls/{call_id}

Path Parameters

Parameter Type Description
call_id integer ID of a Call

Update Field

Example request:

PATCH /api/v1/web/calls/13/fields/1421 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx

{
    "value": 12
}
curl -X PATCH "https://core.callpage.io/api/v1/external/calls/13/fields/1421" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": []
}

Updates or sets a field value.

Action

PATCH https://core.callpage.io/api/v1/external/calls/{call}/fields/{field}

Path Parameters

Parameter Type Description
call integer ID of a Call
field integer ID of a Field

Body Parameters

Parameter Type Required Description
value string, integer, boolean true New value for the Field

Users

User Identifier

To retrieve user in /users endpoint one can pass either id or user_id parameter.

User Roles

Role Description
owner Owner is a master user. Owner can create admins and managers and has full access to Callpage Dashboard.
admin Admin has access to everything except billing.
manager Manager has access to his widgets, calls and recordings.

Users with and without email

Every owner can create limitless number of users without email address. It means that these users are not applied to your subscription limit. They can not sign into Callpage Dashboard, but can be used as a call operators instead.

Users with email apply to your subscription limit. These users however have access (limited by their role) to Callpage Dashboard.

Get All Users

Example request:

GET /api/v1/external/users/all?offset=1&limit=2 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/users/all?offset=1&limit=2" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": [
        {
            "id": 2,
            "name": "Manager1",
            "email": "manager1@callpage.io",
            "tel": "+48570934649",
            "tel_formatted": "570 934 649",
            "tel_extension": null,
            "last_online": null,
            "parent_id": 1,
            "activated_at": "2016-09-08 13:32:54",
            "role": {
                "slug": "manager"
            },
            "avatar": null,
            "caller_id": {
                "id": 1,
                "activated_at": null,
                "updated_at": "2016-09-08 13:32:54"
            }
        },
        {
            "id": 3,
            "name": "Manager2",
            "email": "manager2@callpage.io",
            "tel": "+48570934649",
            "tel_formatted": "570 934 649",
            "tel_extension": null,
            "last_online": null,
            "parent_id": 1,
            "activated_at": "2016-09-08 13:32:54",
            "role": {
                "slug": "manager"
            },
            "avatar": null,
            "caller_id": {
                "id": 1,
                "activated_at": null,
                "updated_at": "2016-09-08 13:32:54"
            }
        }
    ],
    "meta": {
        "offset": "1",
        "limit": "2",
        "count": 4
    }
}

Get users.

Action

GET https://core.callpage.io/api/v1/external/users/all

Query Parameters

Parameter Type Required Description Default
offset int false If set, the result will be offset by this value. 0
limit int false If set, the result will be limited. 100

Get User

Example request:

GET /api/v1/external/users/get?id=3 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/users/get?id=3" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 3,
        "name": "Manager2",
        "email": "manager2@callpage.io",
        "tel": "+48570934649",
        "tel_formatted": "570 934 649",
        "tel_extension": null,
        "last_online": null,
        "parent_id": 1,
        "activated_at": "2016-08-26 10:44:21",
        "role": {
            "slug": "manager"
        },
        "avatar": null,
        "caller_id": {
            "id": 1,
            "activated_at": null,
            "updated_at": "2016-08-26 10:44:21"
        }
    },
    "meta": []
}

Get user by id.

Action

GET https://core.callpage.io/api/v1/external/users/get

Query Parameters

Parameter Type Required Description
id int true User identifier. You can find it in users tab.
email string false User’s email. You can use it in place of ‘id’ parameter

Create User

Example request:

POST /api/v1/external/users/create HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "name": "Test Manager",
    "tel": "+48 888 888 888",
    "email": "test@test.com",
    "role": "manager"
}
curl -X POST "https://core.callpage.io/api/v1/external/users/create" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "name": "Test Manager",
             "tel": "+48 888 888 888",
             "email": "test@test.com",
             "role": "manager"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 1380
    }
}

Create user.

Action

POST https://core.callpage.io/api/v1/external/users/create

Query Parameters

Parameter Type Required Description Default
name string true User name.
tel string true A phone number which you would like to call in E.164 format. e.g. +48123123123.
email email false Valid email address.
role string false User role, can be either admin or manager. manager

Update User

Example request:

POST /api/v1/external/users/update HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "id": 1380,
    "name": "Test Manager",
    "tel": "+48 888 888 888",
    "email": "test@test.com",
    "role": "admin"
}
curl -X POST "https://core.callpage.io/api/v1/external/users/update" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "id": 1380,
             "name": "Test Manager",
             "tel": "+48 888 888 888",
             "email": "test@test.com",
             "role": "admin"
         }'

JSON Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 1380
    }
}

Update user by id. This operation can override parent user, depending on who makes the request!

Action

POST https://core.callpage.io/api/v1/external/users/update

Query Parameters

Parameter Type Required Description Default
id int true User identifier. You can find it in users tab.
name string true User name.
tel string true A phone number which you would like to call in E.164 format. e.g. +48123123123.
email email false Valid email address.
role string false User role, can be either admin or manager. manager

Delete User

Example request:

POST /api/v1/external/users/delete HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "id": 1380
}
curl -X POST "https://core.callpage.io/api/v1/external/users/delete" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "id": 1380
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": null
}

Delete user by id.

Action

POST https://core.callpage.io/api/v1/external/users/delete

Query Parameters

Parameter Type Required Description
id int true User identifier. You can find it in users tab.

Widgets

Widget Identifier

To retrieve widget in /widgets endpoint one can pass either id or widget_id parameter. It is also possible to use encrypted_id.

Widget Languages

Locale Code Language
cn Chinese
cz Czech
de German
ee Estonian
en English
es Spanish
fr French
hu Hungarian
it Italian
lt Latvian
pl Polish
pt Portuguese
ru Russian
se Swedish
tr Turkish

Widget Settings

Setting Available options Description Default
callerId 0 , 1 , 2 0 – Callpage number 0
1 – Every managers number
2 – Single number
countdown Integers from 28 to 59 Widget countdown value. 28
call.algorithm simulring, findme simulring – Simultaneously simulring
findme – In sequence
call.recording boolean Indicates whether Callpage should record calls. true
call.direction ab, ba ab – first call manager then call client ab
ba – first call client then call manager
call.from boolean Indicates whether to show caller’s number. true
widget.showMobile boolean Indicates whether to show widget on mobile devices. true
widget.hideAfterHourss boolean Indicates whether widget will be disabled after working hours. false
widget.enableSmsName boolean Your company name which will appear as SMS Sender ID for your customers. true
widget.playSound boolean Indicates whether the widget should play the sounds. true
widget.showScheduled boolean Indicates whether the number of scheduled calls today should be displayed. May have influence on conversion rate. true
widget.showCallStats boolean Indicates whether to show texts with stats on widget. May have influence on conversion rate. true
widget.showHint boolean Indicates whether to show a tooltip. The tooltip with call back offer will be shown near the button. true
widget.showFlags boolean Indicates whether to show dropdown with countries codes. Easy to select appropriate country code. Useful for multilingual websites. false
widget.style.position top-left, top-right, bottom-left, bottom-right Widget position on the website. bottom-right
widget.style.scheme blue, green, red, yellow, grey, custom Widget scheme color. blue
widget.style.color RGB value in hex Custom color. “”
widget.button.autoShow boolean Indicates whether the widget should open automatically. true
widget.button.showTimeout milliseconds Specify timeout after which button is automatically showed. 3000
widget.button.showManagersCount boolean Indicates whether to show operators count on widget. May have influence on conversion rate. true
etc.allowRecording boolean Agreement to share call recordings with CallPage’s employees to help improve service quality. true

Get All Widgets

Example request:

GET /api/v1/external/widgets/all?offset=1&limit=2 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/widgets/all?offset=1&limit=2" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": [
        {
            "id": 2,
            "description": "Callpage.io DIALOG",
            "url": "http:\/\/callpage.io",
            "enabled": true,
            "locale_code": "en",
            "installation_status": 0,
            "installed_at": null,
            "company_sms_name": null,
            "call_requests_count": 0,
            "managers": [
                {
                    "id": 2,
                    "enabled": true,
                    "user": {
                        "id": 1,
                        "name": "Owner",
                        "tel": "+48570934649",
                        "email": "admin@admin.com",
                        "avatar": null
                    },
                    "departments": [],
                    "business_times": [
                        {
                            "day_of_week": 0,
                            "enabled": false,
                            "timezone": "Europe\/Warsaw",
                            "start_time": null,
                            "end_time": null
                        },
                        {
                            "day_of_week": 1,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 2,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 3,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 4,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 5,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 6,
                            "enabled": false,
                            "timezone": "Europe\/Warsaw",
                            "start_time": null,
                            "end_time": null
                        }
                    ]
                }
            ]
        },
        {
            "id": 3,
            "description": "Callpage.io DIALOG",
            "url": "http:\/\/callpage.io",
            "enabled": true,
            "locale_code": "en",
            "installation_status": 0,
            "installed_at": null,
            "company_sms_name": null,
            "call_requests_count": 0,
            "managers": [
                {
                    "id": 3,
                    "enabled": true,
                    "user": {
                        "id": 1,
                        "name": "Owner",
                        "tel": "+48570934649",
                        "email": "admin@admin.com",
                        "avatar": null
                    },
                    "departments": [],
                    "business_times": [
                        {
                            "day_of_week": 0,
                            "enabled": false,
                            "timezone": "Europe\/Warsaw",
                            "start_time": null,
                            "end_time": null
                        },
                        {
                            "day_of_week": 1,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 2,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 3,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 4,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 5,
                            "enabled": true,
                            "timezone": "Europe\/Warsaw",
                            "start_time": "09:00:00",
                            "end_time": "17:00:00"
                        },
                        {
                            "day_of_week": 6,
                            "enabled": false,
                            "timezone": "Europe\/Warsaw",
                            "start_time": null,
                            "end_time": null
                        }
                    ]
                }
            ]
        }
    ],
    "meta": {
        "offset": "1",
        "limit": "2",
        "count": 21
    }
}

Get widgets for given user.

Action

GET https://core.callpage.io/api/v1/external/widgets/all

Query Parameters

Parameter Type Required Description Default
offset int false If set, the result will be offset by this value. 0
limit int false If set, the result will be limited. 100

Get Widget

Example request:

GET /api/v1/external/widgets/get?id=1 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/widgets/get?id=1" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 1,
        "description": "Callpage.io MINIMAL",
        "url": "http:\/\/callpage.io",
        "enabled": true,
        "locale_code": "en",
        "installation_status": 1,
        "installed_at": null,
        "company_sms_name": null,
        "call_requests_count": 0,
        "managers": [
            {
                "id": 1,
                "enabled": true,
                "user": {
                    "id": 1,
                    "name": "Owner",
                    "tel": "+48570934649",
                    "email": "admin@admin.com",
                    "avatar": null
                },
                "departments": [
                    {
                        "id": 1,
                        "name": "Sales"
                    },
                    {
                        "id": 2,
                        "name": "Tech"
                    }
                ],
                "business_times": [
                    {
                        "day_of_week": 0,
                        "enabled": false,
                        "timezone": "Europe\/Warsaw",
                        "start_time": null,
                        "end_time": null
                    },
                    {
                        "day_of_week": 1,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 2,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 3,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 4,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 5,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 6,
                        "enabled": false,
                        "timezone": "Europe\/Warsaw",
                        "start_time": null,
                        "end_time": null
                    }
                ]
            },
            {
                "id": 22,
                "enabled": true,
                "user": {
                    "id": 4,
                    "name": "Admin",
                    "tel": "+48570934649",
                    "email": "admin@callpage.io",
                    "avatar": null
                },
                "departments": [],
                "business_times": [
                    {
                        "day_of_week": 0,
                        "enabled": false,
                        "timezone": "Europe\/Warsaw",
                        "start_time": null,
                        "end_time": null
                    },
                    {
                        "day_of_week": 1,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 2,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 3,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 4,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 5,
                        "enabled": true,
                        "timezone": "Europe\/Warsaw",
                        "start_time": "09:00:00",
                        "end_time": "17:00:00"
                    },
                    {
                        "day_of_week": 6,
                        "enabled": false,
                        "timezone": "Europe\/Warsaw",
                        "start_time": null,
                        "end_time": null
                    }
                ]
            }
        ]
    },
    "meta": []
}

Get widget by id.

Action

GET https://core.callpage.io/api/v1/external/widgets/get

Query Parameters

Parameter Type Required Description
widget_id int true Widget identifier. You can find it in widgets tab.

Simple Call

Example request:

POST /api/v1/external/widgets/call HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "id": 1,
    "tel": "+48 888 888 888",
    "department_id": 1
}
curl -X POST "https://core.callpage.io/api/v1/external/widgets/call" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "id": 1,
             "tel": "+48 888 888 888",
             "department_id": 1
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 6
    }
}

Make a call to all available managers in the system. If no managers are available at the moment a scheduled call will be made. You will be able to see the call information in dashboard.

Action

POST https://core.callpage.io/api/v1/external/widgets/call

Query Parameters

Parameter Type Required Description
id int true Widget identifier. You can find it in widgets tab.
tel string true A phone number which you would like to call in E.164 format. e.g. +48123123123.
department_id int false Department identifier.
manager_id int false Manager identifier.
NOTE

There is no possibility of sending both manager_id and department_id parameters

Call or Schedule

Example request:

POST /api/v1/external/widgets/call-or-schedule HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "id": 1,
    "tel": "+48 888 888 888",
    "department_id": 1
}
curl -X POST "https://core.callpage.io/api/v1/external/widgets/call-or-schedule" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "id": 1,
             "tel": "+48 888 888 888"
             "department_id": 1
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 7
    }
}

Make a call to all available managers in the system. If no managers are available at the moment a scheduled call on the first available slot will be made. You will be able to see the call information in dashboard.

Action

POST https://core.callpage.io/api/v1/external/widgets/call-or-schedule

Query Parameters

Parameter Type Required Description
id int true Widget identifier. You can find it in widgets tab.
tel string true A phone number which you would like to call in E.164 format. e.g. +48123123123.
department_id int false Department identifier.

Create Widget

Example request:

POST /api/v1/external/widgets/create HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "url": "http://test.com",
    "description": "Test Widget",
    "locale_code": "pl"
}
curl -X POST "https://core.callpage.io/api/v1/external/widgets/create" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "url": "http://test.com",
             "description": "Test Widget",
             "locale_code": "pl"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 3409
    }
}

Create a widget, add manager and return new widget’s id.

Action

POST https://core.callpage.io/api/v1/external/widgets/create

Query Parameters

Parameter Type Required Description Default
url string true Website URL where widget will be installed e.g.: https://callpage.io
description string false Description for widget. Created from REST API. Timestamp: {timestamp}
locale_code string false Widget language. en

Update Widget

Example request:

POST /api/v1/external/widgets/update HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "id": 3409,
    "url": "http://test.com",
    "description": "Test Widget",
    "locale_code": "en",
    "enabled": 0
}
curl -X POST "https://core.callpage.io/api/v1/external/widgets/update" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "id": 3409,
             "url": "http://test.com",
             "description": "Test Widget",
             "locale_code": "en"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 3409
    }
}

Update a widget. This method allows to edit widget’s settings as well.

Action

POST https://core.callpage.io/api/v1/external/widgets/update

Query Parameters

Parameter Type Required Description Default
id int true Widget identifier. You can find it in widgets tab.
url string true Website URL where widget will be installed e.g.: https://callpage.io
description string false Description for widget. Created from REST API. Timestamp: {timestamp}
settings array false Widget settings.
locale_code string false Widget language. en
enabled boolean false Enable or disable widget. true

Delete Widget

Example request:

POST /api/v1/external/widgets/delete HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "id": 3409
}
curl -X POST "https://core.callpage.io/api/v1/external/widgets/delete" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "id": 3409
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": null
}

Delete widget by id.

Action

POST https://core.callpage.io/api/v1/external/widgets/delete

Query Parameters

Parameter Type Required Description
id int true Widget identifier. You can find it in widgets tab.

Add Users

Example request:

POST /api/v1/external/widgets/add-users HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "id": 3,
    "user_id": [2, 3],
    "business_times": [
        [
             {
                 "day_of_week": 0,
                 "enabled": false,
                 "start_time": null,
                 "end_time": null
             },
             {
                 "day_of_week": 1,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 2,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 3,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 4,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 5,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 6,
                 "enabled": false,
                 "start_time": null,
                 "end_time": null
             }
        ],
        [
             {
                 "day_of_week": 0,
                 "enabled": false,
                 "start_time": null,
                 "end_time": null
             },
             {
                 "day_of_week": 1,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 2,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 3,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 4,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 5,
                 "enabled": true,
                 "start_time": "09:00",
                 "end_time": "17:00"
             },
             {
                 "day_of_week": 6,
                 "enabled": false,
                 "start_time": null,
                 "end_time": null
             }
        ]
    ]
}
curl -X POST "https://core.callpage.io/api/v1/external/widgets/add-users" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "id": 3,
             "user_id": [2, 3],
             "business_times": [
                 [
                     {
                         "day_of_week": 0,
                         "enabled": false,
                         "start_time": null,
                         "end_time": null
                     },
                     {
                         "day_of_week": 1,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 2,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 3,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 4,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 5,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 6,
                         "enabled": false,
                         "start_time": null,
                         "end_time": null
                     }
                 ],
                 [
                     {
                         "day_of_week": 0,
                         "enabled": false,
                         "start_time": null,
                         "end_time": null
                     },
                     {
                         "day_of_week": 1,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 2,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 3,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 4,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 5,
                         "enabled": true,
                         "start_time": "09:00",
                         "end_time": "17:00"
                     },
                     {
                         "day_of_week": 6,
                         "enabled": false,
                         "start_time": null,
                         "end_time": null
                     }
                 ]
             ]
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": [
        {
            "user_id" : 2,
            "manager_id": 3
        },
        {
            "user_id" : 4,
            "manager_id": 4
        }
    ]
}

Add users to widget. This method will create a manager for each provided user_id. For user_id array there should be business_times array equal in size (in case when there is no business_times parameter provided, default value will be used instead). If the pair of user_id and widget_id returns existing manager, this manager will be updated instead.

Action

POST https://core.callpage.io/api/v1/external/widgets/add-users

Query Parameters

Parameter Type Required Description Default
id int true Widget identifier. You can find it in widgets tab.
user_id int/array true User identifier. You can find it in users tab. If only one user_id is passed this parameter can be integer, otherwise array is expected.
business_times array false Working hours of manager. Click here to retrieve more information about business_times array format. 9:00AM-5:00PM Monday-Friday

Managers

Default Business Times array:

[
  // Sunday
  [
    "day_of_week": 0,
    "enabled": 0,
    "start_time": null,
    "end_time": null,
    "timezone": "Europe/Warsaw"
  ],
  // Monday
  [
    "day_of_week": 1,
    "enabled": 1,
    "start_time": "09:00:00",
    "end_time": "17:00:00",
    "timezone": "Europe/Warsaw"
  ],
  // Tuesday
  [
    "day_of_week": 2,
    "enabled": 1,
    "start_time": "09:00:00",
    "end_time": "17:00:00",
    "timezone": "Europe/Warsaw"
  ],
  // Wednesday
  [
    "day_of_week": 3,
    "enabled": 1,
    "start_time": "09:00:00",
    "end_time": "17:00:00",
    "timezone": "Europe/Warsaw"
  ],
  // Thursday
  [
    "day_of_week": 4,
    "enabled": 1,
    "start_time": "09:00:00",
    "end_time": "17:00:00",
    "timezone": "Europe/Warsaw"
  ],
  // Friday
  [
    "day_of_week": 5,
    "enabled": 1,
    "start_time": "09:00:00",
    "end_time": "17:00:00",
    "timezone": "Europe/Warsaw"
  ],
  // Saturday
  [
    "day_of_week": 6,
    "enabled": 0,
    "start_time": null,
    "end_time": null,
    "timezone": "Europe/Warsaw"
  ]
];

To retrieve manager use combination of user_id and widget_id.

Business Times

Business Times determine the availability of your manager.

Sunday is considered to be the first day of the week.

By default timezone Europe/Warsaw is being used. To check all supported timezones click here.

Get All Managers

Example request:

GET /api/v1/external/managers/all?widget_id=1 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/managers/all?widget_id=1" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": [
        {
            "id": 1,
            "enabled": true,
            "user": {
                "id": 1,
                "name": "Owner",
                "tel": "+48570934649",
                "email": "admin@admin.com",
                "avatar": null
            },
            "departments": [
                {
                    "id": 1,
                    "name": "Sales"
                },
                {
                    "id": 2,
                    "name": "Tech"
                }
            ],
            "business_times": [
                {
                    "day_of_week": 0,
                    "enabled": false,
                    "timezone": "Europe\/Warsaw",
                    "start_time": null,
                    "end_time": null
                },
                {
                    "day_of_week": 1,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 2,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 3,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 4,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 5,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 6,
                    "enabled": false,
                    "timezone": "Europe\/Warsaw",
                    "start_time": null,
                    "end_time": null
                }
            ]
        },
        {
            "id": 22,
            "enabled": true,
            "user": {
                "id": 4,
                "name": "Admin",
                "tel": "+48570934649",
                "email": "admin@callpage.io",
                "avatar": null
            },
            "departments": [],
            "business_times": [
                {
                    "day_of_week": 0,
                    "enabled": false,
                    "timezone": "Europe\/Warsaw",
                    "start_time": null,
                    "end_time": null
                },
                {
                    "day_of_week": 1,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 2,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 3,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 4,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 5,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 6,
                    "enabled": false,
                    "timezone": "Europe\/Warsaw",
                    "start_time": null,
                    "end_time": null
                }
            ]
        },
        {
            "id": 24,
            "enabled": true,
            "user": {
                "id": 3,
                "name": "Manager2",
                "tel": "+48570934649",
                "email": "manager2@callpage.io",
                "avatar": null
            },
            "departments": [],
            "business_times": [
                {
                    "day_of_week": 0,
                    "enabled": false,
                    "timezone": "Europe\/Warsaw",
                    "start_time": null,
                    "end_time": null
                },
                {
                    "day_of_week": 1,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 2,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 3,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 4,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 5,
                    "enabled": true,
                    "timezone": "Europe\/Warsaw",
                    "start_time": "09:00:00",
                    "end_time": "17:00:00"
                },
                {
                    "day_of_week": 6,
                    "enabled": false,
                    "timezone": "Europe\/Warsaw",
                    "start_time": null,
                    "end_time": null
                }
            ]
        }
    ],
    "meta": {
        "offset": 0,
        "limit": 100,
        "count": 3
    }
}

Get managers for widget.

Action

GET https://core.callpage.io/api/v1/external/managers/all

Query Parameters

Parameter Type Required Description Default
widget_id int true Widget identifier. You can find it in widgets tab.
offset int false If set, the result will be offset by this value. 0
limit int false If set, the result will be limited. 100

Get Manager

Example request:

GET /api/v1/external/managers/get?widget_id=1&user_id=2 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/managers/get?widget_id=1&user_id=2" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 23,
        "enabled": true,
        "user": {
            "id": 2,
            "name": "Manager1",
            "tel": "+48570934649",
            "email": "manager1@callpage.io",
            "avatar": null
        },
        "departments": [],
        "business_times": [
            {
                "day_of_week": 0,
                "enabled": false,
                "timezone": "Europe\/Warsaw",
                "start_time": null,
                "end_time": null
            },
            {
                "day_of_week": 1,
                "enabled": true,
                "timezone": "Europe\/Warsaw",
                "start_time": "09:00:00",
                "end_time": "17:00:00"
            },
            {
                "day_of_week": 2,
                "enabled": true,
                "timezone": "Europe\/Warsaw",
                "start_time": "09:00:00",
                "end_time": "17:00:00"
            },
            {
                "day_of_week": 3,
                "enabled": true,
                "timezone": "Europe\/Warsaw",
                "start_time": "09:00:00",
                "end_time": "17:00:00"
            },
            {
                "day_of_week": 4,
                "enabled": true,
                "timezone": "Europe\/Warsaw",
                "start_time": "09:00:00",
                "end_time": "17:00:00"
            },
            {
                "day_of_week": 5,
                "enabled": true,
                "timezone": "Europe\/Warsaw",
                "start_time": "09:00:00",
                "end_time": "17:00:00"
            },
            {
                "day_of_week": 6,
                "enabled": false,
                "timezone": "Europe\/Warsaw",
                "start_time": null,
                "end_time": null
            }
        ]
    },
    "meta": []
}

Get manager by user_id and widget_id.

Action

GET https://core.callpage.io/api/v1/external/managers/get

Query Parameters

Parameter Type Required Description
user_id int true User identifier. You can find it in users tab.
widget_id int true Widget identifier. You can find it in widgets tab.

Create Manager

Example request:

POST /api/v1/external/managers/create HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "user_id": 3,
    "widget_id": 3,
    "enabled": true,
    "business_times": [
        {
            "day_of_week": 0,
            "enabled": false,
            "start_time": null,
            "end_time": null
        },
        {
            "day_of_week": 1,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 2,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 3,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 4,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 5,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 6,
            "enabled": false,
            "start_time": null,
            "end_time": null
        }
    ]
}
curl -X POST "https://core.callpage.io/api/v1/external/managers/create" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "user_id": 3,
             "widget_id": 3,
             "enabled": true,
             "business_times": [
                 {
                     "day_of_week": 0,
                     "enabled": false,
                     "start_time": null,
                     "end_time": null
                 },
                 {
                     "day_of_week": 1,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 2,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 3,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 4,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 5,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 6,
                     "enabled": false,
                     "start_time": null,
                     "end_time": null
                 }
             ]
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 21
    }
}

Create manager.

Action

POST https://core.callpage.io/api/v1/external/managers/create

Query Parameters

Parameter Type Required Description Default
user_id int true User identifier. You can find it in users tab.
widget_id int true Widget identifier. You can find it in widgets tab.
enabled boolean true Indicates whether to call to the manager or not. true
business_times array false Manager’s working hours. Click here to retrieve more information about business_times array format. 9:00AM-5:00PM Monday-Friday

Update Manager

Example request:

POST /api/v1/external/managers/update HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "user_id": 3,
    "widget_id": 3,
    "enabled": true,
    "business_times": [
        {
            "day_of_week": 0,
            "enabled": false,
            "start_time": null,
            "end_time": null
        },
        {
            "day_of_week": 1,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 2,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 3,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 4,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 5,
            "enabled": true,
            "start_time": "09:00",
            "end_time": "17:00"
        },
        {
            "day_of_week": 6,
            "enabled": false,
            "start_time": null,
            "end_time": null
        }
    ]
}
curl -X POST "https://core.callpage.io/api/v1/external/managers/update" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "user_id": 3,
             "widget_id": 3,
             "enabled": true,
             "business_times": [
                 {
                     "day_of_week": 0,
                     "enabled": false,
                     "start_time": null,
                     "end_time": null
                 },
                 {
                     "day_of_week": 1,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 2,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 3,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 4,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 5,
                     "enabled": true,
                     "start_time": "09:00",
                     "end_time": "17:00"
                 },
                 {
                     "day_of_week": 6,
                     "enabled": false,
                     "start_time": null,
                     "end_time": null
                 }
             ]
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 21
    }
}

Update manager.

Action

POST https://core.callpage.io/api/v1/external/managers/update

Query Parameters

Parameter Type Required Description Default
user_id int true User identifier. You can find it in users tab.
widget_id int true Widget identifier. You can find it in widgets tab.
enabled boolean true Indicates whether to call to the manager or not. true
business_times array false Manager’s working hours. Click here to retrieve more information about business_times array format. 9:00AM-5:00PM Monday-Friday

Delete Manager

Example request:

POST /api/v1/external/managers/delete HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "user_id": 3,
    "widget_id": 3,
}
curl -X POST "https://core.callpage.io/api/v1/external/managers/delete" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "user_id": 3,
             "widget_id": 3
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": null
}

Delete manager.

Action

POST https://core.callpage.io/api/v1/external/managers/delete

Query Parameters

Parameter Type Required Description
user_id int true User identifier. You can find it in users tab.
widget_id int true Widget identifier. You can find it in widgets tab.

Voice Messages

Default voice messages:

manager.call


visitor.call

Voice message is a message that is played in certain situations during a call. Currently there are two messages that are allowed to be customized by the user: manager.call and visitor.call.

Voice Message Identifiers

Message Identifier Description
manager.call A greeting message for manager when one pick ups a phone.
visitor.call A greeting message for visitor.

Language Support

If there are no custom messages set, Callpage provides default ones in both Polish and English. Because the voice messages are attached to the widget, the language of voice message is determined by locale of the widget.

Get All Voice Messages

Example request:

GET /api/v1/external/voice/all?widget_id=1 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/voice/all?widget_id=1" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": [
        {
            "enabled": true,
            "message_id": "manager.call",
            "updated_at": null,
            "recording": {
                "full_url": "https://core.callpage.io/plugins/thbsolutions/voip/assets/sounds/en/manager.call.mp3"
            }
        },
        {
            "enabled": false,
            "message_id": "visitor.call",
            "updated_at": null,
            "recording": {
                "full_url": "https://core.callpage.io/plugins/thbsolutions/voip/assets/sounds/en/visitor.call.mp3"
            }
        }
    ]
}

Get voice messages. If no custom voice messages are created this method will return the default ones.

Action

GET https://core.callpage.io/api/v1/external/voice/all

Query Parameters

Parameter Type Required Description
widget_id int true Widget identifier. You can find it in widgets tab.

Create Voice Message

Example request:

POST /api/v1/external/voice/create HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "widget_id": 3,
    "message_id": "manager.call",
    "enabled": true,
    "file": "https://core.callpage.io/plugins/thbsolutions/voip/assets/sounds/en/manager.call.mp3"
}
curl -X POST "https://core.callpage.io/api/v1/external/voice/create" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "widget_id": 3,
             "message_id": "manager.call",
             "enabled": true,
             "file": "https://core.callpage.io/plugins/thbsolutions/voip/assets/sounds/en/manager.call.mp3"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 37
    }
}

Create custom voice message.

The file parameter should contain the valid URL with file. This file should meet the following conditions:

Action

POST https://core.callpage.io/api/v1/external/voice/create

Query Parameters

Parameter Type Required Description
widget_id int true Widget identifier. You can find it in widgets tab.
message_id string true Allowed message identifiers are listed here.
enabled boolean true Indicates whether the message should be enabled or not.
file url false File with audio recording.

Update Voice Message

Example request:

POST /api/v1/external/voice/update HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "widget_id": 3,
    "message_id": "manager.call",
    "enabled": true,
    "file": "https://core.callpage.io/plugins/thbsolutions/voip/assets/sounds/en/manager.call.mp3"
}
curl -X POST "https://core.callpage.io/api/v1/external/voice/update" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "widget_id": 3,
             "message_id": "manager.call",
             "enabled": true,
             "file": "https://core.callpage.io/plugins/thbsolutions/voip/assets/sounds/en/manager.call.mp3"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 37
    }
}

Update existing custom voice message. It is impossible to update default message – if you did not create custom message yet use this endpoint.

The file parameter should contain the valid URL with file. This file should meet the following conditions:

Action

POST https://core.callpage.io/api/v1/external/voice/update

Query Parameters

Parameter Type Required Description
widget_id int true Widget identifier. You can find it in widgets tab.
message_id string true Allowed message identifiers are listed here.
enabled boolean true Indicates whether the message should be enabled or not.
file url false File with audio recording.

Reset Voice Message

Example request:

POST /api/v1/external/voice/reset HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "widget_id": 3,
    "message_id": "manager.call"
}
curl -X POST "https://core.callpage.io/api/v1/external/voice/reset" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "widget_id": 3,
             "message_id": "manager.call"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": null
}

Reset custom voice message. If no message_id is provided this method will reset all voice messages to default ones.

Action

POST https://core.callpage.io/api/v1/external/voice/reset

Query Parameters

Parameter Type Required Description
widget_id int true Widget identifier. You can find it in widgets tab.
message_id string false Allowed message identifiers are listed here.

SMSs

Default SMS messages:

visitor.dial-completed

Thank you for contacting us on website :url

Your manager: :name
Tel.: :tel

Have a nice day, :company_name team

visitor.call-scheduled

Hi, dear customer!

Recently, you ordered a call from website :url. You will receive a call from a representative in 5 minutes.

Have a nice day, :company_name team

manager.call-completed

Hi, :name!

Thank you for conversation with a potential customer.
For further contact:
Tel.: :tel

Have a nice day, :company_name team

user.missed-call-complaint

Hi, :name!

Your managers missed a call from visitor on :url.
It will be great if you could solve this issue ASAP.
Tel.: :tel

Have a nice day, :company_name team

Custom SMS is a message that is sent in certain situations. Currently there are few messages that are allowed to be customized by the user: visitor.dial-completed, visitor.call-scheduled, manager.call-completed and user.missed-call-complaint.

Message Identifiers

Message Identifier Description
visitor.dial-completed A message with manager’s contact details is sent to the visitor after the conversation is successfully completed.
visitor.call-scheduled A message is sent to the visitor several minutes before a scheduled call to remind user about conversation.
manager.call-completed A message with visitor’s contact details is sent to the manager after the successful conversation.
user.missed-call-complaint A message with visitor’s contact details is sent to the report number when the call is missed.

Message Variables

Message variables can be use to provide more information and for further personalization of your SMS. These variables will be substituted with proper values depending on the message that is being sent.

Variable Description
:company_name Company name.
:name Manager’s name.
:tel Manager’s/visitor’s phone number.
:url Widget’s website URL.

Language Support

If there are no custom messages set, Callpage provides default ones in the following languages:

Get All SMSs

Example request:

GET /api/v1/external/sms/all?widget_id=1 HTTP/1.1

Accept: application/json
Authorization: xxxxxxxxxxxx
curl -X GET "https://core.callpage.io/api/v1/external/sms/all?widget_id=1" \
     -H "Accept: application/json" \
     -H "Authorization: xxxxxxxxxxxx"

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": [
        {
            "enabled": 1,
            "message_id": "visitor.dial-completed",
            "text": "Thank you for contacting us on website :url\n\nYour manager: :name\nTel.: :tel\n\nHave a nice day, :company_name team",
            "updated_at": null
        },
        {
            "enabled": 1,
            "message_id": "visitor.call-scheduled",
            "text": "Hi, dear customer!\n\nRecently, you ordered a call from website :url. You will receive a call from a representative in 5 minutes.\n\nHave a nice day, :company_name team",
            "updated_at": null
        },
        {
            "enabled": 1,
            "message_id": "manager.call-completed",
            "text": "Hi, :name!\n\nThank you for conversation with a potential customer.\nFor further contact:\nTel.: :tel\n\nHave a nice day, :company_name team",
            "updated_at": null
        },
        {
            "enabled": 1,
            "message_id": "user.missed-call-complaint",
            "text": "Hi, :name!\n\nYour managers missed a call from visitor on :url.\nIt will be great if you could solve this issue ASAP.\nTel.: :tel\n\nHave a nice day, :company_name team",
            "updated_at": null
        }
    ]
}

Action

GET https://core.callpage.io/api/v1/external/sms/all

Query Parameters

Parameter Type Required Description
widget_id int true Widget identifier. You can find it in widgets tab.

Create SMS

Example request:

POST /api/v1/external/sms/create HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "widget_id": 3,
    "message_id": "user.missed-call-complaint",
    "enabled": true,
    "text": "Hi, :name!\n\nYour managers missed a call from visitor on :url.\nIt will be great if you could solve this issue ASAP.\nTel.: :tel\n\nHave a nice day, :company_name team"
}
curl -X POST "https://core.callpage.io/api/v1/external/sms/create" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "widget_id": 3,
             "message_id": "user.missed-call-complaint",
             "enabled": true,
             "text": "Hi, :name!\n\nYour managers missed a call from visitor on :url.\nIt will be great if you could solve this issue ASAP.\nTel.: :tel\n\nHave a nice day, :company_name team"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 49
    }
}

Create custom SMS.

Action

POST https://core.callpage.io/api/v1/external/sms/create

Query Parameters

Parameter Type Required Description Default
widget_id int true Widget identifier. You can find it in widgets tab.
message_id string true Allowed message identifiers are listed here.
enabled boolean false Indicates whether the message should be enabled or not. true
text url true SMS text. It can not be longer than 240 characters. You are allowed to use message variables.

Update SMS

Example request:

POST /api/v1/external/sms/update HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "widget_id": 3,
    "message_id": "user.missed-call-complaint",
    "enabled": true,
    "text": "Hi, :name!\n\nYour managers missed a call from visitor on :url.\nIt will be great if you could solve this issue ASAP.\nTel.: :tel\n\nHave a nice day, :company_name team"
}
curl -X POST "https://core.callpage.io/api/v1/external/sms/update" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "widget_id": 3,
             "message_id": "user.missed-call-complaint",
             "enabled": true,
             "text": "Hi, :name!\n\nYour managers missed a call from visitor on :url.\nIt will be great if you could solve this issue ASAP.\nTel.: :tel\n\nHave a nice day, :company_name team"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": {
        "id": 49
    }
}

Update custom SMS. It is impossible to update default SMS – if you did not create custom SMS yet use this endpoint.

Action

POST https://core.callpage.io/api/v1/external/sms/update

Query Parameters

Parameter Type Required Description Default
widget_id int true Widget identifier. You can find it in widgets tab.
message_id string true Allowed message identifiers are listed here.
enabled boolean false Indicates whether the message should be enabled or not. true
text url true SMS text. It can not be longer than 240 characters. You are allowed to use message variables.

Reset SMS

Example request:

POST /api/v1/external/sms/reset HTTP/1.1

Accept: application/json
Content-Type: application/json
Authorization: xxxxxxxxxxxx

{
    "widget_id": 3,
    "message_id": "user.missed-call-complaint"
}
curl -X POST "https://core.callpage.io/api/v1/external/sms/reset" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: xxxxxxxxxxxx" \
     -d '{
             "widget_id": 3,
             "message_id": "user.missed-call-complaint"
         }'

Response:

{
    "hasError": false,
    "errorCode": 0,
    "message": "",
    "data": null
}

Reset SMS. If no message_id is provided this method will reset all SMSs to default ones.

Action

POST https://core.callpage.io/api/v1/external/sms/reset

Query Parameters

Parameter Type Required Description
widget_id int true Widget identifier. You can find it in widgets tab.
message_id string false Allowed message identifiers are listed here.

HTTP Status Codes

The Callpage API uses the following HTTP status codes:

Code Meaning
200 OK Your request was processed sucessfully.
401 Unauthorized Your API key is incorrect.
403 Forbidden You do not have access to this resource.
404 Not Found The specified kitten could not be found.
422 Unprocessable entity Check errorCode and message fields in response data for more information.
500 Internal Server Error We had a problem with our server or an application error occured. Try again later.
503 Service Unavailable We’re temporarially offline for maintanance. Please try again later.

Webhooks

Usage

Every time an event occurs in our system, we could notify you about this using outgoing webhooks. All you need is a simple web server that allows to receive incoming POST requests and is able to parse JSON in order to read data.

Example of SSH tunnel using ngrok:

ngrok http 80

Example of simple web server in NodeJS:

var http = require('http');

var server = http.createServer(function (req, res) {
  res.end('ok');
});

server.listen(80);

Outgoing webhook is one of many available integrations. Integrations at Callpage are tied to specific widget.

Creating Outgoing Webhook

In order to create new outgoing webhook head over to widgets tab in Callpage Dashboard. Next, you have to select widget. Select Edit widget, after that you should have Integrations tab in options where you can create new integrations.

Events

Here is the complete list of events which are available using webhooks.

Key Description
call.scheduled Call was scheduled by your customer.
call.new Call was ordered immediately.
call.missed Call from your customer was missed, because there were no available managers.
call.completed Call was successfully completed.
data.added Your customer left you some additional feedback and information about the call.
new.message You customer send you a message.

Events lifetime

The events lifetime looks more or less like this:

call.scheduled/call.new -> call.missed/call.completed -> data.added

First of all the call.scheduled or call.new may be fired depends of what visitor requested. In case of call.new, after that, depending on the circumstances, either call.missed or call.completed is fired. If fired event is call.completed you may expect additional feedback from your customer (data.added event fired).

call.scheduled

Payload:

{
    "data": {
        "event": "call.scheduled",
        "id": 3419,
        "status": "scheduled",
        "ref_id": null,
        "to": "+48888888769",
        "widget_id": 3,
        "created_at": "2016-09-08 13:32:54",
        "scheduled_at": "2016-09-08 14:30:00",
        "request": null,
        "fields": null
    }
}

This event is fired when a call was scheduled by your customer.

Possible statuses:

call.new

Payload:

{
    "data": {
        "event": "call.new",
        "id": 3419,
        "status": "new",
        "ref_id": null,
        "to": "+48888888769",
        "widget_id": 3,
        "created_at": "2016-09-08 13:32:54",
        "scheduled_at": null,
        "request": null,
        "fields": null
    }
}

This event is fired when a call was requested by your customer.

call.missed

Payload:

{
    "data": {
        "event": "call.missed",
        "id": 3419,
        "status": "manager-failed",
        "ref_id": null,
        "to": "+48888888769",
        "widget_id": 3,
        "created_at": "2016-09-08 13:32:54",
        "scheduled_at": null,
        "request": null,
        "call_attempts_count": 3,
        "fields": null
    }
}

This event is fired when a call was missed by your customer or your managers.

Possible statuses:

call.completed

Payload:

{
    "data": {
        "event": "call.completed",
        "id": 3419,
        "status": "completed",
        "ref_id": null,
        "to": "+48888888769",
        "widget_id": 3,
        "created_at": "2016-09-08 13:32:54",
        "scheduled_at": null,
        "request": null,
        "call": {
            "direction": "ab",
            "queued_at": "2016-09-08 13:33:03",
            "started_at": "2016-09-08 13:33:25",
            "dialed_at_a": "2016-09-08 13:33:17",
            "dialed_at_b": "2016-09-08 13:33:21",
            "answered_at_a": "2016-09-08 13:33:22",
            "answered_at_b": "2016-09-08 13:33:25",
            "ended_at_a": "2016-09-08 13:37:33",
            "ended_at_b": "2016-09-08 13:37:25",
            "dialed_time_a": "14",
            "answered_time_a": "5",
            "dialed_time_b": "18",
            "answered_time_b": "4",
            "billing_time": "248",
            "recording": null
        },
        "call_attempt": {
            "manager": {
                "id": 4,
                "name": "Admin",
                "tel": "+48570934649",
                "email": "admin@callpage.io"
            }
        },
        "call_attempts_count": 1,
        "fields": null
    }
}

This event is fired when a call was successfully completed.

data.added

Payload:

{
    "data": {
        "event": "data.added",
        "id": 3419,
        "status": "completed",
        "ref_id": null,
        "to": "+48888888769",
        "email": "happy@customer.com",
        "widget_id": 3,
        "created_at": "2016-09-08 13:32:54",
        "scheduled_at": null,
        "request": null,
        "call": {
            "direction": "ab",
            "queued_at": "2016-09-08 13:33:03",
            "started_at": "2016-09-08 13:33:25",
            "dialed_at_a": "2016-09-08 13:33:17",
            "dialed_at_b": "2016-09-08 13:33:21",
            "answered_at_a": "2016-09-08 13:33:22",
            "answered_at_b": "2016-09-08 13:33:25",
            "ended_at_a": "2016-09-08 13:37:33",
            "ended_at_b": "2016-09-08 13:37:25",
            "dialed_time_a": "14",
            "answered_time_a": "5",
            "dialed_time_b": "18",
            "answered_time_b": "4",
            "billing_time": "248",
            "recording": null
        },
        "call_attempt": {
            "manager": {
                "id": 4,
                "name": "Admin",
                "tel": "+48570934649",
                "email": "admin@callpage.io"
            }
        },
        "call_attempts_count": 1,
        "fields": [
            {
                "id": 3,
                "label": "E-mail",
                "placeholder": null,
                "hint": null,
                "value": null,
                "slug": "email",
                "field_value": "customer@example.com"
            },
            {
                "id": 4,
                "label": "Your name",
                "placeholder": null,
                "hint": null,
                "value": null,
                "slug": "name",
                "field_value": "Happy Customer"
            }
        ]
    }
}

This event is fired when customer leaves additional data (such as email address and feedback) after a call.

new.message

Payload:

{
    "data": {
       "email"               : "happy@customer.com",
       "message_from_client" : "Some text",
       "call_request"        : ["$this->callRequest"],
       "number"              : "+48 123 123 123",
       "widget"              : "1",
       "user"                : "2",
       "url"                 : "https://test.com",
       "link"                : "https://core.callpage.io/calls/1"
    }
}

This event is fired when a message is left by your customer.