Pin a message in conversation
curl --request POST \
--url https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"duration": 86400
}
'import requests
url = "https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin"
payload = { "duration": 86400 }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({duration: 86400})
};
fetch('https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin', 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://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin",
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([
'duration' => 86400
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin"
payload := strings.NewReader("{\n \"duration\": 86400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"duration\": 86400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": 86400\n}"
response = http.request(request)
puts response.read_bodyChats
Pin Message
Pin a message at the top of the chat
POST
/
api
/
{session}
/
chats
/
{chatId}
/
messages
/
{messageId}
/
pin
Pin a message in conversation
curl --request POST \
--url https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"duration": 86400
}
'import requests
url = "https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin"
payload = { "duration": 86400 }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({duration: 86400})
};
fetch('https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin', 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://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin",
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([
'duration' => 86400
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin"
payload := strings.NewReader("{\n \"duration\": 86400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"duration\": 86400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/chats/{chatId}/messages/{messageId}/pin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": 86400\n}"
response = http.request(request)
puts response.read_bodyDescription
⚠️ This endpoint is not yet implemented. This endpoint will allow pinning specific messages at the top of a chat, highlighting them for all participants.Authorizations
Your Wappfy API key (get it at dash.wappfy.com.br)
Path Parameters
Session name (instanceName)
Conversation ID
Body
application/json
Duration in seconds. 24 hours (86400), 7 days (604800), 30 days
Example:
86400
Response
201 - undefined
⌘I
