Newer Version Available

This content describes an older version of this product. View Latest

User Messages, General

Returns all the messages for all the private conversations for the logged-in user. Also used to search across all messages and post a message. See Using POST, PATCH, or PUT for Input. See also User Conversations, General.

Resource
1/chatter/users/me/messages
or
1/chatter/users/userId/messages

userId must be the ID of the logged-in user or the alias me.

Note

Available since version
23.0
HTTP methods
GET, HEAD, POST
Request body for POST
Root XML tag
<message>
Properties
Name Type Description Available Version
body String Text of the message body 23.0
inReplyTo String ID of an existing message that identifies which conversation this message is part of.You must specify either recipients or inReplyTo. You must specify one or the other, not both. 23.0
recipients User Message Recipient List Input List of users who are the intended message recipients, up to 9. Comma-separated list of user IDs.You must specify either recipients or inReplyTo. You must specify one or the other, not both. 23.0
Example XML format:
1swfobject.registerObject("clippy.codeblock-2", "9");<message>
2   <body>Text of the message</body>
3   <recipients>
4      <recipient>userID</recipient>
5      <recipient>userID</recipient>
6   </recipients>
7   <inReplyTo>messageID</inReplyTo>
8</message>
9
Example JSON format:
1swfobject.registerObject("clippy.codeblock-3", "9");{
2   "body": "Text of the message",
3   "recipients": ["userID","userID"],
4   "inReplyTo": "messageID"
5}
6
Request parameters for POST
Parameter Name Type Required or Optional Description Available Version
inReplyTo String You must specify either recipients or inReplyTo. You cannot specify both. ID of an existing message that identifies which conversation this message is part of 23.0
recipients String You must specify either recipients or inReplyTo. You cannot specify both. List of users who are the intended message recipients, up to 9. Comma-separated list of user IDs. 23.0
text String Required The text of the message, up to 10,000 characters 23.0
Request parameters for GET
Parameter Name Type Required or Optional Description Available Version
page String Optional A page token that indicates where retrieval begins. Get this token from the NextPageUrl property in the response body. 23.0
pageSize Integer Optional Specifies the number of items per page. Valid values are between 1 and 100. If you don't specify a size, the default is 25. 23.0
q String Optional Specifies the string to search. The search string must contain at least two characters, not including any wildcards. For more information about wildcards, see Wildcards. This parameter is optional.

The query parameter only searches message text bodies, not user names, titles, and so on.

Note

24.0
Response body for GET or HEAD
Message Collection
Response body for POST
Message
Example response body for GET or HEAD
1{
2   "currentPageUrl": "/services/data/v30.0/chatter/users/me/messages",
3   "messages": [
4      {
5         "body": {
6            "messageSegments": [],
7            "text": "Will you be able to meet about your Dreamforce presentation this week?"
8         },
9         "conversationId": "03MD000000002LTMAY",
10         "conversationUrl": "/services/data/v30.0/chatter/users/me/conversations/03MD000000002LTMAY",
11         "id": "03JD000000003XGMAY",
12         "recipients": [
13            {
14               "companyName": "SeattleApps",
15               "firstName": "Rene",
16               "id": "005D0000001LFNnIAO",
17               "isActive": true,
18               "lastName": "Holmes",
19               "motif": {
20                  "color": "1797C0",
21                  "largeIconUrl": "/img/icon/profile64.png",
22                  "mediumIconUrl": "/img/icon/profile32.png",
23                  "smallIconUrl": "/img/icon/profile16.png"
24               },
25               "mySubscription": null,
26               "name": "Rene Holmes",
27               "photo": {
28                  "fullEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",
29                  "largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",
30                  "photoVersionId": "729D00000000XA5",
31                  "smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",
32                  "standardEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",
33                  "url": "/services/data/v30.0/chatter/users/005D0000001LLO6IAO/photo"
34               },
35               "title": "Senior Manager",
36               "type": "User",
37               "url": "/services/data/v30.0/chatter/users/005D0000001LFNnIAO",
38               "userType": "Internal"
39            },
40            {
41               "companyName": null,
42               "firstName": "Desmond",
43               "id": "005D0000001LJvOIAW",
44               "isActive": true,
45               "lastName": "Catillo",
46               "motif": {
47                  "color": "1797C0",
48                  "largeIconUrl": "/img/icon/profile64.png",
49                  "mediumIconUrl": "/img/icon/profile32.png",
50                  "smallIconUrl": "/img/icon/profile16.png"
51               },
52               "mySubscription": null,
53               "name": "Desmond Catillo",
54               "photo": {
55                  
56                  "fullEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",
57                  "largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",
58                  "photoVersionId": "729D00000000XA5",
59                  "smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",
60                  "standardEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",
61                  "url": "/services/data/v30.0/chatter/users/005D0000001LLO1IAO/photo"
62               },
63               "title": "Senior Manager",
64               "type": "User",
65               "url": "/services/data/v30.0/chatter/users/005D0000001LJvOIAW",
66               "userType": "Internal"
67            }
68         ],
69         "sender": {
70            "companyName": "SeattleApps",
71            "firstName": "Rene",
72            "id": "005D0000001LFNnIAO",
73            "isActive": true,
74            "lastName": "Holmes",
75            "motif": {
76               "color": "1797C0",
77               "largeIconUrl": "/img/icon/profile64.png",
78               "mediumIconUrl": "/img/icon/profile32.png",
79               "smallIconUrl": "/img/icon/profile16.png"
80            },
81            "mySubscription": null,
82            "name": "Rene Holmes",
83            "photo": {
84               "fullEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",               "largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",
85               "photoVersionId": "729D00000000XA5",
86               "smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",
87               "standardEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",
88               "url": "/services/data/v30.0/chatter/users/005D0000001LLO6IAO/photo"
89            },
90            "title": "Senior Manager",
91            "type": "User",
92            "url": "/services/data/v30.0/chatter/users/005D0000001LFNnIAO",
93            "userType": "Internal"
94         },
95         "sentDate": "2012-07-20T21:27:07.000Z",
96         "url": "/services/data/v30.0/chatter/users/me/messages/03JD000000003XGMAY"
97      },
98      {
99         "body": {
100            "messageSegments": [],
101            "text": "Rene Holmes has shared Recruitment Poster.png with you on Chatter.\n\nPlease review.\n\nTo view the file, go to: https://na1-blitz01.soma.salesforce.com/069D00000001E32"
102         },
103         "conversationId": "03MD000000002LTMAY",
104         "conversationUrl": "/services/data/v30.0/chatter/users/me/conversations/03MD000000002LTMAY",
105         "id": "03JD000000003VAMAY",
106         "recipients": [
107            {
108               "companyName": "SeattleApps",
109               "firstName": "Rene",
110               "id": "005D0000001LFNnIAO",
111               "isActive": true,
112               "lastName": "Holmes",
113               "motif": {
114                  "color": "1797C0",
115                  "largeIconUrl": "/img/icon/profile64.png",
116                  "mediumIconUrl": "/img/icon/profile32.png",
117                  "smallIconUrl": "/img/icon/profile16.png"
118               },
119               "mySubscription": null,
120               "name": "Rene Holmes",
121               "photo": {
122                  "fullEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",
123                  "largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",
124                  "photoVersionId": "729D00000000XA5",
125                  "smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",
126                  "standardEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",
127                  "url": "/services/data/v30.0/chatter/users/005D0000001LLO6IAO/photo" 
128               },
129               "title": "Senior Manager",
130               "type": "User",
131               "url": "/services/data/v30.0/chatter/users/005D0000001LFNnIAO",
132               "userType": "Internal"
133            },
134            {
135               "companyName": null,
136               "firstName": "Desmond",
137               "id": "005D0000001LJvOIAW",
138               "isActive": true,
139               "lastName": "Catillo",
140               "motif": {
141                  "color": "1797C0",
142                  "largeIconUrl": "/img/icon/profile64.png",
143                  "mediumIconUrl": "/img/icon/profile32.png",
144                  "smallIconUrl": "/img/icon/profile16.png"
145               },
146               "mySubscription": null,
147               "name": "Desmond Catillo",
148               "photo": {
149                  "fullEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",
150                  "largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",
151                  "photoVersionId": "729D00000000XA5",
152                  "smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",
153                  "standardEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",
154                  "url": "/services/data/v30.0/chatter/users/005D0000001LLO1IAO/photo"
155               },
156               "title": "Senior Manager",
157               "type": "User",
158               "url": "/services/data/v30.0/chatter/users/005D0000001LJvOIAW",
159               "userType": "Internal"
160            }
161         ],
162         "sender": {
163            "companyName": "SeattleApps",
164            "firstName": "Rene",
165            "id": "005D0000001LFNnIAO",
166            "isActive": true,
167            "lastName": "Holmes",
168            "motif": {
169               "color": "1797C0",
170               "largeIconUrl": "/img/icon/profile64.png",
171               "mediumIconUrl": "/img/icon/profile32.png",
172               "smallIconUrl": "/img/icon/profile16.png"
173            },
174            "mySubscription": null,
175            "name": "Rene Holmes",
176            "photo": {
177               "fullEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",
178               "largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",
179               "photoVersionId": "729D00000000XA5",
180               "smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",
181               "standardEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",
182               "url": "/services/data/v30.0/chatter/users/005D0000001LLO6IAO/photo"
183            },
184            "title": "Senior Manager",
185            "type": "User",
186            "url": "/services/data/v30.0/chatter/users/005D0000001LFNnIAO",
187            "userType": "Internal"
188         },
189         "sentDate": "2012-07-18T19:01:51.000Z",
190         "url": "/services/data/v30.0/chatter/users/me/messages/03JD000000003VAMAY"
191      },
192   "nextPageUrl": null
193}