Features
Visit stats
Save visit event on Doofinder statistics
POST
/
api
/
v2
/
stats
/
visit
Visit stats
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/stats/visit \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"store": "<string>",
"dfid": "<string>",
"hashid": "<string>",
"ip": "<string>",
"page_type": "<string>",
"session_id": "<string>",
"url": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/stats/visit"
payload = {
"store": "<string>",
"dfid": "<string>",
"hashid": "<string>",
"ip": "<string>",
"page_type": "<string>",
"session_id": "<string>",
"url": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
store: '<string>',
dfid: '<string>',
hashid: '<string>',
ip: '<string>',
page_type: '<string>',
session_id: '<string>',
url: '<string>',
user_agent: '<string>',
user_id: '<string>'
})
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/stats/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://{search_zone}-api.doofinder.com/api/v2/stats/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([
'store' => '<string>',
'dfid' => '<string>',
'hashid' => '<string>',
'ip' => '<string>',
'page_type' => '<string>',
'session_id' => '<string>',
'url' => '<string>',
'user_agent' => '<string>',
'user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{search_zone}-api.doofinder.com/api/v2/stats/visit"
payload := strings.NewReader("{\n \"store\": \"<string>\",\n \"dfid\": \"<string>\",\n \"hashid\": \"<string>\",\n \"ip\": \"<string>\",\n \"page_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"url\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://{search_zone}-api.doofinder.com/api/v2/stats/visit")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"store\": \"<string>\",\n \"dfid\": \"<string>\",\n \"hashid\": \"<string>\",\n \"ip\": \"<string>\",\n \"page_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"url\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/stats/visit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"store\": \"<string>\",\n \"dfid\": \"<string>\",\n \"hashid\": \"<string>\",\n \"ip\": \"<string>\",\n \"page_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"url\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<unknown>"{
"error": {
"code": "bad_params",
"message": "Bad parameters error"
}
}Authorizations
api_tokenjwt_token
Doofinder API key. Pass it as: Authorization: Token <api_key>
Body
application/json
Identifier of store. In the store setup section, you will find the store ID information.
Required string length:
1 - 36Unique id of the search engine. In the search engine selector, you will find the hashid information
Pattern:
^[a-f0-9]{32}$Unique address that identifies a device. Detected automatically by the server.
Identifier of search session
Maximum string length:
32Page URI visited by the user
Identifier of device. Detected automatically by the server.
Identifier of user
Maximum string length:
36Response
OK
Response returned over register stat operation.
⌘I
Visit stats
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/stats/visit \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"store": "<string>",
"dfid": "<string>",
"hashid": "<string>",
"ip": "<string>",
"page_type": "<string>",
"session_id": "<string>",
"url": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/stats/visit"
payload = {
"store": "<string>",
"dfid": "<string>",
"hashid": "<string>",
"ip": "<string>",
"page_type": "<string>",
"session_id": "<string>",
"url": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
store: '<string>',
dfid: '<string>',
hashid: '<string>',
ip: '<string>',
page_type: '<string>',
session_id: '<string>',
url: '<string>',
user_agent: '<string>',
user_id: '<string>'
})
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/stats/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://{search_zone}-api.doofinder.com/api/v2/stats/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([
'store' => '<string>',
'dfid' => '<string>',
'hashid' => '<string>',
'ip' => '<string>',
'page_type' => '<string>',
'session_id' => '<string>',
'url' => '<string>',
'user_agent' => '<string>',
'user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{search_zone}-api.doofinder.com/api/v2/stats/visit"
payload := strings.NewReader("{\n \"store\": \"<string>\",\n \"dfid\": \"<string>\",\n \"hashid\": \"<string>\",\n \"ip\": \"<string>\",\n \"page_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"url\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://{search_zone}-api.doofinder.com/api/v2/stats/visit")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"store\": \"<string>\",\n \"dfid\": \"<string>\",\n \"hashid\": \"<string>\",\n \"ip\": \"<string>\",\n \"page_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"url\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/stats/visit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"store\": \"<string>\",\n \"dfid\": \"<string>\",\n \"hashid\": \"<string>\",\n \"ip\": \"<string>\",\n \"page_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"url\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<unknown>"{
"error": {
"code": "bad_params",
"message": "Bad parameters error"
}
}