Skip to content

Messaging Endpoint

aris alexis edited this page Feb 8, 2016 · 1 revision

The messaging sub-system is implemented using a super fast rid's in OrientDB and can be scalable. Chats and messages can be paginated and they can refer to specific events or activities (thus the referenceId).

Chat Entity

String ReferenceId if it refers to some activity or event

String title must be supplied and it is usually a comma separated list of usernames

Message[] this is at first the 50 messages but can be expanded

Hashmap[String,Long] updated usersId and their last read timestamp

Long timestamp last message

String[] participants userId's

Message Entity

String chatId

String body

String sender (username)

Long timestamp

POST /messaging/{chatId} Chat object

POST /messaging/{chatId}/messages passed objects: Chat,Message

GET /messaging/byUser/{userId} returns a List with only the first message

GET /messaging/{chatId}/timestamp void just tells the system user read the chat until this timestamp

PUT /messaging/{chatId} Chat will update the chat

GET /messaging/{chatId} returns the specific Chat with the first 10 messages

GET /messaging/{chatId}/messages Query params start,size to fetch messages for this chat paginated (in whatsapp style)

GET /messaging/byReferenceId/{referenceId} gets the chat associated with this referenceId