Update typing presence
curl --request POST \
--url https://api.writine.com/api/v1/chat/visitor/presence \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Origin: <origin>' \
--data '{
"typing": true
}'import requests
url = "https://api.writine.com/api/v1/chat/visitor/presence"
payload = { "typing": True }
headers = {
"Origin": "<origin>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Origin: '<origin>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({typing: true})
};
fetch('https://api.writine.com/api/v1/chat/visitor/presence', 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://api.writine.com/api/v1/chat/visitor/presence",
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([
'typing' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Origin: <origin>"
],
]);
$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://api.writine.com/api/v1/chat/visitor/presence"
payload := strings.NewReader("{\n \"typing\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Origin", "<origin>")
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://api.writine.com/api/v1/chat/visitor/presence")
.header("Origin", "<origin>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"typing\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.writine.com/api/v1/chat/visitor/presence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Origin"] = '<origin>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"typing\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": [
{
"conversation_id": "<string>",
"actor_id": "<string>",
"author_type": "staff",
"typing": true,
"expires_at": "2023-11-07T05:31:56Z"
}
],
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}API Reference
Update typing presence
Read or refresh this conversation’s typing presence. Authorization and resource ownership are evaluated on every request.
POST
/
api
/
v1
/
chat
/
visitor
/
presence
Update typing presence
curl --request POST \
--url https://api.writine.com/api/v1/chat/visitor/presence \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Origin: <origin>' \
--data '{
"typing": true
}'import requests
url = "https://api.writine.com/api/v1/chat/visitor/presence"
payload = { "typing": True }
headers = {
"Origin": "<origin>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Origin: '<origin>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({typing: true})
};
fetch('https://api.writine.com/api/v1/chat/visitor/presence', 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://api.writine.com/api/v1/chat/visitor/presence",
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([
'typing' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Origin: <origin>"
],
]);
$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://api.writine.com/api/v1/chat/visitor/presence"
payload := strings.NewReader("{\n \"typing\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Origin", "<origin>")
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://api.writine.com/api/v1/chat/visitor/presence")
.header("Origin", "<origin>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"typing\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.writine.com/api/v1/chat/visitor/presence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Origin"] = '<origin>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"typing\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": [
{
"conversation_id": "<string>",
"actor_id": "<string>",
"author_type": "staff",
"typing": true,
"expires_at": "2023-11-07T05:31:56Z"
}
],
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}{
"success": true,
"result": {
"code": "<string>"
},
"message": "<string>"
}Authorizations
Opaque, 24-hour, conversation-scoped visitor credential
Headers
Must exactly match the website's allowlist. Visitor tokens are bound to this origin.
Body
application/json