curl --request GET \
--url https://sandbox.layerfi.com/v2/activity/businesses/{businessId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.layerfi.com/v2/activity/businesses/{businessId}"
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/v2/activity/businesses/{businessId}', 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/v2/activity/businesses/{businessId}",
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/v2/activity/businesses/{businessId}"
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/v2/activity/businesses/{businessId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v2/activity/businesses/{businessId}")
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": {
"months": [
{
"month": "2024-01",
"sms_sent": 5,
"sms_received": 3,
"categorized_transactions": 10,
"uncategorized_transactions": 2,
"categorized_by_api": 7,
"categorized_by_sms": 3,
"categorization_pct": 0.83,
"active_days": 15
}
]
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}Fetch business activity metrics
Generates a monthly activity summary for a specific business, including SMS and categorization metrics. This v2 endpoint supports an optional date range and returns a monthly breakdown format.
curl --request GET \
--url https://sandbox.layerfi.com/v2/activity/businesses/{businessId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.layerfi.com/v2/activity/businesses/{businessId}"
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/v2/activity/businesses/{businessId}', 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/v2/activity/businesses/{businessId}",
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/v2/activity/businesses/{businessId}"
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/v2/activity/businesses/{businessId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v2/activity/businesses/{businessId}")
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": {
"months": [
{
"month": "2024-01",
"sms_sent": 5,
"sms_received": 3,
"categorized_transactions": 10,
"uncategorized_transactions": 2,
"categorized_by_api": 7,
"categorized_by_sms": 3,
"categorization_pct": 0.83,
"active_days": 15
}
]
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Content-Type must be set to application/json.
Path Parameters
The UUID of the business to fetch metrics for.
Query Parameters
Optional filter for the start of the activity window. Metrics will include data on or after this date. Accepts either an ISO 8601 date (YYYY-MM-DD) or date-time.
Optional filter for the end of the activity window. Metrics will include data up to and including this date. Accepts either an ISO 8601 date (YYYY-MM-DD) or date-time.
Response
Business activity summary with monthly breakdowns.
Show child attributes
Show child attributes