CLONESAHIBINDEN
FRONTEND GUIDE FOR AI CODING AGENTS - PART 8 - Conversation Service
This document is a part of a REST API guide for the clonesahibinden project. It is designed for AI agents that will generate frontend code to consume the project’s backend.
This document provides extensive instruction for the usage of conversation
Service Access
Conversation service management is handled through service specific base urls.
Conversation service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.).
For the conversation service, the base URLs are:
-
Preview:
https://clonesahibinden.prw.mindbricks.com/conversation-api -
Staging:
https://clonesahibinden-stage.mindbricks.co/conversation-api -
Production:
https://clonesahibinden.mindbricks.co/conversation-api
Scope
Conversation Service Description
Manages user-to-user messaging threads tied to listings, with message storage, read/unread and moderation support.
Conversation service provides apis and business logic for following data objects in clonesahibinden application. Each data object may be either a central domain of the application data structure or a related helper data object for a central concept. Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows.
conversationMessage Data Object: A
single message sent between two users within a conversation about a
listing. Tracks sender, receiver, timestamps and read status.
conversationThread Data Object: Private
messaging thread between two users regarding a specific listing.
Unique per (listing, user pair), order-invariant. Tracks last message
time for inbox sorting.
Conversation Service Frontend Description By The Backend Architect
Conversation Microservice UX Guidance
- Users can contact a listing owner by starting a conversation from a listing detail page.
- All messaging is per-listing; a unique thread exists per user pair/listing combination.
- Inbox shows summaries of all conversations a user is in (listing, other participant, last message).
API Structure
Object Structure of a Successful Response
When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client.
HTTP Status Codes:
- 200 OK: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully.
- 201 Created: Returned for CREATE operations, indicating that the resource was created successfully.
Success Response Format:
For successful operations, the response includes a
"status": "OK" property, signaling
that the request executed successfully. The structure of a successful
response is outlined below:
{
"status":"OK",
"statusCode": 200,
"elapsedMs":126,
"ssoTime":120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName":"products",
"method":"GET",
"action":"list",
"appVersion":"Version",
"rowCount":3,
"products":[{},{},{}],
"paging": {
"pageNumber":1,
"pageRowCount":25,
"totalRowCount":3,
"pageCount":1
},
"filters": [],
"uiPermissions": []
}
-
products: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation.
Additional Data
Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature.
Error Response
If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity:
- 400 Bad Request: The request was improperly formatted or contained invalid parameters.
- 401 Unauthorized: The request lacked a valid authentication token; login is required.
- 403 Forbidden: The current token does not grant access to the requested resource.
- 404 Not Found: The requested resource was not found on the server.
- 500 Internal Server Error: The server encountered an unexpected condition.
Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution.
{
"result": "ERR",
"status": 400,
"message": "errMsg_organizationIdisNotAValidID",
"errCode": 400,
"date": "2024-03-19T12:13:54.124Z",
"detail": "String"
}
Bucket Management
(This information is also given in PART 1 prompt.)
This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token.
Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token.
User Bucket This bucket stores public user files for each user.
When a user logs in—or in the /currentuser response—there
is a userBucketToken to use when sending user-related
public files to the bucket service.
{
//...
"userBucketToken": "e56d...."
}
To upload a file
POST {baseUrl}/bucket/upload
The request body is form-data which includes the
bucketId and the file binary in the
files field.
{
bucketId: "{userId}-public-user-bucket",
files: {binary}
}
Response status is 200 on success, e.g., body:
{
"success": true,
"data": [
{
"fileId": "9da03f6d-0409-41ad-bb06-225a244ae408",
"originalName": "test (10).png",
"mimeType": "image/png",
"size": 604063,
"status": "uploaded",
"bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket",
"isPublic": true,
"downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408"
}
]
}
To download a file from the bucket, you need its fileId.
If you upload an avatar or other asset, ensure the download URL or the
fileId is stored in the backend.
Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record.
Application Bucket
This Clonesahibinden application also includes a common public bucket
that anyone can read, but only users with the superAdmin,
admin, or saasAdmin roles can write (upload)
to it.
When a user with one of these admin roles is logged in, the
/login response or the /currentuser response
also returns an applicationBucketToken field, which is
used when uploading any file to the application bucket.
{
//...
"applicationBucketToken": "e23fd...."
}
The common public application bucket ID is
"clonesahibinden-public-common-bucket"
In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images.
Please configure your UI to upload files to the application bucket using this bucket token whenever needed.
Object Buckets Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files.
These buckets will be used as described in the relevant object definitions.
ConversationMessage Data Object
A single message sent between two users within a conversation about a listing. Tracks sender, receiver, timestamps and read status.
ConversationMessage Data Object Frontend Description By The Backend Architect
Represents individual messages inside a conversation. Sender and receiver must match the thread participants. Users only see their own conversations and messages. Moderators can view all.
ConversationMessage Data Object Properties
ConversationMessage data object has got following properties that are represented as table fields in the database scheme. These properties don’t stand just for data storage, but each may have different settings to manage the business logic.
| Property | Type | IsArray | Required | Secret | Description |
|---|---|---|---|---|---|
content |
Text | false | Yes | No | Message text body. Sanitized before saving. |
conversationThreadId |
ID | false | Yes | No | Parent thread for this message. |
isRead |
Boolean | false | Yes | No | True if the receiver has read this message. |
readAt |
Date | false | No | No | Timestamp when the receiver read the message (null if unread). |
receiverId |
ID | false | Yes | No | User receiving the message (must be the other participant of the thread). |
senderId |
ID | false | Yes | No | User sending the message (must be a participant of the thread). |
sentAt |
Date | false | Yes | No | Timestamp when message was sent. |
- Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set.
Relation Properties
conversationThreadId receiverId
senderId
Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one.
In frontend, please ensure that,
1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field.
-
conversationThreadId: ID Relation to
conversationThread.id
The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.
Required: Yes
-
receiverId: ID Relation to
user.id
The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.
Required: Yes
-
senderId: ID Relation to
user.id
The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.
Required: Yes
ConversationThread Data Object
Private messaging thread between two users regarding a specific listing. Unique per (listing, user pair), order-invariant. Tracks last message time for inbox sorting.
ConversationThread Data Object Frontend Description By The Backend Architect
Each thread uniquely represents all messages between two users about one listing. Users see these in inbox; moderators can list/search all for review.
ConversationThread Data Object Properties
ConversationThread data object has got following properties that are represented as table fields in the database scheme. These properties don’t stand just for data storage, but each may have different settings to manage the business logic.
| Property | Type | IsArray | Required | Secret | Description |
|---|---|---|---|---|---|
lastMessageAt |
Date | false | Yes | No | Date/time of the latest message in the thread (for sorting inbox). |
listingId |
ID | false | Yes | No | ID of the listing being discussed. |
receiverId |
ID | false | Yes | No | User B in the conversation (order-invariant with senderId). |
senderId |
ID | false | Yes | No | User A in the conversation (order-invariant with receiverId). |
- Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set.
Relation Properties
listingId receiverId senderId
Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one.
In frontend, please ensure that,
1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field.
-
listingId: ID Relation to
listing.id
The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.
Required: Yes
-
receiverId: ID Relation to
user.id
The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.
Required: Yes
-
senderId: ID Relation to
user.id
The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.
Required: Yes
Default CRUD APIs
For each data object, the backend architect may designate
default APIs for standard operations (create, update,
delete, get, list). These are the APIs that frontend CRUD forms and AI
agents should use for basic record management. If no default is
explicitly set (isDefaultApi), the frontend generator
auto-discovers the most general API for each operation.
ConversationMessage Default APIs
| Operation | API Name | Route | Explicitly Set |
|---|---|---|---|
| Create | createConversationMessage |
/v1/conversationmessages |
Auto |
| Update | markMessageAsRead |
/v1/markmessageasread/:conversationMessageId |
Auto |
| Delete | deleteConversationMessage |
/v1/conversationmessages/:conversationMessageId
|
Auto |
| Get | getConversationMessage |
/v1/conversationmessages/:conversationMessageId
|
Auto |
| List | listConversationMessages |
/v1/listconversationmessages/:conversationThreadId
|
System |
ConversationThread Default APIs
| Operation | API Name | Route | Explicitly Set |
|---|---|---|---|
| Create | createConversationThread |
/v1/conversationthreads |
Auto |
| Update | none | - | Auto |
| Delete | none | - | Auto |
| Get | getConversationThread |
/v1/conversationthreads/:conversationThreadId
|
Auto |
| List | listConversationThreads |
/v1/conversationthreads |
System |
When building CRUD forms for a data object, use the default create/update APIs listed above. The form fields should correspond to the API’s body parameters. For relation fields, render a dropdown loaded from the related object’s list API using the display label property.
API Reference
Create Conversationmessage API
Send a new message in a conversation. Only thread participants can send; updates thread’s lastMessageAt.
API Frontend Description By The Backend Architect
Used when a user sends a message in a conversation (thread). On success, new message appears in thread; unread by receiver.
Rest Route
The createConversationMessage API REST controller can be
triggered via the following route:
/v1/conversationmessages
Rest Request Parameters
The createConversationMessage api has got 7 regular
request parameters
| Parameter | Type | Required | Population |
|---|---|---|---|
| content | Text | true | request.body?.[“content”] |
| conversationThreadId | ID | true | request.body?.[“conversationThreadId”] |
| isRead | Boolean | true | request.body?.[“isRead”] |
| readAt | Date | false | request.body?.[“readAt”] |
| receiverId | ID | true | request.body?.[“receiverId”] |
| senderId | ID | true | request.body?.[“senderId”] |
| sentAt | Date | true | request.body?.[“sentAt”] |
| content : Message text body. Sanitized before saving. | |||
| conversationThreadId : Parent thread for this message. | |||
| isRead : True if the receiver has read this message. | |||
| readAt : Timestamp when the receiver read the message (null if unread). | |||
| receiverId : User receiving the message (must be the other participant of the thread). | |||
| senderId : User sending the message (must be a participant of the thread). | |||
| sentAt : Timestamp when message was sent. |
REST Request To access the api you can use the REST controller with the path POST /v1/conversationmessages
axios({
method: 'POST',
url: '/v1/conversationmessages',
data: {
content:"Text",
conversationThreadId:"ID",
isRead:"Boolean",
readAt:"Date",
receiverId:"ID",
senderId:"ID",
sentAt:"Date",
},
params: {
}
});
REST Response
{
"status": "OK",
"statusCode": "201",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationMessage",
"method": "POST",
"action": "create",
"appVersion": "Version",
"rowCount": 1,
"conversationMessage": {
"id": "ID",
"content": "Text",
"conversationThreadId": "ID",
"isRead": "Boolean",
"readAt": "Date",
"receiverId": "ID",
"senderId": "ID",
"sentAt": "Date",
"isActive": true,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID"
}
}
Create Conversationthread API
Starts a new conversation thread between two users for a specific listing. Prevents duplicate threads for the same user pair/listing.
API Frontend Description By The Backend Architect
Invoked when user contacts seller about a listing. If an existing thread exists for this user pair/listing (any order), it is reused. Only listing owner or buyers can start a thread.
Rest Route
The createConversationThread API REST controller can be
triggered via the following route:
/v1/conversationthreads
Rest Request Parameters
The createConversationThread api has got 4 regular
request parameters
| Parameter | Type | Required | Population |
|---|---|---|---|
| lastMessageAt | Date | true | request.body?.[“lastMessageAt”] |
| listingId | ID | true | request.body?.[“listingId”] |
| receiverId | ID | true | request.body?.[“receiverId”] |
| senderId | ID | true | request.body?.[“senderId”] |
| lastMessageAt : Date/time of the latest message in the thread (for sorting inbox). | |||
| listingId : ID of the listing being discussed. | |||
| receiverId : User B in the conversation (order-invariant with senderId). | |||
| senderId : User A in the conversation (order-invariant with receiverId). |
REST Request To access the api you can use the REST controller with the path POST /v1/conversationthreads
axios({
method: 'POST',
url: '/v1/conversationthreads',
data: {
lastMessageAt:"Date",
listingId:"ID",
receiverId:"ID",
senderId:"ID",
},
params: {
}
});
REST Response
{
"status": "OK",
"statusCode": "201",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationThread",
"method": "POST",
"action": "create",
"appVersion": "Version",
"rowCount": 1,
"conversationThread": {
"id": "ID",
"lastMessageAt": "Date",
"listingId": "ID",
"receiverId": "ID",
"senderId": "ID",
"isActive": true,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID"
}
}
Delete Conversationmessage API
Soft-deletes a message. Only moderator/admins can fully delete; users may hide/delete for self (future phase).
API Frontend Description By The Backend Architect
Used for moderation; message remains for audit trail/history.
Rest Route
The deleteConversationMessage API REST controller can be
triggered via the following route:
/v1/conversationmessages/:conversationMessageId
Rest Request Parameters
The deleteConversationMessage api has got 1 regular
request parameter
| Parameter | Type | Required | Population |
|---|---|---|---|
| conversationMessageId | ID | true | request.params?.[“conversationMessageId”] |
| conversationMessageId : This id paremeter is used to select the required data object that will be deleted |
REST Request To access the api you can use the REST controller with the path DELETE /v1/conversationmessages/:conversationMessageId
axios({
method: 'DELETE',
url: `/v1/conversationmessages/${conversationMessageId}`,
data: {
},
params: {
}
});
REST Response
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationMessage",
"method": "DELETE",
"action": "delete",
"appVersion": "Version",
"rowCount": 1,
"conversationMessage": {
"id": "ID",
"content": "Text",
"conversationThreadId": "ID",
"isRead": "Boolean",
"readAt": "Date",
"receiverId": "ID",
"senderId": "ID",
"sentAt": "Date",
"isActive": false,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID"
}
}
Get Conversationmessage API
Fetch a single message by ID. Only accessible to participants or moderators/admins.
API Frontend Description By The Backend Architect
Loads a message for display in UI. Fails if not participant or staff.
Rest Route
The getConversationMessage API REST controller can be
triggered via the following route:
/v1/conversationmessages/:conversationMessageId
Rest Request Parameters
The getConversationMessage api has got 1 regular request
parameter
| Parameter | Type | Required | Population |
|---|---|---|---|
| conversationMessageId | ID | true | request.params?.[“conversationMessageId”] |
| conversationMessageId : This id paremeter is used to query the required data object. |
REST Request To access the api you can use the REST controller with the path GET /v1/conversationmessages/:conversationMessageId
axios({
method: 'GET',
url: `/v1/conversationmessages/${conversationMessageId}`,
data: {
},
params: {
}
});
REST Response
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationMessage",
"method": "GET",
"action": "get",
"appVersion": "Version",
"rowCount": 1,
"conversationMessage": {
"id": "ID",
"content": "Text",
"conversationThreadId": "ID",
"isRead": "Boolean",
"readAt": "Date",
"receiverId": "ID",
"senderId": "ID",
"sentAt": "Date",
"isActive": true,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID"
}
}
Get Conversationthread API
Get a conversation thread by ID. Only visible to participants or staff.
API Frontend Description By The Backend Architect
Shows full thread info for inbox/detail view. Fails if user does not participate or is not moderator/admin.
Rest Route
The getConversationThread API REST controller can be
triggered via the following route:
/v1/conversationthreads/:conversationThreadId
Rest Request Parameters
The getConversationThread api has got 1 regular request
parameter
| Parameter | Type | Required | Population |
|---|---|---|---|
| conversationThreadId | ID | true | request.params?.[“conversationThreadId”] |
| conversationThreadId : This id paremeter is used to query the required data object. |
REST Request To access the api you can use the REST controller with the path GET /v1/conversationthreads/:conversationThreadId
axios({
method: 'GET',
url: `/v1/conversationthreads/${conversationThreadId}`,
data: {
},
params: {
}
});
REST Response
This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationThread",
"method": "GET",
"action": "get",
"appVersion": "Version",
"rowCount": 1,
"conversationThread": {
"listing": {
"status": "Enum",
"status_idx": "Integer",
"title": "String",
"userId": "ID"
},
"isActive": true
}
}
List Conversationmessages API
List all messages in a thread, sorted oldest to newest. Only accessible to thread participants or staff.
API Frontend Description By The Backend Architect
Loads the chat history in UI for reading; includes isRead, sender info, etc. Used for conversation detail view.
Rest Route
The listConversationMessages API REST controller can be
triggered via the following route:
/v1/listconversationmessages/:conversationThreadId
Rest Request Parameters
The listConversationMessages api has got 1 regular
request parameter
| Parameter | Type | Required | Population |
|---|---|---|---|
| conversationThreadId | ID | true | request.query?.[“conversationThreadId”] |
| conversationThreadId : Thread to load messages from. |
REST Request To access the api you can use the REST controller with the path GET /v1/listconversationmessages/:conversationThreadId
axios({
method: 'GET',
url: `/v1/listconversationmessages/${conversationThreadId}`,
data: {
},
params: {
conversationThreadId:'"ID"',
}
});
REST Response
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationMessages",
"method": "GET",
"action": "list",
"appVersion": "Version",
"rowCount": "\"Number\"",
"conversationMessages": [
{
"id": "ID",
"content": "Text",
"conversationThreadId": "ID",
"isRead": "Boolean",
"readAt": "Date",
"receiverId": "ID",
"senderId": "ID",
"sentAt": "Date",
"isActive": true,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID"
},
{},
{}
],
"paging": {
"pageNumber": "Number",
"pageRowCount": "NUmber",
"totalRowCount": "Number",
"pageCount": "Number"
},
"filters": [],
"uiPermissions": []
}
List Conversationthreads API
List all threads a user participates in, most recent first. Also used for moderator search/all-list.
API Frontend Description By The Backend Architect
Shows all user’s conversation threads in inbox. Moderators can search all.
Rest Route
The listConversationThreads API REST controller can be
triggered via the following route:
/v1/conversationthreads
Rest Request Parameters The
listConversationThreads api has got no request
parameters.
REST Request To access the api you can use the REST controller with the path GET /v1/conversationthreads
axios({
method: 'GET',
url: '/v1/conversationthreads',
data: {
},
params: {
}
});
REST Response
This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationThreads",
"method": "GET",
"action": "list",
"appVersion": "Version",
"rowCount": "\"Number\"",
"conversationThreads": [
{
"listing": [
{
"status": "Enum",
"status_idx": "Integer",
"title": "String",
"userId": "ID"
},
{},
{}
],
"isActive": true
},
{},
{}
],
"paging": {
"pageNumber": "Number",
"pageRowCount": "NUmber",
"totalRowCount": "Number",
"pageCount": "Number"
},
"filters": [],
"uiPermissions": []
}
Mark Messageasread API
Marks a message as read (isRead=true, readAt=now); only allowed for receiver.
API Frontend Description By The Backend Architect
When viewing messages, receiver marks message as read – triggers unread count decrement in UI, updates message status.
Rest Route
The markMessageAsRead API REST controller can be
triggered via the following route:
/v1/markmessageasread/:conversationMessageId
Rest Request Parameters
The markMessageAsRead api has got 3 regular request
parameters
| Parameter | Type | Required | Population |
|---|---|---|---|
| conversationMessageId | ID | true | request.params?.[“conversationMessageId”] |
| isRead | Boolean | false | request.body?.[“isRead”] |
| readAt | Date | false | request.body?.[“readAt”] |
| conversationMessageId : This id paremeter is used to select the required data object that will be updated | |||
| isRead : True if the receiver has read this message. | |||
| readAt : Timestamp when the receiver read the message (null if unread). |
REST Request To access the api you can use the REST controller with the path PATCH /v1/markmessageasread/:conversationMessageId
axios({
method: 'PATCH',
url: `/v1/markmessageasread/${conversationMessageId}`,
data: {
isRead:"Boolean",
readAt:"Date",
},
params: {
}
});
REST Response
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationMessage",
"method": "PATCH",
"action": "update",
"appVersion": "Version",
"rowCount": 1,
"conversationMessage": {
"id": "ID",
"content": "Text",
"conversationThreadId": "ID",
"isRead": "Boolean",
"readAt": "Date",
"receiverId": "ID",
"senderId": "ID",
"sentAt": "Date",
"isActive": true,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID"
}
}
_fetch Listconversationmessage API
System API to fetch list of conversationMessage records for frontend application. Auto-generated, not visible in design.
Rest Route
The _fetchListConversationMessage API REST controller can
be triggered via the following route:
/v1/_fetchlistconversationmessage
Rest Request Parameters The
_fetchListConversationMessage api has got no request
parameters.
REST Request To access the api you can use the REST controller with the path GET /v1/_fetchlistconversationmessage
axios({
method: 'GET',
url: '/v1/_fetchlistconversationmessage',
data: {
},
params: {
}
});
REST Response
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationMessages",
"method": "GET",
"action": "list",
"appVersion": "Version",
"rowCount": "\"Number\"",
"conversationMessages": [
{
"id": "ID",
"content": "Text",
"conversationThreadId": "ID",
"isRead": "Boolean",
"readAt": "Date",
"receiverId": "ID",
"senderId": "ID",
"sentAt": "Date",
"isActive": true,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID",
"thread": [
{
"lastMessageAt": "Date",
"listingId": "ID",
"receiverId": "ID",
"senderId": "ID"
},
{},
{}
],
"receiverUser": [
{
"fullname": "String"
},
{},
{}
],
"senderUser": [
{
"fullname": "String"
},
{},
{}
]
},
{},
{}
],
"paging": {
"pageNumber": "Number",
"pageRowCount": "NUmber",
"totalRowCount": "Number",
"pageCount": "Number"
},
"filters": [],
"uiPermissions": []
}
_fetch Listconversationthread API
System API to fetch list of conversationThread records for frontend application. Auto-generated, not visible in design.
Rest Route
The _fetchListConversationThread API REST controller can
be triggered via the following route:
/v1/_fetchlistconversationthread
Rest Request Parameters The
_fetchListConversationThread api has got no request
parameters.
REST Request To access the api you can use the REST controller with the path GET /v1/_fetchlistconversationthread
axios({
method: 'GET',
url: '/v1/_fetchlistconversationthread',
data: {
},
params: {
}
});
REST Response
{
"status": "OK",
"statusCode": "200",
"elapsedMs": 126,
"ssoTime": 120,
"source": "db",
"cacheKey": "hexCode",
"userId": "ID",
"sessionId": "ID",
"requestId": "ID",
"dataName": "conversationThreads",
"method": "GET",
"action": "list",
"appVersion": "Version",
"rowCount": "\"Number\"",
"conversationThreads": [
{
"id": "ID",
"lastMessageAt": "Date",
"listingId": "ID",
"receiverId": "ID",
"senderId": "ID",
"isActive": true,
"recordVersion": "Integer",
"createdAt": "Date",
"updatedAt": "Date",
"_owner": "ID",
"listing": [
{
"attributes": "Object",
"categoryId": "ID",
"condition": "Enum",
"condition_idx": "Integer",
"contactEmail": "String",
"contactPhone": "String",
"currency": "String",
"description": "Text",
"expiresAt": "Date",
"favoriteCount": "Integer",
"isPremium": "Boolean",
"listingType": "Enum",
"listingType_idx": "Integer",
"locationId": "ID",
"_paymentConfirmation": "String",
"premiumExpiry": "Date",
"premiumType": "Enum",
"premiumType_idx": "Integer",
"price": "Double",
"status": "Enum",
"status_idx": "Integer",
"subcategoryId": "ID",
"title": "String",
"userId": "ID",
"viewsCount": "Integer"
},
{},
{}
],
"receiverUser": [
{
"fullname": "String"
},
{},
{}
],
"senderUser": [
{
"fullname": "String"
},
{},
{}
]
},
{},
{}
],
"paging": {
"pageNumber": "Number",
"pageRowCount": "NUmber",
"totalRowCount": "Number",
"pageCount": "Number"
},
"filters": [],
"uiPermissions": []
}
After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.