Onboard operator
curl --request POST \
--url https://services-api.talqui.chat/v1/operators/onboarding \
--header 'Content-Type: application/json' \
--data '
{
"operatorFirstname": "<string>",
"operatorLastname": "<string>",
"operatorPhone": "<string>"
}
'import requests
url = "https://services-api.talqui.chat/v1/operators/onboarding"
payload = {
"operatorFirstname": "<string>",
"operatorLastname": "<string>",
"operatorPhone": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
operatorFirstname: '<string>',
operatorLastname: '<string>',
operatorPhone: '<string>'
})
};
fetch('https://services-api.talqui.chat/v1/operators/onboarding', 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://services-api.talqui.chat/v1/operators/onboarding",
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([
'operatorFirstname' => '<string>',
'operatorLastname' => '<string>',
'operatorPhone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://services-api.talqui.chat/v1/operators/onboarding"
payload := strings.NewReader("{\n \"operatorFirstname\": \"<string>\",\n \"operatorLastname\": \"<string>\",\n \"operatorPhone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://services-api.talqui.chat/v1/operators/onboarding")
.header("Content-Type", "application/json")
.body("{\n \"operatorFirstname\": \"<string>\",\n \"operatorLastname\": \"<string>\",\n \"operatorPhone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services-api.talqui.chat/v1/operators/onboarding")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"operatorFirstname\": \"<string>\",\n \"operatorLastname\": \"<string>\",\n \"operatorPhone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"operator": {
"createdAt": "2023-11-07T05:31:56Z",
"lastSignInAt": "2023-11-07T05:31:56Z",
"lastTenantID": "<string>",
"operatorEmail": "<string>",
"operatorFirstname": "<string>",
"operatorID": "<string>",
"operatorLastname": "<string>",
"operatorMeta": {},
"operatorPhone": "<string>",
"operatorPhoto": "<string>",
"operatorRoles": [
"<string>"
],
"updatedAt": "2023-11-07T05:31:56Z",
"operatorSettings": {
"notificationSettings": {
"allDisabled": true,
"allowSounds": true,
"onMessageInbound": true,
"onSessionCreated": true,
"onSessionQueued": true,
"tokens": {
"mobile": "<string>",
"web": "<string>"
},
"onOperatorMentioned": true
}
},
"organizationID": "<string>"
}
}
}{
"errors": [
{
"error": "RequestValidationError",
"error_code": 1002,
"fields": [
{
"allowed": "<string>",
"field": "<string>",
"received": "<string>"
}
],
"message": "Invalid request data.",
"statusCode": 400
}
]
}{
"errors": [
{
"error": "UnauthorizedError",
"error_code": 1003,
"message": "You are not authorized to perform this request.",
"statusCode": 401
}
]
}{
"errors": [
{
"error": "EmailNotVerifiedError",
"error_code": 1853,
"message": "Verify your e-mail address first.",
"statusCode": 403
}
]
}{
"errors": [
{
"error": "OperatorAlreadyOnboardedError",
"error_code": 1851,
"message": "This identity already has an operator.",
"statusCode": 409
}
]
}{
"errors": [
{
"error": "UnknownError",
"error_code": 5999,
"message": "For some unknown reason your request has not succeeded.",
"statusCode": 500
}
]
}Operators
Onboard operator
Creates the operator of the authenticated account. Takes an access token
(Bearer tq_at_...) of an account with a verified e-mail and no operator
yet; the e-mail becomes the operator’s address.
Idempotent: when the account already has an operator the answer is
409 OperatorAlreadyOnboardedError with that operator in
data.operator, so a retry can be treated as success.
The response carries no token. Refresh the access token afterwards: the current one may keep resolving to the account without an operator for up to two minutes.
POST
/
v1
/
operators
/
onboarding
Onboard operator
curl --request POST \
--url https://services-api.talqui.chat/v1/operators/onboarding \
--header 'Content-Type: application/json' \
--data '
{
"operatorFirstname": "<string>",
"operatorLastname": "<string>",
"operatorPhone": "<string>"
}
'import requests
url = "https://services-api.talqui.chat/v1/operators/onboarding"
payload = {
"operatorFirstname": "<string>",
"operatorLastname": "<string>",
"operatorPhone": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
operatorFirstname: '<string>',
operatorLastname: '<string>',
operatorPhone: '<string>'
})
};
fetch('https://services-api.talqui.chat/v1/operators/onboarding', 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://services-api.talqui.chat/v1/operators/onboarding",
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([
'operatorFirstname' => '<string>',
'operatorLastname' => '<string>',
'operatorPhone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://services-api.talqui.chat/v1/operators/onboarding"
payload := strings.NewReader("{\n \"operatorFirstname\": \"<string>\",\n \"operatorLastname\": \"<string>\",\n \"operatorPhone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://services-api.talqui.chat/v1/operators/onboarding")
.header("Content-Type", "application/json")
.body("{\n \"operatorFirstname\": \"<string>\",\n \"operatorLastname\": \"<string>\",\n \"operatorPhone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services-api.talqui.chat/v1/operators/onboarding")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"operatorFirstname\": \"<string>\",\n \"operatorLastname\": \"<string>\",\n \"operatorPhone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"operator": {
"createdAt": "2023-11-07T05:31:56Z",
"lastSignInAt": "2023-11-07T05:31:56Z",
"lastTenantID": "<string>",
"operatorEmail": "<string>",
"operatorFirstname": "<string>",
"operatorID": "<string>",
"operatorLastname": "<string>",
"operatorMeta": {},
"operatorPhone": "<string>",
"operatorPhoto": "<string>",
"operatorRoles": [
"<string>"
],
"updatedAt": "2023-11-07T05:31:56Z",
"operatorSettings": {
"notificationSettings": {
"allDisabled": true,
"allowSounds": true,
"onMessageInbound": true,
"onSessionCreated": true,
"onSessionQueued": true,
"tokens": {
"mobile": "<string>",
"web": "<string>"
},
"onOperatorMentioned": true
}
},
"organizationID": "<string>"
}
}
}{
"errors": [
{
"error": "RequestValidationError",
"error_code": 1002,
"fields": [
{
"allowed": "<string>",
"field": "<string>",
"received": "<string>"
}
],
"message": "Invalid request data.",
"statusCode": 400
}
]
}{
"errors": [
{
"error": "UnauthorizedError",
"error_code": 1003,
"message": "You are not authorized to perform this request.",
"statusCode": 401
}
]
}{
"errors": [
{
"error": "EmailNotVerifiedError",
"error_code": 1853,
"message": "Verify your e-mail address first.",
"statusCode": 403
}
]
}{
"errors": [
{
"error": "OperatorAlreadyOnboardedError",
"error_code": 1851,
"message": "This identity already has an operator.",
"statusCode": 409
}
]
}{
"errors": [
{
"error": "UnknownError",
"error_code": 5999,
"message": "For some unknown reason your request has not succeeded.",
"statusCode": 500
}
]
}⌘I