Send a custom event for a specific flow
curl --request POST \
--url https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consumers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"data": {
"is_preview": false,
"force_restart": false,
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"force_from_date": "2023-12-25"
}
}
'import requests
url = "https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event"
payload = {
"consumers": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"data": {
"is_preview": False,
"force_restart": False,
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"force_from_date": "2023-12-25"
}
}
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({
consumers: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
data: {
is_preview: false,
force_restart: false,
start_date: '2023-12-25',
end_date: '2023-12-25',
force_from_date: '2023-12-25'
}
})
};
fetch('https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event', 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/syncs/{syncid}/flows/{flowid}/event",
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([
'consumers' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'data' => [
'is_preview' => false,
'force_restart' => false,
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'force_from_date' => '2023-12-25'
]
]),
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/syncs/{syncid}/flows/{flowid}/event"
payload := strings.NewReader("{\n \"consumers\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"data\": {\n \"is_preview\": false,\n \"force_restart\": false,\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"force_from_date\": \"2023-12-25\"\n }\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/syncs/{syncid}/flows/{flowid}/event")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consumers\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"data\": {\n \"is_preview\": false,\n \"force_restart\": false,\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"force_from_date\": \"2023-12-25\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event")
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 \"consumers\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"data\": {\n \"is_preview\": false,\n \"force_restart\": false,\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"force_from_date\": \"2023-12-25\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"message": "<string>",
"data": {}
}{
"message": "No consumers found",
"status": "error"
}{
"message": "The chain does not exist",
"status": "error"
}{
"message": "Error while validating context data; the field {field.get('name')} does not seem to be of type {fieldtype}",
"status": "error"
}Syncs
Send a custom event for a specific flow
Route that can be used to send a specific event for a flow
POST
/
syncs
/
{syncid}
/
flows
/
{flowid}
/
event
Send a custom event for a specific flow
curl --request POST \
--url https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consumers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"data": {
"is_preview": false,
"force_restart": false,
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"force_from_date": "2023-12-25"
}
}
'import requests
url = "https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event"
payload = {
"consumers": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"data": {
"is_preview": False,
"force_restart": False,
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"force_from_date": "2023-12-25"
}
}
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({
consumers: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
data: {
is_preview: false,
force_restart: false,
start_date: '2023-12-25',
end_date: '2023-12-25',
force_from_date: '2023-12-25'
}
})
};
fetch('https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event', 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/syncs/{syncid}/flows/{flowid}/event",
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([
'consumers' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'data' => [
'is_preview' => false,
'force_restart' => false,
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'force_from_date' => '2023-12-25'
]
]),
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/syncs/{syncid}/flows/{flowid}/event"
payload := strings.NewReader("{\n \"consumers\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"data\": {\n \"is_preview\": false,\n \"force_restart\": false,\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"force_from_date\": \"2023-12-25\"\n }\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/syncs/{syncid}/flows/{flowid}/event")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consumers\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"data\": {\n \"is_preview\": false,\n \"force_restart\": false,\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"force_from_date\": \"2023-12-25\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chift.eu/syncs/{syncid}/flows/{flowid}/event")
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 \"consumers\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"data\": {\n \"is_preview\": false,\n \"force_restart\": false,\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"force_from_date\": \"2023-12-25\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"message": "<string>",
"data": {}
}{
"message": "No consumers found",
"status": "error"
}{
"message": "The chain does not exist",
"status": "error"
}{
"message": "Error while validating context data; the field {field.get('name')} does not seem to be of type {fieldtype}",
"status": "error"
}Authorizations
This access token needs to be included in each of your request to the Chift API.
Body
application/json
⌘I