SnapCall Rest API
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
SnapCall's Rest API allows you to interact automatically with your SnapCall data on demand. With simple scripts, you can build your own analytics by retrieving calls informations and manage your SnapCall buttons list.
API key Authentication
The SnapCall API uses an API key to authenticate requests. You can view your API key in the SnapCall Dashboard.
Your API key carry many privileges, so be sure to keep it secure! Do not share your API key in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
If you need to authenticate via bearer auth (e.g., for a cross-origin request), you can pass your API key as the bearer token.
All request bodies should have content type application/json and be valid JSON.
Buttons
Create
[POST] /v2/buttons
Code samples
const apiKey = 'abc';
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
name,
brand,
call_id,
agent,
schedule_template_id,
timezone,
caller_id,
config,
display_page,
cart_value,
active,
}),
};
fetch('https://api.snapcall.io/v2/buttons', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/buttons');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'name' => string,
'brand' => string,
'call_id' => alternatives,
'agent' => string,
'schedule_template_id' => number,
'timezone' => string,
'caller_id' => alternatives,
'config' => object,
'display_page' => string,
'cart_value' => number,
'active' => boolean,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Create a button
JSON Payload
Parameter | Type | Required |
---|---|---|
name | string | true |
brand | string | false |
call_id | alternatives | false |
agent | string | false |
schedule_template_id | number | false |
timezone | string | false |
caller_id | alternatives | false |
config | object | false |
display_page | string | false |
cart_value | number | false |
active | boolean | false |
Create batch
[POST] /v2/buttons/batch
Code samples
const apiKey = 'abc';
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
buttons,
}),
};
fetch('https://api.snapcall.io/v2/buttons/batch', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/buttons/batch');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'buttons' => array,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Create multiple buttons
JSON Payload
Parameter | Type | Required |
---|---|---|
buttons | array | true |
Info
[GET] /v2/buttons/{bid}/info
Code samples
fetch('https://api.snapcall.io/v2/buttons/bid/info')
.then(res => res.json())
.then(console.log);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/buttons/bid/info');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Retrieve information about a specific button
URI Components
Parameter | Type | Required |
---|---|---|
bid | alternatives | true |
Read
[GET] /v2/buttons/{bid}
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/buttons/bid', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/buttons/bid');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read a button
URI Components
Parameter | Type | Required |
---|---|---|
bid | alternatives | true |
Read all
[GET] /v2/buttons
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/buttons', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/buttons');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read all buttons
Query String
Parameter | Type | Required |
---|---|---|
page | number | false |
limit | number | false |
name | string | false |
agent | string | false |
active | boolean | false |
Update
[PUT] /v2/buttons/{bid}
Code samples
const apiKey = 'abc';
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
name,
brand,
call_id,
schedule_template_id,
timezone,
caller_id,
config,
display_page,
cart_value,
active,
}),
};
fetch('https://api.snapcall.io/v2/buttons/bid', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/buttons/bid');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'name' => string,
'brand' => string,
'call_id' => alternatives,
'schedule_template_id' => number,
'timezone' => string,
'caller_id' => alternatives,
'config' => object,
'display_page' => string,
'cart_value' => number,
'active' => boolean,
]));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Update a button
URI Components
Parameter | Type | Required |
---|---|---|
bid | alternatives | true |
JSON Payload
Parameter | Type | Required |
---|---|---|
name | string | false |
brand | string | false |
call_id | alternatives | false |
schedule_template_id | number | false |
timezone | string | false |
caller_id | alternatives | false |
config | object | false |
display_page | string | false |
cart_value | number | false |
active | boolean | false |
Update batch
[PUT] /v2/buttons/batch
Code samples
const apiKey = 'abc';
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
buttons,
}),
};
fetch('https://api.snapcall.io/v2/buttons/batch', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/buttons/batch');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'buttons' => array,
]));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Update multiple buttons
JSON Payload
Parameter | Type | Required |
---|---|---|
buttons | array | true |
Calls
Read
[GET] /v2/calls/{id}
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/calls/123', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/calls/123');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read a call, given an ID
URI Components
Parameter | Type | Required |
---|---|---|
id | number | true |
Read all
[GET] /v2/calls
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/calls', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/calls');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read all calls
Query String
Parameter | Type | Required |
---|---|---|
page | number | false |
limit | number | false |
rate | alternatives | false |
start | date | false |
end | date | false |
button | alternatives | false |
status | alternatives | false |
agent | alternatives | false |
client | alternatives | false |
ani | number | false |
exporting | boolean | false |
Recording - Delete
[DELETE] /v2/calls/{id}/recording
Code samples
const apiKey = 'abc';
const options = {
method: 'DELETE',
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/calls/123/recording', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/calls/123/recording');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Deletes a call record
URI Components
Parameter | Type | Required |
---|---|---|
id | number | true |
Recording - Read
[GET] /v2/calls/{id}/recording
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/calls/123/recording', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/calls/123/recording');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Provides access to a call record
URI Components
Parameter | Type | Required |
---|---|---|
id | number | true |
Schedule-templates
Create
[POST] /v2/schedule-templates
Code samples
const apiKey = 'abc';
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
name,
schedule,
}),
};
fetch('https://api.snapcall.io/v2/schedule-templates', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/schedule-templates');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'name' => string,
'schedule' => array,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Create a schedule template
JSON Payload
Parameter | Type | Required |
---|---|---|
name | string | true |
schedule | array | true |
Read
[GET] /v2/schedule-templates/{id}
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/schedule-templates/123', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/schedule-templates/123');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read a schedule template
URI Components
Parameter | Type | Required |
---|---|---|
id | number | true |
Read all
[GET] /v2/schedule-templates
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/schedule-templates', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/schedule-templates');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read all schedule template
Query String
Parameter | Type | Required |
---|---|---|
page | number | false |
Update
[PUT] /v2/schedule-templates/{id}
Code samples
const apiKey = 'abc';
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
name,
schedule,
}),
};
fetch('https://api.snapcall.io/v2/schedule-templates/123', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/schedule-templates/123');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'name' => string,
'schedule' => array,
]));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Update a schedule template
URI Components
Parameter | Type | Required |
---|---|---|
id | number | true |
JSON Payload
Parameter | Type | Required |
---|---|---|
name | string | false |
schedule | array | false |
Agents
Read
[GET] /v2/agents/{email}
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/agents/hello', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/agents/hello');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read an agent
URI Components
Parameter | Type | Required |
---|---|---|
string | true |
Read
[GET] /v2/agents/{email}/info
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/agents/hello/info', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/agents/hello/info');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read an agent
URI Components
Parameter | Type | Required |
---|---|---|
string | true |
Status
[PUT] /v2/agents/{email}/status
Code samples
const apiKey = 'abc';
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
status,
}),
};
fetch('https://api.snapcall.io/v2/agents/hello/status', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/agents/hello/status');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'status' => string,
]));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Update the status of an agent
URI Components
Parameter | Type | Required |
---|---|---|
string | true |
JSON Payload
Parameter | Type | Required |
---|---|---|
status | string | true |
Update
[PUT] /v2/agents/{email}
Code samples
const apiKey = 'abc';
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
wrap_up_time,
last_bridge_end,
}),
};
fetch('https://api.snapcall.io/v2/agents/hello', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/agents/hello');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'wrap_up_time' => number,
'last_bridge_end' => number,
]));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Update an agent
URI Components
Parameter | Type | Required |
---|---|---|
string | true |
JSON Payload
Parameter | Type | Required |
---|---|---|
wrap_up_time | number | false |
last_bridge_end | number | false |
Partner
Activate account
[POST] /v2/partner/activate-account
Code samples
const apiKey = 'abc';
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
email,
user_id,
timezone,
currency,
}),
};
fetch('https://api.snapcall.io/v2/partner/activate-account', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/partner/activate-account');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'email' => string,
'user_id' => number,
'timezone' => string,
'currency' => string,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Activate a user account from partner. Authentication should be done using partner account api_key
.
JSON Payload
Parameter | Type | Required |
---|---|---|
string | false | |
user_id | number | false |
timezone | string | false |
currency | string | false |
Agent button
[POST] /v2/partner/agent-button
Code samples
const apiKey = 'abc';
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
agent_email,
stream,
}),
};
fetch('https://api.snapcall.io/v2/partner/agent-button', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/partner/agent-button');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'agent_email' => string,
'stream' => boolean,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Get an agent button. Authentication should be done using user api_key
.
JSON Payload
Parameter | Type | Required |
---|---|---|
agent_email | string | true |
stream | boolean | false |
Call
[GET] /v2/partner/calls/{id}
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/partner/calls/123', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/partner/calls/123');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read a call, given an ID
URI Components
Parameter | Type | Required |
---|---|---|
id | number | true |
Calls
[GET] /v2/partner/calls
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/partner/calls', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/partner/calls');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Get calls history.
Query String
Parameter | Type | Required |
---|---|---|
page | number | false |
limit | number | false |
start | date | false |
end | date | false |
agent | alternatives | false |
exporting | boolean | false |
Stats
[GET] /v2/partner/stats
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/partner/stats', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/partner/stats');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Get general call statistics.
Query String
Parameter | Type | Required |
---|---|---|
start | date | true |
end | date | true |
Users
Button
[POST] /v2/users/{id}/button
Code samples
const options = {
method: 'POST',
body: JSON.stringify({
referer,
cart_value,
}),
};
fetch('https://api.snapcall.io/v2/users/123/button', options)
.then(res => res.json())
.then(console.log);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/users/123/button');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'referer' => string,
'cart_value' => number,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Return a button passing every display filters
URI Components
Parameter | Type | Required |
---|---|---|
id | number | true |
JSON Payload
Parameter | Type | Required |
---|---|---|
referer | string | true |
cart_value | number | false |
Me
[GET] /v2/users/me
Code samples
const apiKey = 'abc';
const options = {
headers: {
Authorization: `Bearer ${apiKey}`,
},
};
fetch('https://api.snapcall.io/v2/users/me', options)
.then(res => res.json())
.then(console.log);
$api_key = 'abc';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.snapcall.io/v2/users/me');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$api_key}",
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Read the authenticated user