Introduction
This API is designed to let you do (almost) everything you can do from the timetoreply portal programmatically via API requests
Authentication
We currently only support personal access tokens for authentication. These can be obtained by logging into a company administrator account on timetoreply, visiting the API section, and clicking "Generate Access Token". Tokens have an expiration time of 1 year.
All requests made to our api with these generated access tokens will be assigned to the user that generated the access token.
You can create as many access tokens as you like, and you can revoke their access at any time from the same page when you created them.
Rate Limiting
Our API is rate limited to 30 requests per minute and the lower limit of 900 requests per hour.
If you exceed these limits, responses will get a Retry-After header which indicates how long you should wait until trying again.
Dates and Times
Most Dates and Times are converted into the timezone of your user profile on the fly before being sent to you.
Reply times are usually returned in seconds, but many reply times also have a "Friendly Reply Time" which is a formatted string.
Nomenclature
- Email Addresses are referred to as "email_usernames".
- Conversations are referred to as "threads".
- Message Ids are referred to as "internet_message_id" and are unique
- Reply times without business hours are referred to as "raw". e.g. "raw_replytime"
General
Responses have been generally optimized for use in our own front-end, and as such, the structure of responses might not be exactly as you expect. It may also contain information that is not relevant to you. Unfortunately we currently do not offer a method to get exactly the information you want, but we may create this functionality in future.
Authenticating requests
To authenticate requests, include an Authorization header with the value
"Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation
below.
You can generate your token by logging in and visiting TOOLS > API
Reports
Overview
Overview - Report
requires authentication
Overview Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/overview"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "My Company",
"model_type": "Internal",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"sort_by": "threads.total",
"direction": "desc",
"per_page_agents": "2",
"page_agents": "1",
"per_page_contacts": "2",
"page_contacts": "1",
"per_page_domains": "2",
"page_domains": "1",
"closed_over": "15",
"viewId": "1",
"showHourOfDayForAgents": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/overview';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => 'My Company',
'model_type' => 'Internal',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'sort_by' => 'threads.total',
'direction' => 'desc',
'per_page_agents' => '2',
'page_agents' => '1',
'per_page_contacts' => '2',
'page_contacts' => '1',
'per_page_domains' => '2',
'page_domains' => '1',
'closed_over' => '15',
'viewId' => '1',
'showHourOfDayForAgents' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/overview?from=2020-01-01&to=2020-01-08&model=My+Company&model_type=Internal&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&sort_by=threads.total&direction=desc&per_page_agents=2&page_agents=1&per_page_contacts=2&page_contacts=1&per_page_domains=2&page_domains=1&closed_over=15&viewId=1&showHourOfDayForAgents=" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1650.5749225616, app;desc="App";dur=88, total;desc="Total";dur=1652.5700092316,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Productivity
Productivity - Report
requires authentication
Productivity Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/productivity"
);
const params = {
"date": "2020-01-01",
"model": "My Company",
"model_type": "Internal",
"model_com": "1",
"model_type_com": "Contact Group",
"per_page": "2",
"page": "1",
"sort_by_email_volumes": "messages_sent_count",
"direction_email_volumes": "desc",
"sort_by_conversations": "threads_count",
"direction_conversations": "desc",
"sort_by_average_reply_times": "initialTTR",
"direction_average_reply_times": "desc",
"sort_by_responsiveness": "replies_under_7200",
"direction_responsiveness": "desc",
"sort_by_activity": "first_activity",
"direction_activity": "desc",
"viewId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/productivity';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'date' => '2020-01-01',
'model' => 'My Company',
'model_type' => 'Internal',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'per_page' => '2',
'page' => '1',
'sort_by_email_volumes' => 'messages_sent_count',
'direction_email_volumes' => 'desc',
'sort_by_conversations' => 'threads_count',
'direction_conversations' => 'desc',
'sort_by_average_reply_times' => 'initialTTR',
'direction_average_reply_times' => 'desc',
'sort_by_responsiveness' => 'replies_under_7200',
'direction_responsiveness' => 'desc',
'sort_by_activity' => 'first_activity',
'direction_activity' => 'desc',
'viewId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/productivity?date=2020-01-01&model=My+Company&model_type=Internal&model_com=1&model_type_com=Contact+Group&per_page=2&page=1&sort_by_email_volumes=messages_sent_count&direction_email_volumes=desc&sort_by_conversations=threads_count&direction_conversations=desc&sort_by_average_reply_times=initialTTR&direction_average_reply_times=desc&sort_by_responsiveness=replies_under_7200&direction_responsiveness=desc&sort_by_activity=first_activity&direction_activity=desc&viewId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1658.5068702698, app;desc="App";dur=90, total;desc="Total";dur=1660.4540348053,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Comparative
Comparative - Report
requires authentication
Comparative Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/comparative"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "My Company",
"model_type": "Internal",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"per_page": "2",
"direction": "desc",
"page": "1",
"closed_over": "15",
"viewId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/comparative';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => 'My Company',
'model_type' => 'Internal',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'per_page' => '2',
'direction' => 'desc',
'page' => '1',
'closed_over' => '15',
'viewId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/comparative?from=2020-01-01&to=2020-01-08&model=My+Company&model_type=Internal&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&per_page=2&direction=desc&page=1&closed_over=15&viewId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1665.6820774078, app;desc="App";dur=92, total;desc="Total";dur=1667.4959659576,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Interactions
Interactions - Report
requires authentication
Interactions Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/interactions"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "1",
"model_type": "Mailbox",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"per_page": "2",
"direction": "desc",
"page": "1",
"closed_over": "15",
"viewId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/interactions';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => '1',
'model_type' => 'Mailbox',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'per_page' => '2',
'direction' => 'desc',
'page' => '1',
'closed_over' => '15',
'viewId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/interactions?from=2020-01-01&to=2020-01-08&model=1&model_type=Mailbox&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&per_page=2&direction=desc&page=1&closed_over=15&viewId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1673.4828948975, app;desc="App";dur=94, total;desc="Total";dur=1675.4200458527,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
SLA
SLA - Report
requires authentication
SLA Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/sla"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "My Company",
"model_type": "Internal",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"sort_by": "threads.total",
"direction": "desc",
"per_page_agents": "2",
"page_agents": "1",
"per_page_contacts": "2",
"page_contacts": "1",
"per_page_domains": "2",
"page_domains": "1",
"closed_over": "15",
"viewId": "1",
"init_ttr_goal": "02:00:00",
"overall_ttr_goal": "02:00:00",
"overall_ttc_goal": "02:00:00",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/sla';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => 'My Company',
'model_type' => 'Internal',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'sort_by' => 'threads.total',
'direction' => 'desc',
'per_page_agents' => '2',
'page_agents' => '1',
'per_page_contacts' => '2',
'page_contacts' => '1',
'per_page_domains' => '2',
'page_domains' => '1',
'closed_over' => '15',
'viewId' => '1',
'init_ttr_goal' => '02:00:00',
'overall_ttr_goal' => '02:00:00',
'overall_ttc_goal' => '02:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/sla?from=2020-01-01&to=2020-01-08&model=My+Company&model_type=Internal&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&sort_by=threads.total&direction=desc&per_page_agents=2&page_agents=1&per_page_contacts=2&page_contacts=1&per_page_domains=2&page_domains=1&closed_over=15&viewId=1&init_ttr_goal=02%3A00%3A00&overall_ttr_goal=02%3A00%3A00&overall_ttc_goal=02%3A00%3A00" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1681.0350418091, app;desc="App";dur=96, total;desc="Total";dur=1682.9400062561,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Trend
Trend - Report
requires authentication
Trend Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/trend"
);
const params = {
"model": "My Company",
"model_type": "Internal",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"date": "2020-01-01",
"periods": "12",
"period_type": "Months",
"show_agents": "1",
"closed_over": "15",
"viewId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/trend';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'model' => 'My Company',
'model_type' => 'Internal',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'date' => '2020-01-01',
'periods' => '12',
'period_type' => 'Months',
'show_agents' => '1',
'closed_over' => '15',
'viewId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/trend?model=My+Company&model_type=Internal&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&date=2020-01-01&periods=12&period_type=Months&show_agents=1&closed_over=15&viewId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1688.5199546814, app;desc="App";dur=98, total;desc="Total";dur=1690.3970241547,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Contacts
Contacts - Report
requires authentication
Contacts Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/contact"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "My Company",
"model_type": "Internal",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"page_emails": "1",
"per_page_emails": "2",
"direction_emails": "desc",
"sort_by_emails": "threads.total",
"page_domains": "1",
"per_page_domains": "2",
"direction_domains": "desc",
"sort_by_domains": "threads.total",
"closed_over": "15",
"viewId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/contact';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => 'My Company',
'model_type' => 'Internal',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'page_emails' => '1',
'per_page_emails' => '2',
'direction_emails' => 'desc',
'sort_by_emails' => 'threads.total',
'page_domains' => '1',
'per_page_domains' => '2',
'direction_domains' => 'desc',
'sort_by_domains' => 'threads.total',
'closed_over' => '15',
'viewId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/contact?from=2020-01-01&to=2020-01-08&model=My+Company&model_type=Internal&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&page_emails=1&per_page_emails=2&direction_emails=desc&sort_by_emails=threads.total&page_domains=1&per_page_domains=2&direction_domains=desc&sort_by_domains=threads.total&closed_over=15&viewId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1696.1100101471, app;desc="App";dur=100, total;desc="Total";dur=1697.9649066925,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Teams
Teams - Report
requires authentication
Teams Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/teams"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "1",
"model_type": "Team",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"per_page": "2",
"sort_by": "threads.total",
"direction": "desc",
"page": "1",
"closed_over": "15",
"viewId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/teams';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => '1',
'model_type' => 'Team',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'per_page' => '2',
'sort_by' => 'threads.total',
'direction' => 'desc',
'page' => '1',
'closed_over' => '15',
'viewId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/teams?from=2020-01-01&to=2020-01-08&model=1&model_type=Team&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&per_page=2&sort_by=threads.total&direction=desc&page=1&closed_over=15&viewId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1703.6070823669, app;desc="App";dur=102, total;desc="Total";dur=1705.5070400238,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Group Mailboxes
Group Mailboxes - Report
requires authentication
Group Mailboxes Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/group-mailboxes"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "1",
"model_type": "Group Mailbox",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"per_page": "2",
"sort_by": "threads.total",
"direction": "desc",
"page": "1",
"closed_over": "15",
"viewId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/group-mailboxes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => '1',
'model_type' => 'Group Mailbox',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'per_page' => '2',
'sort_by' => 'threads.total',
'direction' => 'desc',
'page' => '1',
'closed_over' => '15',
'viewId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/group-mailboxes?from=2020-01-01&to=2020-01-08&model=1&model_type=Group+Mailbox&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&per_page=2&sort_by=threads.total&direction=desc&page=1&closed_over=15&viewId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1711.0409736633, app;desc="App";dur=104, total;desc="Total";dur=1712.9049301147,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Alerts
Alerts - Report
requires authentication
Alerts Report Data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/alerts"
);
const params = {
"days": "7",
"team": "1",
"agent": "1",
"page_live": "1",
"per_page_live": "10",
"page_handled": "1",
"per_page_handled": "10",
"sort": "desc",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/alerts';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'days' => '7',
'team' => '1',
'agent' => '1',
'page_live' => '1',
'per_page_live' => '10',
'page_handled' => '1',
'per_page_handled' => '10',
'sort' => 'desc',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/alerts?days=7&team=1&agent=1&page_live=1&per_page_live=10&page_handled=1&per_page_handled=10&sort=desc" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1719.28191185, app;desc="App";dur=106, total;desc="Total";dur=1721.1730480194,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Mailbox Alerts
Alerts - Report
requires authentication
Alerts Report Data for a specific mailbox
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/reports/alerts/1"
);
const params = {
"days": "7",
"page": "1",
"per_page": "10",
"sort": "desc",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/reports/alerts/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'days' => '7',
'page' => '1',
'per_page' => '10',
'sort' => 'desc',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/reports/alerts/1?days=7&page=1&per_page=10&sort=desc" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1745.5770969391, app;desc="App";dur=109, total;desc="Total";dur=1748.7089633942,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Logs
Conversations
Conversations - Report
requires authentication
Conversation (Thread) Logs data The full list of available columns for the "columns" parameter are:
- id
- init_agent_reply_time
- init_agent_action_time
- total_agent_reply_time
- last_received_at_date_time
- thread_type
- thread_status
- raw_init_agent_reply_time
- init_agent_reply_message_id
- init_reply_agent_id
- time_to_close
- raw_time_to_close
- friendly_initial_reply_time
- friendly_raw_initial_reply_time
- friendly_total_reply_time
- microsoft_conversations
- email_usernames
- email_usernames_from
- email_usernames_reply_to
- email_usernames_senders
- email_usernames_to
- email_usernames_received
- email_domains
- date_times
- message_classifications
- message_subjects
- messages
- labels
- has_contact_success
- contact_success_time
- contact_reply_time
- subject
- initial_reply_is_relevant
- initial_reply_is_included_in_stats
- initial_reply_is_outlier
- friendly_time_to_close
- friendly_raw_time_to_close
- is_manually_excluded_from_sla_breach
- customer_has_response
- within_percentile_rank
- messages.internet_message_id
- messages.date_time
- messages.timestamp
- messages.subject
- messages.references
- messages.replytime
- messages.classification
- messages.raw_replytime
- messages.friendly_reply_time
- messages.friendly_raw_reply_time
- messages.email_domains
- messages.email_domains_from
- messages.email_domains_to
- messages.email_domains_reply_to
- messages.email_domains_senders
- messages.email_domains_received
- messages.email_usernames
- messages.email_usernames_from
- messages.email_usernames_to
- messages.email_usernames_cc
- messages.email_usernames_reply_to
- messages.email_usernames_senders
- messages.email_usernames_received
- messages.is_initial_reply
- messages.is_newest_message
- messages.message_type
- messages.labels
- messages.reply_is_relevant
- messages.is_closing_email
- messages.is_included_in_stats
- messages.reply_is_outlier
- messages.agents_read_status
- messages.thread_id
- messages.thread_message_count
- messages.is_manually_excluded_from_sla_breach
- messages.within_percentile_rank
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/logs/conversations"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "My Company",
"model_type": "Internal",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"per_page": "2",
"sort_by": "last_received_at_date_time",
"direction": "desc",
"page": "1",
"closed_over": "15",
"columns[0]": "id",
"columns[1]": "init_agent_reply_time",
"viewId": "1",
"unfilteredView": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/logs/conversations';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => 'My Company',
'model_type' => 'Internal',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'per_page' => '2',
'sort_by' => 'last_received_at_date_time',
'direction' => 'desc',
'page' => '1',
'closed_over' => '15',
'columns[0]' => 'id',
'columns[1]' => 'init_agent_reply_time',
'viewId' => '1',
'unfilteredView' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/logs/conversations?from=2020-01-01&to=2020-01-08&model=My+Company&model_type=Internal&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&per_page=2&sort_by=last_received_at_date_time&direction=desc&page=1&closed_over=15&columns[]=id&columns[]=init_agent_reply_time&viewId=1&unfilteredView=" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1632.052898407, app;desc="App";dur=84, total;desc="Total";dur=1635.0159645081,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Messages
Messages - Report
requires authentication
Message Logs data The full list of available columns for the "columns" parameter are:
- internet_message_id
- date_time
- timestamp
- subject
- references
- replytime
- classification
- raw_replytime
- friendly_reply_time
- friendly_raw_reply_time
- email_domains
- email_domains_from
- email_domains_to
- email_domains_reply_to
- email_domains_senders
- email_domains_received
- email_usernames
- email_usernames_from
- email_usernames_to
- email_usernames_cc
- email_usernames_reply_to
- email_usernames_senders
- email_usernames_received
- is_initial_reply
- is_newest_message
- message_type
- labels
- reply_is_relevant
- is_closing_email
- is_included_in_stats
- reply_is_outlier
- agents_read_status
- thread_id
- thread_message_count
- is_manually_excluded_from_sla_breach
- within_percentile_rank
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/logs/messages"
);
const params = {
"from": "2020-01-01",
"to": "2020-01-08",
"model": "My Company",
"model_type": "Internal",
"exclude_cc": "0",
"model_com": "1",
"model_type_com": "Contact Group",
"exclude_cc_com": "0",
"exclusive": "0",
"label[0]": "INBOX",
"labels_and_or": "AND",
"thread_type": "inbound,outbound,internal",
"thread_status": "internal,await-customer,closed,await-agent",
"has_replies": "hasReplies,hasForwards,hasNoRepliesOrForwards",
"classification": "calculating,first,reply,reply-all,forward",
"messageType": "inbound,outbound,internal",
"waiting_for_response": "customer-has-response,waiting-for-response",
"replies_over": "15",
"message_replies_over": "15",
"message_replies_under": "15",
"no_reply_for": "15",
"per_page": "2",
"sort_by": "date_time",
"direction": "desc",
"page": "1",
"closed_over": "15",
"columns[0]": "date_time",
"columns[1]": "subject",
"viewId": "1",
"unfilteredView": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/logs/messages';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from' => '2020-01-01',
'to' => '2020-01-08',
'model' => 'My Company',
'model_type' => 'Internal',
'exclude_cc' => '0',
'model_com' => '1',
'model_type_com' => 'Contact Group',
'exclude_cc_com' => '0',
'exclusive' => '0',
'label[0]' => 'INBOX',
'labels_and_or' => 'AND',
'thread_type' => 'inbound,outbound,internal',
'thread_status' => 'internal,await-customer,closed,await-agent',
'has_replies' => 'hasReplies,hasForwards,hasNoRepliesOrForwards',
'classification' => 'calculating,first,reply,reply-all,forward',
'messageType' => 'inbound,outbound,internal',
'waiting_for_response' => 'customer-has-response,waiting-for-response',
'replies_over' => '15',
'message_replies_over' => '15',
'message_replies_under' => '15',
'no_reply_for' => '15',
'per_page' => '2',
'sort_by' => 'date_time',
'direction' => 'desc',
'page' => '1',
'closed_over' => '15',
'columns[0]' => 'date_time',
'columns[1]' => 'subject',
'viewId' => '1',
'unfilteredView' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/logs/messages?from=2020-01-01&to=2020-01-08&model=My+Company&model_type=Internal&exclude_cc=&model_com=1&model_type_com=Contact+Group&exclude_cc_com=&exclusive=&label[]=INBOX&labels_and_or=AND&thread_type=inbound%2Coutbound%2Cinternal&thread_status=internal%2Cawait-customer%2Cclosed%2Cawait-agent&has_replies=hasReplies%2ChasForwards%2ChasNoRepliesOrForwards&classification=calculating%2Cfirst%2Creply%2Creply-all%2Cforward&messageType=inbound%2Coutbound%2Cinternal&waiting_for_response=customer-has-response%2Cwaiting-for-response&replies_over=15&message_replies_over=15&message_replies_under=15&no_reply_for=15&per_page=2&sort_by=date_time&direction=desc&page=1&closed_over=15&columns[]=date_time&columns[]=subject&viewId=1&unfilteredView=" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1641.8950557709, app;desc="App";dur=86, total;desc="Total";dur=1644.210100174,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Entities
Mailboxes
Mailboxes - List
requires authentication
List all mailboxes
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/entities/mailboxes"
);
const params = {
"sort_by": "name",
"direction": "asc",
"per_page": "2",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/entities/mailboxes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'sort_by' => 'name',
'direction' => 'asc',
'per_page' => '2',
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/entities/mailboxes?sort_by=name&direction=asc&per_page=2&page=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1496.6979026794, app;desc="App";dur=74, total;desc="Total";dur=1571.7749595642,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Contacts
Contacts - List
requires authentication
Get all existing contacts.
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/entities/contacts"
);
const params = {
"sort_by": "name",
"direction": "asc",
"per_page": "25",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/entities/contacts';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'sort_by' => 'name',
'direction' => 'asc',
'per_page' => '25',
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/entities/contacts?sort_by=name&direction=asc&per_page=25&page=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1603.4789085388, app;desc="App";dur=80, total;desc="Total";dur=1605.565071106,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Contact Groups
Contact Groups - List
requires authentication
List all Contact Groups
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/entities/contact-groups"
);
const params = {
"sort_by": "name",
"direction": "asc",
"per_page": "15",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/entities/contact-groups';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'sort_by' => 'name',
'direction' => 'asc',
'per_page' => '15',
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/entities/contact-groups?sort_by=name&direction=asc&per_page=15&page=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1610.5198860168, app;desc="App";dur=81, total;desc="Total";dur=1612.263917923,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Group Mailboxes
Group Mailboxes - List
requires authentication
Show all Group Mailboxes
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/entities/group-mailboxes"
);
const params = {
"per_page": "25",
"page": "1",
"search": "Sales",
"sort_by": "name",
"direction": "asc",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/entities/group-mailboxes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '25',
'page' => '1',
'search' => 'Sales',
'sort_by' => 'name',
'direction' => 'asc',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/entities/group-mailboxes?per_page=25&page=1&search=Sales&sort_by=name&direction=asc" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1587.8639221191, app;desc="App";dur=76, total;desc="Total";dur=1590.0368690491,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Teams
Teams - List
requires authentication
Show all teams
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/entities/teams"
);
const params = {
"per_page": "25",
"page": "1",
"sort_by": "name",
"direction": "asc",
"search": "ACME",
"include_emails": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/entities/teams';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '25',
'page' => '1',
'sort_by' => 'name',
'direction' => 'asc',
'search' => 'ACME',
'include_emails' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/entities/teams?per_page=25&page=1&sort_by=name&direction=asc&search=ACME&include_emails=" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
tracking-events: []
server-timing: bootstrap;desc="Bootstrap";dur=1596.1790084839, app;desc="App";dur=78, total;desc="Total";dur=1598.0799198151,
x-ttr-server: homestead-rob
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tools
Profile
Profile - Get
requires authentication
Your account basic data
Example request:
const url = new URL(
"https://portal.timetoreply.com/api/me"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://portal.timetoreply.com/api/me';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://portal.timetoreply.com/api/me" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"Example response (200):
{
"id": "1",
"name": "Peter Rabbit",
"email": "[email protected]"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.