Unread Messages

Brief description:

  • Fetch unread messages between two users via API – retrieve pending chats, track new activity, and sync conversation states in real-time.

Endpoint

Method:

  • POST / GET

Parameter:

Parameter name Required Type Explain
api_key_token Yes string Your API key
to Yes integer A UserID for messages will be listed (UserA)
from Yes integer A UserID with to is talking (UserB)
markallread No integer 1 if you wanted to mark all messages as read
Example Response
{
    "merchant": "Open Source Social Network",
    "url": "http:\/\/www.mywebsite.com\/",
    "time_token": 1569337647,
    "payload": {
        "list": [
            {
                "data": {},
                "id": "30",
                "message_from": {
                    "guid": "1",
                    "fullname": "System Administrator",
                    "username": "administrator",
                    "icon": {
                        "small": "http:\/\/www.mywebsite.com\/avatar\/administrator\/small\/ddfbc9f412fca49cd89c8592b6500269.jpeg"
                    }
                },
                "message_to": {
                    "guid": "27",
                    "fullname": "Meagan McLaughlin",
                    "username": "zKutch",
                    "icon": {
                        "small": "http:\/\/www.mywebsite.com\/avatar\/zKutch\/small\/8715c874616ebf0391af044f974b554e.jpeg"
                    }
                },
                "message": "Unread Message",
                "viewed": "false",
                "time": "1569063785"
            },
		}
	],
    "withuser": {
            "guid": "27",
            "fullname": "Meagan McLaughlin",
            "username": "zKutch",
            "icon": {
                "small": "http:\/\/local.opensource-socialnetwork.org\/avatar\/zKutch\/small\/8715c874616ebf0391af044f974b554e.jpeg"
            }
     },
    "code": "100",
    "message": "Request successfully executed"
}

Return payload parameter description

Parameter name Explain
list Contains all messages or it will contain false
withuser A user details with which to is talking

Services View All