Introduction
Welcome to the CallWidget API! You can use our API to access CallWidget API endpoints, which you can get information for your leads.
You can also find actions and triggers for call and text.
Authentication
Get Access Token
An example of included Authorization Header:
curl "https://api.callwidget.co/api/v1/api-login"
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '{
"email": "EMAIL",
"password": "PASSWORD"
}'
const request = require('request');
var data = {
"email": "EMAIL",
"password": "PASSWORD"
};
var options = {
method: 'POST',
json: true,
body: data,
url: 'https://api.callwidget.co/api/v1/api-login',
headers: {
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns JSON structured like this:
{
"token_type": "Bearer",
"expires_in": XXX,
"access_token": "ACCESS_TOKEN",
"refresh_token": "REFRESH_TOKEN"
}
CallWidget uses OAuth2 for Authentication.
CallWidget expects for the AuthToken to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer $ACCESS_TOKEN
Refresh Access Token
An example of Refresh Access Token Api:
curl "https://api.callwidget.co/api/v1/refresh-token"
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '{
"refresh_token": "$REFRESH_TOKEN",
}'
const request = require('request');
var data = {
"refresh_token": "$REFRESH_TOKEN",
};
var options = {
method: 'POST',
json: true,
body: data,
url: 'https://api.callwidget.co/api/v1/refresh-token',
headers: {
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns JSON structured like this:
{
"token_type": "Bearer",
"expires_in": XXX,
"access_token": "ACCESS_TOKEN",
"refresh_token": "REFRESH_TOKEN"
}
Refresh Your Access Token before it's expired.
Install
Get Installs
curl -X GET "https://api.callwidget.co/api/v1/share/installs"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
const request = require('request');
var options = {
method: 'GET',
url: 'https://api.callwidget.co/api/v1/share/installs',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns Array structured like this:
[
{
"id": 1,
"name": "+17866275049",
"label": "+17866275049"
}
]
This endpoint returns list of installs.
HTTP Request
GET https://api.callwidget.co/api/v1/share/installs
Department
Get Departments
curl -X GET "https://api.callwidget.co/api/v1/share/departments"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
const request = require('request');
var options = {
method: 'GET',
url: 'https://api.callwidget.co/api/v1/share/departments',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns Array structured like this:
[
{
"id": 1,
"name": "Test Department",
"label": "Test Department"
}
]
This endpoint returns list of departments.
HTTP Request
GET https://api.callwidget.co/api/v1/share/departments
Tag
Get Tags
curl -X GET "https://api.callwidget.co/api/v1/share/tags"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
const request = require('request');
var options = {
method: 'GET',
url: 'https://api.callwidget.co/api/v1/share/tags',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns Array structured like this:
[
{
"id": 1,
"name": "VIP",
"label": "VIP"
}
]
This endpoint returns list of tags.
HTTP Request
GET https://api.callwidget.co/api/v1/share/tags
Automation
Get Automations
curl -X GET "https://api.callwidget.co/api/v1/share/automations"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
const request = require('request');
var options = {
method: 'GET',
url: 'https://api.callwidget.co/api/v1/share/automations',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns Array structured like this:
[
{
"id": 1,
"name": "Keyword Automation",
"label": "Keyword Automation"
}
]
This endpoint returns list of automations
HTTP Request
GET https://api.callwidget.co/api/v1/share/automations
Run Automation
curl -X POST "https://api.callwidget.co/api/v1/share/new-automation"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
-d '{
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"automation": "1",
"department": "Sales",
"bday": "1990-06-02",
"tag": [
"vip"
]
}'
const request = require('request');
var data = {
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"automation": "1",
"department": "Sales",
"bday": "1990-06-02",
"tag": [
"vip"
]
};
var options = {
method: 'POST',
json: true,
body: data,
url: 'https://api.callwidget.co/api/v1/share/new-automation',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns JSON structured like this:
{
"created_at": "2021-04-26T09:20:08.530429Z",
"contact": {
"number": "+17862455063",
"type": "sms",
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"bday": "1990-06-02",
"note": "Test User"
},
"install": {
"number": "+17866275049",
"website": "http://www.test.com"
},
"department": {
"name": "Sales"
}
}
This endpoint starts automation on a contact.
HTTP Request
POST https://api.callwidget.co/api/v1/share/new-automation
Query Parameters
Parameter | Type | Description |
---|---|---|
first_name |
String | First name of the contact. 256 character limit |
last_name |
String | Last name of the contact. 256 character limit |
email |
Email of the contact. | |
phone |
String Required |
Phone number of the contact. International format e.g: +17862455063 |
install |
String Required |
Phone number of the install. International format e.g: +17866275049 |
automation |
String Required |
Automation ID which we will run on a contact e.g: 2 |
department |
String | Name of the department. |
bday |
String | Birthday of the contact. |
tags |
Array | Tags which contact will be added to. |
Contact
Create a Contact
curl -X POST "https://api.callwidget.co/api/v1/share/new-contact"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
-d '{
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02",
"tag": [
"vip"
]
}'
const request = require('request');
var data = {
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02",
"tag": [
"vip"
]
};
var options = {
method: 'POST',
json: true,
body: data,
url: 'https://api.callwidget.co/api/v1/share/new-contact',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns JSON structured like this:
{
"created_at": "2021-04-26T09:20:08.530429Z",
"contact": {
"number": "+17862455063",
"type": "sms",
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"bday": "1990-06-02",
"note": "Test User"
},
"install": {
"number": "+17866275049",
"website": "http://www.test.com"
},
"department": {
"name": "Sales"
}
}
This endpoint creates a contact.
HTTP Request
POST https://api.callwidget.co/api/v1/share/new-contact
Query Parameters
Parameter | Type | Description |
---|---|---|
first_name |
String | First name of the contact. 256 character limit |
last_name |
String | Last name of the contact. 256 character limit |
email |
Email of the contact. | |
phone |
String Required |
Phone number of the contact. International format e.g: +17862455063 |
install |
String Required |
Phone number of the install. International format e.g: +17866275049 |
department |
String | Name of the department. |
bday |
String | Birthday of the contact. |
tags |
Array | Tags which contact will be added to. |
Calls
Create a Call
curl -X POST "https://api.callwidget.co/api/v1/share/new-call"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
-d '{
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02"
}'
const request = require('request');
var data = {
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02"
};
var options = {
method: 'POST',
json: true,
body: data,
url: 'https://api.callwidget.co/api/v1/share/new-call',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns JSON structured like this:
{
"created_at": "2021-04-26T09:20:08.530429Z",
"contact": {
"number": "+17862455063",
"type": "sms",
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"bday": "1990-06-02",
"note": "Test User"
},
"install": {
"number": "+17866275049",
"website": "http://www.test.com"
},
"department": {
"name": "Sales"
}
}
This endpoint creates a call request from the contat.
HTTP Request
POST https://api.callwidget.co/api/v1/share/new-call
Query Parameters
Parameter | Type | Description |
---|---|---|
first_name |
String | First name of the contact. 256 character limit |
last_name |
String | Last name of the contact. 256 character limit |
email |
Email of the contact. | |
phone |
String Required |
Phone number of the contact. International format e.g: +17862455063 |
install |
String Required |
Phone number of the install. International format e.g: +17866275049 |
department |
String | Name of the department. |
bday |
String | Birthday of the contact. |
Text
Send a text
curl -X POST "https://api.callwidget.co/api/v1/share/new-sms"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
-d '{
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02",
"tag": [
"vip"
]
}'
const request = require('request');
var data = {
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02",
"tag": [
"vip"
]
};
var options = {
method: 'POST',
json: true,
body: data,
url: 'https://api.callwidget.co/api/v1/share/new-sms',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns JSON structured like this:
{
"created_at": "2021-04-26T09:20:08.530429Z",
"contact": {
"number": "+17862455063",
"type": "sms",
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"bday": "1990-06-02",
"note": "Test User"
},
"install": {
"number": "+17866275049",
"website": "http://www.test.com"
},
"department": {
"name": "Sales"
},
"message": "Test Message"
}
This endpoint sends a text to the contact.
HTTP Request
POST https://api.callwidget.co/api/v1/share/new-sms
Query Parameters
Parameter | Type | Description |
---|---|---|
first_name |
String | First name of the contact. 256 character limit |
last_name |
String | Last name of the contact. 256 character limit |
email |
Email of the contact. | |
phone |
String Required |
Phone number of the contact. International format e.g: +17862455063 |
install |
String Required |
Phone number of the install. International format e.g: +17866275049 |
department |
String | Name of the department. |
bday |
String | Birthday of the contact. |
tags |
Array | Tags which contact will be added to. |
Call & Text
Create a Call & Send a text
curl -X POST "https://api.callwidget.co/api/v1/share/new-sms-call"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer $ACCESS_TOKEN"
-d '{
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02"
"message": "Test Message",
"tag": [
"vip"
]
}'
const request = require('request');
var data = {
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"phone": "+17862455063",
"install": "+17866275049",
"department": "Sales",
"bday": "1990-06-02"
"message": "Test Message",
"tag": [
"vip"
]
};
var options = {
method: 'POST',
json: true,
body: data,
url: 'https://api.callwidget.co/api/v1/share/new-sms-call',
headers: {
'Authorization':'Bearer $ACCESS_TOKEN'
}
};
request(options, function (error, response, body) {
// -> response
});
The above command returns JSON structured like this:
{
"created_at": "2021-04-26T09:20:08.530429Z",
"contact": {
"number": "+17862455063",
"type": "sms",
"first_name": "Test",
"last_name": "User",
"email": "testuser@gmail.com",
"bday": "1990-06-02",
"note": "Test User"
},
"install": {
"number": "+17866275049",
"website": "http://www.test.com"
},
"department": {
"name": "Sales"
},
"message": "Test Message"
}
This endpoint creates a call from & sends a text to the contact.
HTTP Request
POST https://api.callwidget.co/api/v1/share/new-sms-call
Query Parameters
Parameter | Type | Description |
---|---|---|
first_name |
String | First name of the contact. 256 character limit |
last_name |
String | Last name of the contact. 256 character limit |
email |
Email of the contact. | |
phone |
String Required |
Phone number of the contact. International format e.g: +17862455063 |
install |
String Required |
Phone number of the install. International format e.g: +17866275049 |
department |
String | Name of the department. |
bday |
String | Birthday of the contact. |
tags |
Array | Tags which contact will be added to. |
Errors
The CallWidget API uses the following error codes:
Error Code | Meaning |
---|---|
400 |
Bad Request -- Your request is invalid. |
401 |
Unauthorized -- Your API key is somehow incorrect, or lacks proper scope. |
403 |
Forbidden -- Your request was denied for lack of permission. |
404 |
Not Found -- The resource could not be found. |
405 |
Method Not Allowed -- You tried to access a CallWidget with an invalid method. |
406 |
Not Acceptable -- You requested a format that isn't json. |
429 |
Too Many Requests -- You're requesting too many receipts! Slow down! |
500 |
Internal Server Error -- We had a problem with our server. Try again later. |
503 |
Service Unavailable -- We're temporarily offline. We are working our best to fix it. |