Start an import for an import source
curl --request POST \
--url https://app.flextell.ai/api/v1/import/sources/{id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"types": [],
"options": {
"skip_files_without_visit": true
}
}
'import requests
url = "https://app.flextell.ai/api/v1/import/sources/{id}/start"
payload = {
"types": [],
"options": { "skip_files_without_visit": True }
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({types: [], options: {skip_files_without_visit: true}})
};
fetch('https://app.flextell.ai/api/v1/import/sources/{id}/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/import/sources/{id}/start",
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([
'types' => [
],
'options' => [
'skip_files_without_visit' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.flextell.ai/api/v1/import/sources/{id}/start"
payload := strings.NewReader("{\n \"types\": [],\n \"options\": {\n \"skip_files_without_visit\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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://app.flextell.ai/api/v1/import/sources/{id}/start")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"types\": [],\n \"options\": {\n \"skip_files_without_visit\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/import/sources/{id}/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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"types\": [],\n \"options\": {\n \"skip_files_without_visit\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"parent_id": 123,
"import_source_id": 123,
"user_id": 123,
"status": "<string>",
"status_label": "Bekliyor",
"import_type": "<string>",
"import_type_label": "Hasta",
"selected_types": [
"<unknown>"
],
"mode": "full",
"options": [
"<unknown>"
],
"total_records": 123,
"processed_records": 123,
"successful_records": 123,
"failed_records": 123,
"skipped_records": 123,
"progress_percentage": "<string>",
"errors_count": 123,
"skips_count": 123,
"is_stalled": true,
"can_be_cancelled": true,
"error_message": "<string>",
"throughput": "<string>",
"eta_seconds": "<string>",
"elapsed_seconds": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
},
"user": {
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
},
"children": "<array>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"success": true,
"error_code": "IMPORT_JOB_ALREADY_RUNNING",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Import
Start an import for an import source
POST
/
v1
/
import
/
sources
/
{id}
/
start
Start an import for an import source
curl --request POST \
--url https://app.flextell.ai/api/v1/import/sources/{id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"types": [],
"options": {
"skip_files_without_visit": true
}
}
'import requests
url = "https://app.flextell.ai/api/v1/import/sources/{id}/start"
payload = {
"types": [],
"options": { "skip_files_without_visit": True }
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({types: [], options: {skip_files_without_visit: true}})
};
fetch('https://app.flextell.ai/api/v1/import/sources/{id}/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/import/sources/{id}/start",
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([
'types' => [
],
'options' => [
'skip_files_without_visit' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.flextell.ai/api/v1/import/sources/{id}/start"
payload := strings.NewReader("{\n \"types\": [],\n \"options\": {\n \"skip_files_without_visit\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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://app.flextell.ai/api/v1/import/sources/{id}/start")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"types\": [],\n \"options\": {\n \"skip_files_without_visit\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/import/sources/{id}/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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"types\": [],\n \"options\": {\n \"skip_files_without_visit\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"parent_id": 123,
"import_source_id": 123,
"user_id": 123,
"status": "<string>",
"status_label": "Bekliyor",
"import_type": "<string>",
"import_type_label": "Hasta",
"selected_types": [
"<unknown>"
],
"mode": "full",
"options": [
"<unknown>"
],
"total_records": 123,
"processed_records": 123,
"successful_records": 123,
"failed_records": 123,
"skipped_records": 123,
"progress_percentage": "<string>",
"errors_count": 123,
"skips_count": 123,
"is_stalled": true,
"can_be_cancelled": true,
"error_message": "<string>",
"throughput": "<string>",
"eta_seconds": "<string>",
"elapsed_seconds": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
},
"user": {
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
},
"children": "<array>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"success": true,
"error_code": "IMPORT_JOB_ALREADY_RUNNING",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}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 import source identifier
Gövde
application/json
The import types to run, taken from the import source's available types.
Minimum array length:
1An import type identifier.
Mevcut seçenekler:
customer, appointment, product, treatment, user, room, customer_note, customer_file, sale, bank_info, accounting_transaction, invoice, lead, general The import mode (delta or full). Delta only fetches records changed since the last import.
Mevcut seçenekler:
delta, full, null Extra import options, as described by the import source's options schema.
Show child attributes
Show child attributes