Add a media file to a quick reply
curl --request POST \
--url https://app.flextell.ai/api/v1/quick-replies/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-Tenant: <x-tenant>' \
--form file=@example-file \
--form client_upload_id=3c90c3cc-0d44-4b50-8888-8dd25736052aimport requests
url = "https://app.flextell.ai/api/v1/quick-replies/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "client_upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('client_upload_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
const options = {
method: 'POST',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://app.flextell.ai/api/v1/quick-replies/{id}/media', 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/quick-replies/{id}/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data",
"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/quick-replies/{id}/media"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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/quick-replies/{id}/media")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/quick-replies/{id}/media")
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.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"shortcut": "<string>",
"message": "<string>",
"message_format": "<string>",
"is_active": true,
"usage_count": 123,
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"file": {
"id": 123,
"record_state": {
"is_read_only": true,
"reason_code": "<string>"
},
"name": "<string>",
"description": "<string>",
"type": "<string>",
"mime_type": "<string>",
"size": 123,
"formatted_size": "<string>",
"group_id": "<string>",
"fileable_type": "<string>",
"fileable_id": 123,
"fileable_name": "<string>",
"sort_order": 123,
"temporary_url": "<string>",
"temporary_thumbnail_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
},
"files": [
{
"id": 123,
"record_state": {
"is_read_only": true,
"reason_code": "<string>"
},
"name": "<string>",
"description": "<string>",
"type": "<string>",
"mime_type": "<string>",
"size": 123,
"formatted_size": "<string>",
"group_id": "<string>",
"fileable_type": "<string>",
"fileable_id": 123,
"fileable_name": "<string>",
"sort_order": 123,
"temporary_url": "<string>",
"temporary_thumbnail_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"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"
}
}Kanallar
Add a media file to a quick reply
POST
/
v1
/
quick-replies
/
{id}
/
media
Add a media file to a quick reply
curl --request POST \
--url https://app.flextell.ai/api/v1/quick-replies/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-Tenant: <x-tenant>' \
--form file=@example-file \
--form client_upload_id=3c90c3cc-0d44-4b50-8888-8dd25736052aimport requests
url = "https://app.flextell.ai/api/v1/quick-replies/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "client_upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('client_upload_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
const options = {
method: 'POST',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://app.flextell.ai/api/v1/quick-replies/{id}/media', 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/quick-replies/{id}/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data",
"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/quick-replies/{id}/media"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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/quick-replies/{id}/media")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/quick-replies/{id}/media")
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.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_upload_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"shortcut": "<string>",
"message": "<string>",
"message_format": "<string>",
"is_active": true,
"usage_count": 123,
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"file": {
"id": 123,
"record_state": {
"is_read_only": true,
"reason_code": "<string>"
},
"name": "<string>",
"description": "<string>",
"type": "<string>",
"mime_type": "<string>",
"size": 123,
"formatted_size": "<string>",
"group_id": "<string>",
"fileable_type": "<string>",
"fileable_id": 123,
"fileable_name": "<string>",
"sort_order": 123,
"temporary_url": "<string>",
"temporary_thumbnail_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
},
"files": [
{
"id": 123,
"record_state": {
"is_read_only": true,
"reason_code": "<string>"
},
"name": "<string>",
"description": "<string>",
"type": "<string>",
"mime_type": "<string>",
"size": 123,
"formatted_size": "<string>",
"group_id": "<string>",
"fileable_type": "<string>",
"fileable_id": 123,
"fileable_name": "<string>",
"sort_order": 123,
"temporary_url": "<string>",
"temporary_thumbnail_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"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 quick reply identifier
Gövde
multipart/form-data