curl --request POST \
--url https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_date": "2023-12-25",
"fiscal_years_back": 1,
"full_history": false,
"entity_filter": {}
}
'import requests
url = "https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer"
payload = {
"from_date": "2023-12-25",
"fiscal_years_back": 1,
"full_history": False,
"entity_filter": {}
}
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({
from_date: '2023-12-25',
fiscal_years_back: 1,
full_history: false,
entity_filter: {}
})
};
fetch('https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer', 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.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer",
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([
'from_date' => '2023-12-25',
'fiscal_years_back' => 1,
'full_history' => false,
'entity_filter' => [
]
]),
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://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer"
payload := strings.NewReader("{\n \"from_date\": \"2023-12-25\",\n \"fiscal_years_back\": 1,\n \"full_history\": false,\n \"entity_filter\": {}\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://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_date\": \"2023-12-25\",\n \"fiscal_years_back\": 1,\n \"full_history\": false,\n \"entity_filter\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer")
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 \"from_date\": \"2023-12-25\",\n \"fiscal_years_back\": 1,\n \"full_history\": false,\n \"entity_filter\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "The datalayer is not configured on this account.",
"status": "error"
}{
"message": "The consumer or connection does not exist",
"status": "error"
}{
"message": "Validation error",
"status": "error",
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Enable the datalayer sync for a connection
Enables the datalayer sync for the consumer’s connection so it refreshes on schedule. Requires the datalayer to be configured for the connection’s vertical.
curl --request POST \
--url https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_date": "2023-12-25",
"fiscal_years_back": 1,
"full_history": false,
"entity_filter": {}
}
'import requests
url = "https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer"
payload = {
"from_date": "2023-12-25",
"fiscal_years_back": 1,
"full_history": False,
"entity_filter": {}
}
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({
from_date: '2023-12-25',
fiscal_years_back: 1,
full_history: false,
entity_filter: {}
})
};
fetch('https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer', 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.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer",
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([
'from_date' => '2023-12-25',
'fiscal_years_back' => 1,
'full_history' => false,
'entity_filter' => [
]
]),
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://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer"
payload := strings.NewReader("{\n \"from_date\": \"2023-12-25\",\n \"fiscal_years_back\": 1,\n \"full_history\": false,\n \"entity_filter\": {}\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://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_date\": \"2023-12-25\",\n \"fiscal_years_back\": 1,\n \"full_history\": false,\n \"entity_filter\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chift.eu/consumers/{consumer_id}/connections/{connection_id}/enable_datalayer")
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 \"from_date\": \"2023-12-25\",\n \"fiscal_years_back\": 1,\n \"full_history\": false,\n \"entity_filter\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "The datalayer is not configured on this account.",
"status": "error"
}{
"message": "The consumer or connection does not exist",
"status": "error"
}{
"message": "Validation error",
"status": "error",
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
This access token needs to be included in each of your request to the Chift API.
Body
Date from which the data is synced. Defaults to one year ago when omitted.
Sync from the start of the book year this many fiscal years back (accounting only). 0 syncs from the start of the current fiscal year.
x >= 0Sync the whole history, without a lower date bound. Mirrors the 'infinite' automatic-activation policy.
Restrict the datalayer to specific entities of the connection instead of every one the end-user selected, keyed by entity kind applicable to the connection's vertical (e.g. folder_ids, location_ids). The ids are validated against the ones available on the connection when the sync runs. Omit to sync every selected entity.
Show child attributes
Show child attributes
Response
Successful Response