Api::V1::Neighborhoods::ChatMessagesController API

Chat messages

Create chat_message as a comment of another chat_message

POST /api/v1/neighborhoods/:neighborhood_id/chat_messages

Parameters

Name Description
token token
neighborhood_id neighborhood
chat_message[content] content is optional whenever image_url is defined
chat_message[image_url] Chat message image url
chat_message[parent_id] parent chat_message id

Request

Headers

Content-Type: application/json
Host: example.org
Cookie: 

Route

POST /api/v1/neighborhoods/4/chat_messages

Body

{"token":"foobar90","chat_message":{"content":"foo","parent_id":7}}

Response

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE
Access-Control-Allow-Headers: Origin,Accept,Content-Type,X-Requested-With,X-CSRF-Token,X-API-KEY
Content-Type: application/json; charset=utf-8
ETag: W/"7d5b9f0119667194582292c51723544b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: aa33716c-ea81-4bca-b9a1-a0d856ed1bd6
X-Runtime: 0.021430
Content-Length: 264

Status

201 Created

Body

{
  "chat_message": {
    "id": 8,
    "content": "foo",
    "user": {
      "id": 92,
      "avatar_url": null,
      "display_name": "John D.",
      "partner": null
    },
    "created_at": "2022-06-02T17:16:44.733+02:00",
    "message_type": "text",
    "post_id": 7,
    "has_comments": false,
    "comments_count": 0,
    "image_url": null,
    "read": null
  }
}