Attach treatments to a doctor
curl --request POST \
--url https://app.flextell.ai/api/v1/doctors/{id}/treatments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"treatment_ids": [
2
]
}
'import requests
url = "https://app.flextell.ai/api/v1/doctors/{id}/treatments"
payload = { "treatment_ids": [2] }
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({treatment_ids: [2]})
};
fetch('https://app.flextell.ai/api/v1/doctors/{id}/treatments', 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/doctors/{id}/treatments",
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([
'treatment_ids' => [
2
]
]),
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/doctors/{id}/treatments"
payload := strings.NewReader("{\n \"treatment_ids\": [\n 2\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/doctors/{id}/treatments")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"treatment_ids\": [\n 2\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/doctors/{id}/treatments")
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 \"treatment_ids\": [\n 2\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"name": "<string>",
"email": "<string>",
"title": "<string>",
"phone": "<string>",
"emergency_contact_name": "<string>",
"emergency_contact_surname": "<string>",
"emergency_contact_phone_number": "<string>",
"blood_group": "<string>",
"language": [
"<unknown>"
],
"avatar_url": "<string>",
"is_active": true,
"bio": "<string>",
"preferred_invoice_account_id": 123,
"last_login_at": "2023-11-07T05:31:56Z",
"last_login_ip": "<string>",
"has_calendar_integration": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"treatments": [
{
"id": 123,
"group_id": 123,
"name": "<string>",
"invoice_name": "<string>",
"keywords": [
"<unknown>"
],
"price": "<string>",
"tax_rate": 123,
"description": "<string>",
"session": 123,
"is_active": "<string>",
"extra_info": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"group": {
"id": 123,
"name": "<string>",
"is_active": true
},
"users": [
{
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
}
],
"sessions": [
{
"id": 123,
"session_order": 123,
"session_type": "control",
"next_gap_days": 123,
"offset_days": 123,
"products": [
{
"id": 123,
"product_id": 123,
"min_quantity": 123,
"product": {
"id": 123,
"name": "<string>",
"full_name": "<string>",
"brand": {
"id": 123,
"name": "<string>"
},
"unit_code": {
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}
]
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}Klinik
Attach treatments to a doctor
Adds the given treatments without touching the doctor’s existing links. Treatments that are already attached are ignored.
POST
/
v1
/
doctors
/
{id}
/
treatments
Attach treatments to a doctor
curl --request POST \
--url https://app.flextell.ai/api/v1/doctors/{id}/treatments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"treatment_ids": [
2
]
}
'import requests
url = "https://app.flextell.ai/api/v1/doctors/{id}/treatments"
payload = { "treatment_ids": [2] }
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({treatment_ids: [2]})
};
fetch('https://app.flextell.ai/api/v1/doctors/{id}/treatments', 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/doctors/{id}/treatments",
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([
'treatment_ids' => [
2
]
]),
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/doctors/{id}/treatments"
payload := strings.NewReader("{\n \"treatment_ids\": [\n 2\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/doctors/{id}/treatments")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"treatment_ids\": [\n 2\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/doctors/{id}/treatments")
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 \"treatment_ids\": [\n 2\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"name": "<string>",
"email": "<string>",
"title": "<string>",
"phone": "<string>",
"emergency_contact_name": "<string>",
"emergency_contact_surname": "<string>",
"emergency_contact_phone_number": "<string>",
"blood_group": "<string>",
"language": [
"<unknown>"
],
"avatar_url": "<string>",
"is_active": true,
"bio": "<string>",
"preferred_invoice_account_id": 123,
"last_login_at": "2023-11-07T05:31:56Z",
"last_login_ip": "<string>",
"has_calendar_integration": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"treatments": [
{
"id": 123,
"group_id": 123,
"name": "<string>",
"invoice_name": "<string>",
"keywords": [
"<unknown>"
],
"price": "<string>",
"tax_rate": 123,
"description": "<string>",
"session": 123,
"is_active": "<string>",
"extra_info": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"group": {
"id": 123,
"name": "<string>",
"is_active": true
},
"users": [
{
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
}
],
"sessions": [
{
"id": 123,
"session_order": 123,
"session_type": "control",
"next_gap_days": 123,
"offset_days": 123,
"products": [
{
"id": 123,
"product_id": 123,
"min_quantity": 123,
"product": {
"id": 123,
"name": "<string>",
"full_name": "<string>",
"brand": {
"id": 123,
"name": "<string>"
},
"unit_code": {
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}
]
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"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 doctor identifier
Gövde
application/json
The treatment IDs to attach to or detach from the doctor. Each must belong to the current tenant.
Minimum array length:
1A treatment ID.
Gerekli aralık:
x >= 1