Messages API

Get conversation messages

OVERVIEW

Method to obtain message conversation

This method is supported in version 4 of the API and above

Request URI

GET         /api/4/conversations/{conversationid}/messages

 

Parameter Name Value Description
conversationid int Conversation ID

 

Response

The response will contain a collection of Messages

Conversation Common Object with multiple conversations under 'conversations' tag


Response codes

 

CODE MEANING
    201    Comments returned successfully
    400    Problem with parameters
    401     Unauthorized
    403    Validation failed | Forbidden
    500    Internal error occurred while returning comments

 

In case of an error code other than 201, an error object will be returned in the format 

Error Response

<error>
     <ref>{integer reference id, generated on the server side} </ref>
     <summary>{Description for the error message}</summary>
</error>

 

Response body sample

XML form

<conversation>
    <recipients>
        <users>
            <user>
                 <name>
                     <firstname>{first name}</firstname>
                     <lastname>{last name}</lastname>
                 </name>
            </user>
            <user>
                 <name>
                     <firstname>{first name}</firstname>
                     <lastname>{last name}</lastname>
                 </name>
            </user>
        </users>
    </recipients>
    <messages>
            <message>
                <messageid></messageid>
                <recipients>
                    <users>
                        <user>
                           <httpavatar></httpavatar>
                           <avatar></avatar>
                        </user>
                    </users>
                </recipients>
                <text></text>
                <html><![CDATA[]]> </html>
                <lastsentdatetime></lastsentdatetime>
                <images>
                    <image>
                        <imagelink></imagelink>
                        <apilink></apilink>
                    </image>
                </images>
                <attachments>
                    <attachment>
                        <id></id>
                        <name></name>
                        <extension></extension>
                        <siteid></siteid>
                        <parentfolderid></parentfolderid>
                        <filesize></filesize>
                    </attachment>
                </attachments>
            </message>
            <message>
                <messageid></messageid>
                <recipients>
                    <users>
                        <user>
                           <httpavatar></httpavatar>
                           <avatar></avatar>
                        </user>
                    </users>
                </recipients>
                <text></text>
                <html><![CDATA[]]> </html>
                <lastsentdatetime></lastsentdatetime>
                <images>
                    <image>
                        <imagelink></imagelink>
                        <apilink></apilink>
                    </image>
                </images>
                <attachments>
                    <attachment>
                        <id></id>
                        <name></name>
                        <extension></extension>
                        <siteid></siteid>
                        <parentfolderid></parentfolderid>
                        <filesize></filesize>
                    </attachment>
                </attachments>
            </message>
    </messages>    
</conversation>

JSON form

{
   "recipients": {
      "users": [
         {
            "name": {
               "firstname": "{first name}",
               "lastname": "{last name}"
            }
         },
         {
            "name": {
               "firstname": "{first name}",
               "lastname": "{last name}"
            }
         }
      ]
   },
   "messages": [
      {
         "messageid": [],
         "recipients": {
            "users": {
               "user": {
                  "httpavatar": [],
                  "avatar": []
               }
            }
         },
         "text": [],
         "html": [],
         "lastsentdatetime": [],
         "images": {
            "image": {
               "imagelink": [],
               "apilink": []
            }
         },
         "attachments": {
            "attachment": {
               "id": [],
               "name": [],
               "extension": [],
               "siteid": [],
               "parentfolderid": [],
               "filesize": []
            }
         }
      },
      {
         "messageid": [],
         "recipients": {
            "users": {
               "user": {
                  "httpavatar": [],
                  "avatar": []
               }
            }
         },
         "text": [],
         "html": [],
         "lastsentdatetime": [],
         "images": {
            "image": {
               "imagelink": [],
               "apilink": []
            }
         },
         "attachments": {
            "attachment": {
               "id": [],
               "name": [],
               "extension": [],
               "siteid": [],
               "parentfolderid": [],
               "filesize": []
            }
         }
      }
   ]
}

 

 

Comments


0 Comments

Last Updated: Nov 08,2024