Create message
Messages
POST messsage
Endpoint
POST /api/v1/chats/:chat_id/messages
Parameters
Name | Description |
---|---|
message[text] | Message text |
message[files] | Array of files signed ids |
Request
Route
POST /api/v1/chats/761/messages
Headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNDUxIiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzM3NTUxNTgzLCJleHAiOjE3NDAxNDM1ODMsImp0aSI6IjMxYWMzN2U5LWM3ODYtNDBlMC1hN2VkLTVkYjMyODUzNjJmOCJ9.6-ewKQebdZlgvtS5s65tL_aOys8qjXyQN5o3jxcze1o
Host: example.org
Cookie:
Body
{
"chat_id": 761,
"message": {
"text": "Dolor labore est natus.",
"files": [
"eyJfcmFpbHMiOnsiZGF0YSI6MjIsInB1ciI6ImJsb2JfaWQifX0=--78ce1c69d8416e0d41358130f671389e96d44b52"
]
}
}
Response
Simulated Response
Status
200
Headers
x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/json; charset=utf-8
vary: Accept, Origin
etag: W/"bf2c26bab1cc8e063b8ef9c6f2429744"
cache-control: max-age=0, private, must-revalidate
x-request-id: a4577c2d-169f-402a-8858-3ef0fbf46bb1
x-runtime: 0.092582
content-length: 438
Body
{
"message": {
"id": 20,
"created_at": "2025-01-22T13:13:03.834Z",
"files": [
{
"id": 22,
"signed_id": "eyJfcmFpbHMiOnsiZGF0YSI6MjIsInB1ciI6ImJsb2JfaWQifX0=--78ce1c69d8416e0d41358130f671389e96d44b52",
"byte_size": 596,
"filename": "test",
"url": "http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MjIsInB1ciI6ImJsb2JfaWQifX0=--78ce1c69d8416e0d41358130f671389e96d44b52/test"
}
],
"sender_id": 46,
"text": "Dolor labore est natus."
}
}