Messages API
Update a message
Update a message
PATCH
/
public
/
api
/
v1
/
inboxes
/
{inbox_identifier}
/
contacts
/
{contact_identifier}
/
conversations
/
{conversation_id}
/
messages
/
{message_id}
Update a message
curl --request PATCH \
--url https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id} \
--header 'Content-Type: application/json' \
--data '
{
"submitted_values": {
"name": "My Name",
"title": "My Title",
"value": "value",
"csat_survey_response": {
"feedback_message": "Great service!",
"rating": 5
}
}
}
'import requests
url = "https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}"
payload = { "submitted_values": {
"name": "My Name",
"title": "My Title",
"value": "value",
"csat_survey_response": {
"feedback_message": "Great service!",
"rating": 5
}
} }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
submitted_values: {
name: 'My Name',
title: 'My Title',
value: 'value',
csat_survey_response: {feedback_message: 'Great service!', rating: 5}
}
})
};
fetch('https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}', 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.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'submitted_values' => [
'name' => 'My Name',
'title' => 'My Title',
'value' => 'value',
'csat_survey_response' => [
'feedback_message' => 'Great service!',
'rating' => 5
]
]
]),
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://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}"
payload := strings.NewReader("{\n \"submitted_values\": {\n \"name\": \"My Name\",\n \"title\": \"My Title\",\n \"value\": \"value\",\n \"csat_survey_response\": {\n \"feedback_message\": \"Great service!\",\n \"rating\": 5\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}")
.header("Content-Type", "application/json")
.body("{\n \"submitted_values\": {\n \"name\": \"My Name\",\n \"title\": \"My Title\",\n \"value\": \"value\",\n \"csat_survey_response\": {\n \"feedback_message\": \"Great service!\",\n \"rating\": 5\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"submitted_values\": {\n \"name\": \"My Name\",\n \"title\": \"My Title\",\n \"value\": \"value\",\n \"csat_survey_response\": {\n \"feedback_message\": \"Great service!\",\n \"rating\": 5\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"content": "<string>",
"message_type": "<string>",
"content_type": "<string>",
"content_attributes": "<string>",
"created_at": "<string>",
"conversation_id": "<string>",
"attachments": [
{}
],
"sender": {}
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Path Parameters
The identifier obtained from API inbox channel
The source id of contact obtained on contact create
The numeric ID of the conversation
The numeric ID of the message
Body
application/json
Replies to the Bot Message Types
Show child attributes
Show child attributes
Response
Success
Id of the message
Text content of the message
Denotes the message type
Content type of the message
Additional content attributes of the message
Created at time stamp of the message
Conversation Id of the message
Attachments if any
Details of the sender
Previous
Get CSAT survey pageYou can redirect the client to this URL, instead of implementing the CSAT survey component yourself.
Next
⌘I
Update a message
curl --request PATCH \
--url https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id} \
--header 'Content-Type: application/json' \
--data '
{
"submitted_values": {
"name": "My Name",
"title": "My Title",
"value": "value",
"csat_survey_response": {
"feedback_message": "Great service!",
"rating": 5
}
}
}
'import requests
url = "https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}"
payload = { "submitted_values": {
"name": "My Name",
"title": "My Title",
"value": "value",
"csat_survey_response": {
"feedback_message": "Great service!",
"rating": 5
}
} }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
submitted_values: {
name: 'My Name',
title: 'My Title',
value: 'value',
csat_survey_response: {feedback_message: 'Great service!', rating: 5}
}
})
};
fetch('https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}', 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.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'submitted_values' => [
'name' => 'My Name',
'title' => 'My Title',
'value' => 'value',
'csat_survey_response' => [
'feedback_message' => 'Great service!',
'rating' => 5
]
]
]),
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://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}"
payload := strings.NewReader("{\n \"submitted_values\": {\n \"name\": \"My Name\",\n \"title\": \"My Title\",\n \"value\": \"value\",\n \"csat_survey_response\": {\n \"feedback_message\": \"Great service!\",\n \"rating\": 5\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}")
.header("Content-Type", "application/json")
.body("{\n \"submitted_values\": {\n \"name\": \"My Name\",\n \"title\": \"My Title\",\n \"value\": \"value\",\n \"csat_survey_response\": {\n \"feedback_message\": \"Great service!\",\n \"rating\": 5\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cria.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"submitted_values\": {\n \"name\": \"My Name\",\n \"title\": \"My Title\",\n \"value\": \"value\",\n \"csat_survey_response\": {\n \"feedback_message\": \"Great service!\",\n \"rating\": 5\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"content": "<string>",
"message_type": "<string>",
"content_type": "<string>",
"content_attributes": "<string>",
"created_at": "<string>",
"conversation_id": "<string>",
"attachments": [
{}
],
"sender": {}
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}