GET /mentor/chat_message/
{
result: [{
id: '21',
message_type: 'USER',
direction: 'INBOUND',
time_sent: '2016-11-30T09:43:20.311Z',
content: 'Sputnik sickles found in the seats'
}]
}
Choose number of items to return per page. Should be easy to add via django rest framework's out of the box pagination support.
direction
is something the client side will use to figure out whether this is a sent message (if value is OUTBOUND
), or received message (if value is INBOUND
). This will be much easier for the client side than trying to figure this out from the sender and receiver addresses.
it doesnt necessarily have to be a field on the model, it can be calculated in serializer if it makes more sense
mUSER
if the message was sent by a mentor or mentee, SYSTEM
if the message was sent by the system.
POST /mentor/chat_message/
{
content: 'To whisper the winds plea to accept an emptied room'
}
{
id: '23',
message_type: 'USER',
direction: 'OUTBOUND',
time_sent: '2016-11-30T09:43:20.311Z',
content: 'To whisper the winds plea to accept an emptied room'
}