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",
"type": "page_view",
"path_template": "/orders/{id}/items",
"referrer_origin": "https://www.example.com",
"dwell_ms": 123,
"visible_ms": 123,
"max_scroll_pct": 123
}
]{
"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 the browser checks a policy step decided, each by type, on the visit’s key from its start to when it was last seen. A page view carries what its page exit measured, once the page closes. A decided request carries its decision and what the merchant did with it, and a browser check its decision. 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",
"type": "page_view",
"path_template": "/orders/{id}/items",
"referrer_origin": "https://www.example.com",
"dwell_ms": 123,
"visible_ms": 123,
"max_scroll_pct": 123
}
]{
"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
Only items of this type. Repeat for several.
What one item of a visit's timeline is, by its type.
page_view, navigation, interaction, form_field, request, browser_check, detection_update 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.
occurred_at: when it happened; ties break on record_id. Defaults to occurred_at asc.
The field a visit's timeline sorts on.
occurred_at asc or desc, for every key of the sort. Defaults to the field's own: occurred_at asc.
asc, desc Response
The visit's timeline in the requested order.
- VisitTimelinePageView (v1)
- VisitTimelineNavigation (v1)
- VisitTimelineInteraction (v1)
- VisitTimelineFormField (v1)
- VisitTimelineRequest (v1)
- VisitTimelineBrowserCheck (v1)
- VisitTimelineDetectionUpdate (v1)
The visitor viewed a page. Its dwell, visibility and scroll arrive when the page closes, null until then.
The record's id.
When it happened.
"page_view"The page it happened on, or the request's path, as a template; null when the record names none.
"/orders/{id}/items"
The referring page's scheme and host.
"https://www.example.com"
How long the page was open.
How long it was visible.
The furthest it was scrolled.