curl --request GET \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gmail_message_id": "<string>",
"gmail_thread_id": "<string>",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "RECEIVED",
"from_address": "jsmith@example.com",
"subject": "<string>",
"snippet": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"participants": [
{
"email_address": "jsmith@example.com",
"role": "FROM"
}
],
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"url": "<string>"
}
]
}
],
"meta": {
"pagination": {
"sort_by": "received_at",
"sort_order": "ASC",
"cursor": "<string>",
"has_more": true
}
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}List business emails
Lists messages in threads linked to this business, including received emails and sent replies. A linked thread may also contain third-party notifications. Results are ordered by received_at descending, then message ID descending. The public API does not support searching email content. List results include attachment metadata, not download URLs.
curl --request GET \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/support-emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gmail_message_id": "<string>",
"gmail_thread_id": "<string>",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "RECEIVED",
"from_address": "jsmith@example.com",
"subject": "<string>",
"snippet": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"participants": [
{
"email_address": "jsmith@example.com",
"role": "FROM"
}
],
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"url": "<string>"
}
]
}
],
"meta": {
"pagination": {
"sort_by": "received_at",
"sort_order": "ASC",
"cursor": "<string>",
"has_more": true
}
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The UUID of the business whose emails to list.
Query Parameters
Include messages received at or after this RFC 3339 instant. Inclusive start of the UTC time range.
Exclude messages received at or after this RFC 3339 instant. Exclusive end of the UTC time range. Must be later than received_at_start when both are given.
Filter to messages with at least one stored attachment (true) or none (false). Omit to include both.
Filter to received emails or sent replies. Omit to include both.
RECEIVED, SENT Maximum messages per page. Defaults to 100.
1 <= x <= 1000Opaque cursor from the previous response's meta.pagination.cursor. Repeat the same filters on subsequent pages.
The sort field. Only received_at is supported; this is the default.
received_at Order by received_at, then message ID. Defaults to DESC.
ASC, DESC