curl --request GET \
--url https://api.baselayer.com/acceptance/visits/{visit_id}/timeline \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.baselayer.com/acceptance/visits/{visit_id}/timeline"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.baselayer.com/acceptance/visits/{visit_id}/timeline', 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://api.baselayer.com/acceptance/visits/{visit_id}/timeline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.baselayer.com/acceptance/visits/{visit_id}/timeline"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.baselayer.com/acceptance/visits/{visit_id}/timeline")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/acceptance/visits/{visit_id}/timeline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"record_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"occurred_at": "2023-11-07T05:31:56Z",
"kind": "browser_event",
"event_kind": "page_view",
"path_template": "/orders/{id}/items",
"dwell_ms": 123,
"visible_ms": 123,
"max_scroll_pct": 123,
"from_path_template": "<string>",
"to_path_template": "<string>",
"navigation_type": "spa",
"interaction_kind": "click",
"target_role": "<string>",
"target_label_hash": "<string>",
"form_id_hash": "<string>",
"field_name_hash": "<string>",
"field_type": "text",
"phase": "focus",
"time_in_field_ms": 123,
"validation_error_code": "<string>",
"error_kind": "uncaught",
"message_hash": "<string>",
"source_path_template": "<string>"
}
]{
"type": "resource_not_found",
"code": 1,
"message": "Could not locate the resource for the given URI.",
"metadata": {}
}{
"type": "validation_failed",
"code": 7112,
"message": "The request is invalid.",
"metadata": {}
}{
"type": "acceptance_reads_unavailable",
"code": 7252,
"message": "Acceptance data is temporarily unavailable. Retry after the Retry-After interval.",
"metadata": {}
}List one visit's timeline
What happened during one visit at your application, oldest first by default, a page at a time: its browser events, detection updates, requests and server events, each by kind, on the visit’s key from its start to when it was last seen. A decided request carries its decision and what the merchant did with it. X-Total-Count and X-Total-Pages count every match and are sent on the first cursor page and on every offset page. The timeline runs to when the visit was last seen, which lags its latest record by about a minute, so a record appears here about a minute after it is reported.
curl --request GET \
--url https://api.baselayer.com/acceptance/visits/{visit_id}/timeline \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.baselayer.com/acceptance/visits/{visit_id}/timeline"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.baselayer.com/acceptance/visits/{visit_id}/timeline', 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://api.baselayer.com/acceptance/visits/{visit_id}/timeline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.baselayer.com/acceptance/visits/{visit_id}/timeline"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.baselayer.com/acceptance/visits/{visit_id}/timeline")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/acceptance/visits/{visit_id}/timeline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"record_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"occurred_at": "2023-11-07T05:31:56Z",
"kind": "browser_event",
"event_kind": "page_view",
"path_template": "/orders/{id}/items",
"dwell_ms": 123,
"visible_ms": 123,
"max_scroll_pct": 123,
"from_path_template": "<string>",
"to_path_template": "<string>",
"navigation_type": "spa",
"interaction_kind": "click",
"target_role": "<string>",
"target_label_hash": "<string>",
"form_id_hash": "<string>",
"field_name_hash": "<string>",
"field_type": "text",
"phase": "focus",
"time_in_field_ms": 123,
"validation_error_code": "<string>",
"error_kind": "uncaught",
"message_hash": "<string>",
"source_path_template": "<string>"
}
]{
"type": "resource_not_found",
"code": 1,
"message": "Could not locate the resource for the given URI.",
"metadata": {}
}{
"type": "validation_failed",
"code": 7112,
"message": "The request is invalid.",
"metadata": {}
}{
"type": "acceptance_reads_unavailable",
"code": 7252,
"message": "Acceptance data is temporarily unavailable. Retry after the Retry-After interval.",
"metadata": {}
}Authorizations
Path Parameters
The visit's id.
Query Parameters
Maximum number of records to return in a single page. Must be between 1 and 1000.
1 <= x <= 1000Number of records to skip from the beginning. Use 0 for the first page. Cannot be used with cursor.
x >= 0Opaque pagination cursor token that identifies the position in the result set. Use the cursor from the previous response to get the next page. Cannot be used with offset.
timeline: when it happened, oldest first; ties break on record_id. Defaults to timeline asc.
The field a visit's timeline sorts on.
timeline asc or desc, for every key of the sort. Defaults to the field's own: timeline asc.
asc, desc Response
The visit's timeline in the requested order.
- VisitTimelineBrowserEvent (v1)
- VisitTimelineDetectionUpdate (v1)
- VisitTimelineRequest (v1)
- VisitTimelineServerEvent (v1)
Something that happened in the visitor's browser. Each member is set
for the event_kind that carries it, as the browser reported it.
The record's id.
When it happened.
"browser_event"What happened.
page_view, page_exit, navigation, interaction, form_field, error, search, view_item, add_to_cart, begin_checkout, purchase The page it happened on, or the request's path, as a template; null when the record names none.
"/orders/{id}/items"
How long the page was open.
How long it was visible.
The furthest it was scrolled.
The page navigated from.
The page navigated to.
An in-page route or a full load.
spa, full_load What the visitor did.
click, submit, scroll, rage_click, dead_click, copy, paste The target element's ARIA role, or its tag name.
The target's label, hashed.
The form's id or name, hashed.
The field's name, hashed.
The kind of control.
text, email, tel, password, number, date, checkbox, radio, select, textarea, file, other The moment in the field.
focus, change, blur, invalid How long the field held focus, at blur.
The browser's validity state that failed, at invalid.
Where the error came from.
uncaught, unhandled_rejection, resource The error message, hashed.
The failing script's or resource's path.