Base url: https://social-chat.onrender.com

Get All Message

verb: GET

URL : https://social-chat.onrender.com/message/{chatId}

curl --location '<https://social-chat.onrender.com/message/bb5822a1-34c7-4ca7-8309-4f2a3a7ef140>'

Response Body

{
  "statusCode": 200,
  "message": "Get all chat messages",
  "data": [
    {
      "id": "0ba95635-2407-4eab-a281-6aa1c1a8ed6e",
      "sender": {
        "id": "8b5fc201-8866-416b-8542-e234defd7153",
        "firstName": "yash",
        "lastName": "Raj",
        "phone": "7479464719",
        "email": "[email protected]",
        "password": "ykdfsh@raj",
        "avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
        "createdAt": "2023-05-14T17:34:33.959535"
      },
      "senderId": null,
      "chatId": null,
      "message": "Hello testing last message",
      "createdAt": "2023-05-14T17:39:07.25911"
    },
    {
      "id": "72abcbcf-b5a6-4470-a685-e74595c6a268",
      "sender": {
        "id": "8b5fc201-8866-416b-8542-e234defd7153",
        "firstName": "yash",
        "lastName": "Raj",
        "phone": "7479464719",
        "email": "[email protected]",
        "password": "ykdfsh@raj",
        "avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
        "createdAt": "2023-05-14T17:34:33.959535"
      },
      "senderId": null,
      "chatId": null,
      "message": "Hey what are you doing",
      "createdAt": "2023-05-15T08:23:39.266997"
    },
    {
      "id": "02265745-20e4-41e4-83cb-382509ac4bce",
      "sender": {
        "id": "8b5fc201-8866-416b-8542-e234defd7153",
        "firstName": "yash",
        "lastName": "Raj",
        "phone": "7479464719",
        "email": "[email protected]",
        "password": "ykdfsh@raj",
        "avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
        "createdAt": "2023-05-14T17:34:33.959535"
      },
      "senderId": null,
      "chatId": null,
      "message": "some thing orpan",
      "createdAt": "2023-05-15T08:43:40.305922"
    }
  ]
}

Create Message

verb: POST

URL : https://social-chat.onrender.com/message

curl --location --globoff '<https://social-chat.onrender.com/message>' \\
--header 'Content-Type: application/json' \\
--data '{
    "senderId": "13b82817-2dd5-4053-8e33-1e1361eed050",
    "chatId": "bb5822a1-34c7-4ca7-8309-4f2a3a7ef140",
    "message": "Whats plan for tommorow",
    "createdAt": "2023-05-14T01:02:43.125331"
}'

Req Body

{
    "senderId": "13b82817-2dd5-4053-8e33-1e1361eed050",
    "chatId": "bb5822a1-34c7-4ca7-8309-4f2a3a7ef140",
    "message": "Whats plan for tommorow",
    "createdAt": "2023-05-14T01:02:43.125331"
}

Response Body

{
  "statusCode": 201,
  "message": "Message created successfully",
  "data": {
    "id": "3e8d2868-a199-4bca-8c62-518cf6fbfe2a",
    "sender": {
      "id": "13b82817-2dd5-4053-8e33-1e1361eed050",
      "firstName": "Jhon",
      "lastName": "Doe",
      "phone": "2222",
      "email": "[email protected]",
      "password": "ykdfsh@raj",
      "avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
      "createdAt": "2023-05-16T21:54:25.123898"
    },
    "senderId": "13b82817-2dd5-4053-8e33-1e1361eed050",
    "chatId": "bb5822a1-34c7-4ca7-8309-4f2a3a7ef140",
    "message": "Whats plan for tommorow",
    "createdAt": "2023-05-17T04:04:27.557478747"
  }
}