Object Structure - nonduality345/Convos GitHub Wiki

Object Structure

There are two major types of objects that are returned by the API. One is a Convo object and the other is a Message Object. Details for each object are below.

Convo Object

Convo objects hold all of the relevant information for a specific Convo.

Field Name Field Type Description Notes
Creator long The Id of the user who created this Convo This Id references the user_id of the user
DateCreated DateTime The date this Convo was created
DateOfLastMessage DateTime? The date at which the last message in the convo was added This field is nullable and is a helper field for clients to identify which Convos have new messages in them
DateUpdated DateTime The date this Convo was updated
Id long The Id of this Convo
NumMessages int The number of messages that are in this Convo
Participant long The other user who is participating in this Convo This Id references the user_id of the user
Subject string The subject of the Convo

Sample Object:

{
    "Creator": 1,
    "DateCreated": "2015-06-14T22:51:20.703",
    "DateOfLastMessage": "2015-06-14T22:51:20.703",
    "DateUpdated": "2015-06-14T22:51:20.703",
    "Id": 46,
    "NumMessages": 5,
    "Participant": 2,
    "Subject": "Sample Subject"
}

Message Object

Message objects hold all of the relevant information for a specific Message within a Convo.

Field Name Field Type Description Notes
Body string The body of the message
ConvoId long The Convo to which this message belongs
DateCreated DateTime The date this message was created
DateUpdated DateTime The date this message was updated
Id long The Id of the message
IsRead bool A boolean flag indicating whether or not this message was read
Parent long? The Id of the message that this message is in reply to This field may be null if this is the first message of the Convo, for example
Recipient long The id of the recipient
Thread List<Message> A list of messages that represents replies to this message This field is only present when requesting a specific Message. Calls to multiple messages will not display the field. This is meant to help clients display the hierarchy of Messages (when replying to a Message, for example)
Sender long The id of the sender

Sample Object:

{
    "Body":"Sample Body",
    "ConvoId":2,
    "DateCreated":"2015-06-13T02:13:43.983",
    "DateUpdated":"2015-06-13T02:57:27.17",
    "Id":14,
    "IsRead":true,
    "Parent":13,
    "Recipient":2,
    "Thread":
        [
            {
                "Body":"Sample Body",
                "ConvoId":2,
                "DateCreated":"2015-06-13T01:56:07.973",
                "DateUpdated":"2015-06-13T01:56:07.973",
                "Id":13,
                "IsRead":true,
                "Parent":12,
                "Recipient":2,
                "Thread":
                    [
                        {
                            "Body":"Sample Body",
                            "ConvoId":2,
                            "DateCreated":"2015-06-13T01:50:57.48",
                            "DateUpdated":"2015-06-13T01:50:57.48",
                            "Id":12,
                            "IsRead":true,
                            "Parent":11,
                            "Recipient":2,
                            "Sender":1
                        }
                    ],
                "Sender":1
            }
        ],
    "Sender":1
}
⚠️ **GitHub.com Fallback** ⚠️