Start a WhatsApp channel's history sync now
curl --request POST \
--url https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start \
--header 'Authorization: Bearer <token>' \
--header 'X-Tenant: <x-tenant>'import requests
url = "https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start"
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
fetch('https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start', 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://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 123,
"channel_id": 123,
"trigger": "initial",
"status": "pending",
"since": "2023-11-07T05:31:56Z",
"pass": 123,
"progress_percent": 123,
"provider_total": 123,
"processed": 123,
"imported": 123,
"skipped": {
"unknown_contact": 123,
"deleted_contact": 123,
"lid_unresolved": 123,
"group": 123,
"failed": 123
},
"settings": {
"enabled": true,
"period_days": 123,
"contact_scope": "<string>",
"new_contact_type": "<string>",
"name_strategy": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Kanallar
Start a WhatsApp channel's history sync now
Copies the chosen period again; messages already stored are skipped. A run already in progress is returned instead of starting a second one.
POST
/
v1
/
channels
/
{id}
/
whatsapp
/
history-sync
/
start
Start a WhatsApp channel's history sync now
curl --request POST \
--url https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start \
--header 'Authorization: Bearer <token>' \
--header 'X-Tenant: <x-tenant>'import requests
url = "https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start"
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
fetch('https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start', 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://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels/{id}/whatsapp/history-sync/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 123,
"channel_id": 123,
"trigger": "initial",
"status": "pending",
"since": "2023-11-07T05:31:56Z",
"pass": 123,
"progress_percent": 123,
"provider_total": 123,
"processed": 123,
"imported": 123,
"skipped": {
"unknown_contact": 123,
"deleted_contact": 123,
"lid_unresolved": 123,
"group": 123,
"failed": 123
},
"settings": {
"enabled": true,
"period_days": 123,
"contact_scope": "<string>",
"new_contact_type": "<string>",
"name_strategy": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Yetkilendirmeler
oauth2bearer
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Yol Parametreleri
The channel identifier