Analytics API
Log visit
Forward a visit to the Analytics API
POST
/
visit
cURL
curl --request POST \
--url https://analytics.usehall.com/visit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_path": "/blog/becoming-an-ai-engineering-company",
"request_method": "GET",
"request_ip": "172.183.222.128",
"request_timestamp": 1705315800
}
'import requests
url = "https://analytics.usehall.com/visit"
payload = {
"request_path": "/blog/becoming-an-ai-engineering-company",
"request_method": "GET",
"request_ip": "172.183.222.128",
"request_timestamp": 1705315800
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
request_path: '/blog/becoming-an-ai-engineering-company',
request_method: 'GET',
request_ip: '172.183.222.128',
request_timestamp: 1705315800
})
};
fetch('https://analytics.usehall.com/visit', 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://analytics.usehall.com/visit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'request_path' => '/blog/becoming-an-ai-engineering-company',
'request_method' => 'GET',
'request_ip' => '172.183.222.128',
'request_timestamp' => 1705315800
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://analytics.usehall.com/visit"
payload := strings.NewReader("{\n \"request_path\": \"/blog/becoming-an-ai-engineering-company\",\n \"request_method\": \"GET\",\n \"request_ip\": \"172.183.222.128\",\n \"request_timestamp\": 1705315800\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://analytics.usehall.com/visit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_path\": \"/blog/becoming-an-ai-engineering-company\",\n \"request_method\": \"GET\",\n \"request_ip\": \"172.183.222.128\",\n \"request_timestamp\": 1705315800\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://analytics.usehall.com/visit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"request_path\": \"/blog/becoming-an-ai-engineering-company\",\n \"request_method\": \"GET\",\n \"request_ip\": \"172.183.222.128\",\n \"request_timestamp\": 1705315800\n}"
response = http.request(request)
puts response.read_body{
"error": 123,
"message": "<string>"
}Visits are logged to the Analytics API by making a POST request to the
/visit endpoint.
The request body should forward the visitor’s request HTTP path, method, and headers as described below.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Visitor request to forward to the Analytics API.
The path of the HTTP request.
Example:
"/blog/becoming-an-ai-engineering-company"
The HTTP method used for the request.
Available options:
GET, POST, PUT, DELETE, PATCH Example:
"GET"
The IP address making the request. This is optional, but may effect the availability of some features.
Example:
"172.183.222.128"
The UNIX Epoch timestamp when the original request occurred.
Example:
1705315800
HTTP headers sent with the request.
Show child attributes
Show child attributes
Response
Success.
Previous
Forwarding IP AddressesUnderstand the considerations of forwarding IP addresses to the Analytics API
Next
⌘I
cURL
curl --request POST \
--url https://analytics.usehall.com/visit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_path": "/blog/becoming-an-ai-engineering-company",
"request_method": "GET",
"request_ip": "172.183.222.128",
"request_timestamp": 1705315800
}
'import requests
url = "https://analytics.usehall.com/visit"
payload = {
"request_path": "/blog/becoming-an-ai-engineering-company",
"request_method": "GET",
"request_ip": "172.183.222.128",
"request_timestamp": 1705315800
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
request_path: '/blog/becoming-an-ai-engineering-company',
request_method: 'GET',
request_ip: '172.183.222.128',
request_timestamp: 1705315800
})
};
fetch('https://analytics.usehall.com/visit', 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://analytics.usehall.com/visit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'request_path' => '/blog/becoming-an-ai-engineering-company',
'request_method' => 'GET',
'request_ip' => '172.183.222.128',
'request_timestamp' => 1705315800
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://analytics.usehall.com/visit"
payload := strings.NewReader("{\n \"request_path\": \"/blog/becoming-an-ai-engineering-company\",\n \"request_method\": \"GET\",\n \"request_ip\": \"172.183.222.128\",\n \"request_timestamp\": 1705315800\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://analytics.usehall.com/visit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_path\": \"/blog/becoming-an-ai-engineering-company\",\n \"request_method\": \"GET\",\n \"request_ip\": \"172.183.222.128\",\n \"request_timestamp\": 1705315800\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://analytics.usehall.com/visit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"request_path\": \"/blog/becoming-an-ai-engineering-company\",\n \"request_method\": \"GET\",\n \"request_ip\": \"172.183.222.128\",\n \"request_timestamp\": 1705315800\n}"
response = http.request(request)
puts response.read_body{
"error": 123,
"message": "<string>"
}