30.03.2014 Views

Database.com Chatter REST API Developer's Guide - Salesforce.com

Database.com Chatter REST API Developer's Guide - Salesforce.com

Database.com Chatter REST API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Version 27.0: Spring ’13<br />

<strong>Database</strong>.<strong>com</strong> <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> <strong>Developer's</strong><br />

<strong>Guide</strong><br />

Last updated: May 3, 2013<br />

© Copyright 2000–2013 salesforce.<strong>com</strong>, inc. All rights reserved. <strong>Salesforce</strong>.<strong>com</strong> is a registered trademark of salesforce.<strong>com</strong>, inc., as are other<br />

names and marks. Other marks appearing herein may be trademarks of their respective owners.


Table of Contents<br />

Table of Contents<br />

<strong>Chatter</strong> <strong>API</strong>.........................................................................................................................................1<br />

Chapter 1: Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>..................................................................................1<br />

Deciding When to Use <strong>Chatter</strong> <strong>API</strong>.............................................................................................................................2<br />

Understanding <strong>Chatter</strong> <strong>API</strong> Resources.........................................................................................................................2<br />

Building the <strong>Chatter</strong> <strong>API</strong> Resource URL.........................................................................................................7<br />

Using <strong>Chatter</strong> <strong>API</strong> Inputs.................................................................................................................................8<br />

Using Wildcards..............................................................................................................................................12<br />

Send HTTP Requests with cURL..............................................................................................................................13<br />

Understanding OAuth and <strong>Chatter</strong> <strong>API</strong>.....................................................................................................................13<br />

Understanding the Web Server OAuth Authentication Flow.........................................................................15<br />

Understanding the User-Agent OAuth Authentication Flow.........................................................................19<br />

Using Tokens...................................................................................................................................................21<br />

Requesting Static Assets and Posting Forms Directly from HTML...............................................................22<br />

Chapter 2: Quick Start...............................................................................................................24<br />

Prerequisites.................................................................................................................................................................25<br />

Step One: Set Up Authorization.................................................................................................................................25<br />

Step Two: Connect to <strong>Chatter</strong> <strong>API</strong> Using OAuth.....................................................................................................26<br />

Chapter 3: <strong>Chatter</strong> <strong>API</strong>: How do I. . ..........................................................................................28<br />

Chapter 4: <strong>Chatter</strong> <strong>API</strong> Resources..............................................................................................40<br />

<strong>Chatter</strong> <strong>API</strong> Resources Relationships.........................................................................................................................44<br />

Bookmarks Resources..................................................................................................................................................47<br />

<strong>Chatter</strong> Resource.........................................................................................................................................................52<br />

Comments Resources..................................................................................................................................................53<br />

Company Feed Resources............................................................................................................................................56<br />

Connect Resources......................................................................................................................................................58<br />

Favorites Feed Resources.............................................................................................................................................60<br />

Feeds Resource............................................................................................................................................................65<br />

Feed-Items Resources..................................................................................................................................................67<br />

Feed-Items Query............................................................................................................................................68<br />

Feed-Items, Specific Feed Item.......................................................................................................................69<br />

Feed-Items Comments....................................................................................................................................73<br />

Feed-Items Likes.............................................................................................................................................77<br />

Feed-Items Polls..............................................................................................................................................78<br />

Files Resources............................................................................................................................................................79<br />

Files Feed Resources....................................................................................................................................................86<br />

Filter Feed Resources..................................................................................................................................................90<br />

Groups Feed Resources...............................................................................................................................................94<br />

Group-Memberships Resources..................................................................................................................................97<br />

i


Table of Contents<br />

Groups Resources......................................................................................................................................................101<br />

List of Groups................................................................................................................................................101<br />

Group Information........................................................................................................................................103<br />

Batch Group Information..............................................................................................................................105<br />

Group Files....................................................................................................................................................105<br />

Group Members............................................................................................................................................107<br />

Group Members—Private.............................................................................................................................110<br />

Group Membership Requests—Private.........................................................................................................113<br />

Group Photo..................................................................................................................................................114<br />

Group Settings...............................................................................................................................................116<br />

Influence Resource.....................................................................................................................................................117<br />

Likes Resource...........................................................................................................................................................118<br />

Motifs Resources.......................................................................................................................................................119<br />

News Feed Resources................................................................................................................................................120<br />

People Feed Resources..............................................................................................................................................134<br />

Record Feed Resource...............................................................................................................................................138<br />

Records Resources.....................................................................................................................................................154<br />

Subscriptions Resource..............................................................................................................................................156<br />

To Feed Resources....................................................................................................................................................157<br />

Topics Resource.........................................................................................................................................................160<br />

User-Profile Feed Resources......................................................................................................................................161<br />

Users Resources.........................................................................................................................................................170<br />

User Information...........................................................................................................................................172<br />

User Profile Information................................................................................................................................173<br />

Batch User Information.................................................................................................................................174<br />

User Conversations, General.........................................................................................................................174<br />

User Conversations, Specific..........................................................................................................................176<br />

Change Status of Conversations....................................................................................................................177<br />

Get Unread Count for Conversations............................................................................................................178<br />

Users Files, General.......................................................................................................................................178<br />

User Files, Filtered by Group........................................................................................................................181<br />

User Files, Filtered by Sharing.......................................................................................................................182<br />

User Followers...............................................................................................................................................183<br />

Following Users.............................................................................................................................................184<br />

User Groups...................................................................................................................................................186<br />

User Messages, General.................................................................................................................................186<br />

User Messages, Specific.................................................................................................................................192<br />

User Photo.....................................................................................................................................................193<br />

User Re<strong>com</strong>mendations, General..................................................................................................................194<br />

User Re<strong>com</strong>mendations for a Specific Action...............................................................................................197<br />

User Re<strong>com</strong>mendations for a Specific Action and Object Category.............................................................197<br />

User Re<strong>com</strong>mendations for a Specific Action and Key Prefix.......................................................................199<br />

User Re<strong>com</strong>mendations for a Specific Action and Object ID.......................................................................200<br />

User Settings..................................................................................................................................................201<br />

User Status.....................................................................................................................................................203<br />

ii


Table of Contents<br />

Chapter 5: <strong>Chatter</strong> <strong>API</strong> Request Bodies....................................................................................205<br />

Chapter 6: <strong>Chatter</strong> <strong>API</strong> Resource Returns................................................................................219<br />

Response Bodies........................................................................................................................................................219<br />

Response Body Filters...............................................................................................................................................258<br />

Response Body Encoding..........................................................................................................................................262<br />

Status Codes and Error Responses............................................................................................................................263<br />

Connect in Apex...............................................................................................................................265<br />

Chapter 7: Getting Started with Connect in Apex......................................................................265<br />

When Should You Use Apex?...................................................................................................................................266<br />

Understanding Connect in Apex...............................................................................................................................266<br />

Primary Differences Between <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> and Connect in Apex.................................................................267<br />

Testing Connect in Apex...........................................................................................................................................271<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods .........................................................................................272<br />

Chapter 8: Connect in Apex <strong>API</strong> Reference..............................................................................280<br />

<strong>Chatter</strong> Class.............................................................................................................................................................281<br />

<strong>Chatter</strong>Favorites Class...............................................................................................................................................282<br />

<strong>Chatter</strong>Feeds Class....................................................................................................................................................284<br />

<strong>Chatter</strong>Groups Class.................................................................................................................................................308<br />

<strong>Chatter</strong>Users Class....................................................................................................................................................314<br />

Records Class.............................................................................................................................................................322<br />

Input Classes.............................................................................................................................................................322<br />

Output Classes...........................................................................................................................................................326<br />

Enums ......................................................................................................................................................................351<br />

Exceptions.................................................................................................................................................................354<br />

Index...............................................................................................................................................355<br />

iii


Table of Contents<br />

iv


CHATTER <strong>API</strong><br />

Chapter 1<br />

Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

In this chapter ...<br />

<strong>Chatter</strong> <strong>API</strong> is a <strong>REST</strong> <strong>API</strong> that provides programmatic access to <strong>Chatter</strong> feeds<br />

and social data such as users, groups, followers, and files. It's used by developers<br />

• Deciding When to Use <strong>Chatter</strong> <strong>API</strong> who want to integrate <strong>Chatter</strong> into a variety of applications such as mobile<br />

•<br />

•<br />

Understanding <strong>Chatter</strong> <strong>API</strong><br />

Resources<br />

Send HTTP Requests with cURL<br />

applications, intranet sites, and third-party Web applications. <strong>Chatter</strong> <strong>API</strong> is<br />

similar to <strong>API</strong>s offered by other <strong>com</strong>panies with feeds, such as Facebook and<br />

Twitter. Its advantages include ease of integration and development.<br />

• Understanding OAuth and <strong>Chatter</strong><br />

<strong>API</strong><br />

Note: <strong>Chatter</strong> <strong>API</strong> and <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> refer to the same <strong>API</strong>.<br />

To use this documentation, you should have a basic familiarity with software<br />

development, Web services, OAuth, and <strong>Chatter</strong>.<br />

The following sections include:<br />

• The key characteristics and architecture of <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>. This will<br />

help you understand how your applications can best use <strong>Chatter</strong> <strong>API</strong> resources.<br />

• How to set up your development environment so you can start working with<br />

<strong>Chatter</strong> <strong>API</strong>.<br />

• How to configure OAuth for your client application.<br />

• A tutorial that leads you step by step through a typical use case.<br />

1


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Deciding When to Use <strong>Chatter</strong> <strong>API</strong><br />

Deciding When to Use <strong>Chatter</strong> <strong>API</strong><br />

Use <strong>Chatter</strong> <strong>API</strong> to:<br />

• Build a mobile client that displays a <strong>Chatter</strong> feed.<br />

• Integrate a third-party Web application with <strong>Chatter</strong> so it can notify groups of users about events.<br />

• Display the <strong>Chatter</strong> feed on an external system, such as an intranet site, after users are authenticated.<br />

• Make feeds actionable and integrated with third-party sites. For example, an app that posts a <strong>Chatter</strong> item to Twitter<br />

whenever the post includes #tweet hashtag.<br />

• Create simple games that interact with the feed for notifications. Games might include things like sales incentive<br />

<strong>com</strong>petitions.<br />

• Creating a custom, branded skin for <strong>Chatter</strong> for your organization.<br />

How is <strong>Chatter</strong> <strong>API</strong> Different from other <strong>API</strong>s?<br />

<strong>Chatter</strong> <strong>API</strong> <strong>com</strong>plements the SOAP <strong>API</strong> by making it easy to interact with <strong>Chatter</strong> data, such as feeds, group information,<br />

and <strong>Chatter</strong> user-profile details.<br />

The following are some of the differences between <strong>Chatter</strong> <strong>API</strong> and the SOAP <strong>API</strong>:<br />

• Returned information is automatically localized to the user's time zone and language.<br />

• Feed items are structured in a way that makes it easy to render on Web sites and mobile devices.<br />

• Changed values that are tracked in a feed are returned as value-pair representations.<br />

• Relationships between objects can easily be traversed without having to resolve foreign keys. For example, using <strong>Chatter</strong><br />

<strong>API</strong> you can get all of a user's followers or groups with one request per page.<br />

Selecting the Right <strong>API</strong> for Your Application<br />

<strong>Database</strong>.<strong>com</strong> provides many types of <strong>API</strong>s for various use cases, including both SOAP <strong>API</strong> and <strong>REST</strong> <strong>API</strong>. These <strong>API</strong>s<br />

provide access to the majority of <strong>Database</strong>.<strong>com</strong> data, including most of the <strong>Chatter</strong> data.<br />

So when should you use which <strong>API</strong>?<br />

Situations where you would want to use SOAP <strong>API</strong> or <strong>REST</strong> <strong>API</strong> include:<br />

• Migrating or synchronizing user profiles and their associated user photos from one system to another.<br />

• Creating analytic applications for <strong>Chatter</strong>.<br />

• Queries where you want to select specifically which records or fields are returned.<br />

SOAP <strong>API</strong> and <strong>REST</strong> <strong>API</strong>’s rate limiting and powerful query language more suited to these use cases and contains most of<br />

the applicable <strong>Chatter</strong> data.<br />

However, <strong>Chatter</strong> <strong>API</strong> is the only <strong>API</strong> that supports some of <strong>Chatter</strong>’s more <strong>com</strong>plex data structures, for example posting<br />

photos or using @mention rich text in feed items. If necessary, you can use SOAP <strong>API</strong> or <strong>REST</strong> <strong>API</strong> for the bulk of your<br />

queries, then use the feed item or <strong>com</strong>ment Ids you’ve extracted to selectively work with <strong>Chatter</strong> <strong>API</strong>.<br />

Understanding <strong>Chatter</strong> <strong>API</strong> Resources<br />

In general, the process flow for using <strong>Chatter</strong> <strong>API</strong> is as follows:<br />

1. Send an HTTP request to <strong>Database</strong>.<strong>com</strong>.<br />

2


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding <strong>Chatter</strong> <strong>API</strong> Resources<br />

2. The system authenticates the user and client app.<br />

3. Request <strong>Chatter</strong> <strong>API</strong> resources using an HTTP request.<br />

4. The system returns an HTTP return code. Additional information (such as a <strong>Chatter</strong> <strong>API</strong> response body) is optionally<br />

included in the response.<br />

Each resource in <strong>Chatter</strong> <strong>API</strong> is a URI used with an HTTP method (such as GET, POST, DELETE, or HEAD). Each<br />

resource represents something in <strong>Chatter</strong>, such as a user's news feed, or the <strong>com</strong>ments on a post.<br />

Many of the resources use either a specified userId or the keyword me to indicate the current, logged-in user. For example, to<br />

return the user-profile information for the current, logged-in user, use the following resource:<br />

/chatter/users/me<br />

You could also specify a particular user by user Id:<br />

/chatter/users/005D0000001GLoh<br />

When you successfully access a resource, a response body is returned in JSON or XML. By default, JSON is returned. Each<br />

response body may contain one or more response bodies. For example, the following is the response body of the above resource<br />

(users). Note that it includes other response bodies as well, such as address, current status, and phone numbers:<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

aboutMe<br />

String<br />

Text from user's profile<br />

23.0<br />

address<br />

Address<br />

Address<br />

23.0<br />

chatterActivity<br />

<strong>Chatter</strong> Activity<br />

<strong>Chatter</strong> activity statistics<br />

23.0<br />

chatterInfluence<br />

<strong>Chatter</strong> Influence<br />

User’s influence rank<br />

23.0<br />

<strong>com</strong>panyName<br />

String<br />

Company name<br />

23.0<br />

currentStatus<br />

User Status<br />

Note: This property is no longer available<br />

as of version 25.0.<br />

23.0–25.0<br />

User's current status<br />

email<br />

String<br />

User's email address<br />

23.0<br />

firstName<br />

String<br />

User's first name<br />

23.0<br />

followersCount<br />

Integer<br />

Number of users following this user<br />

23.0<br />

followingCounts<br />

Following Counts<br />

Information about items the user is following<br />

23.0<br />

groupCount<br />

Integer<br />

Number of groups user is following<br />

23.0<br />

id<br />

String<br />

18-character Id of the user<br />

23.0<br />

isActive<br />

Boolean<br />

true if user is active, false otherwise<br />

23.0<br />

is<strong>Chatter</strong>Guest<br />

Boolean<br />

Note: This property is no longer available<br />

as of version 26.0. Use the userType<br />

property instead.<br />

23.0–25.0<br />

3


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding <strong>Chatter</strong> <strong>API</strong> Resources<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

true if user is a <strong>Chatter</strong> customer, false otherwise<br />

lastName<br />

String<br />

User's last name<br />

23.0<br />

managerId<br />

String<br />

18-character Id of the user’s manager<br />

23.0<br />

managerName<br />

String<br />

Locale-based concatenation of manager's first and<br />

last names<br />

23.0<br />

motif<br />

Motif<br />

Small, medium, and large icons indicating that the<br />

object is a user:<br />

27.0<br />

"motif": {<br />

"largeIconUrl":<br />

"/img/icon/profile64.png",<br />

"mediumIconUrl":<br />

"/img/icon/profile32.png",<br />

"smallIconUrl":<br />

"/img/icon/profile16.png"<br />

}<br />

The motif icon is not the user’s profile picture.<br />

mySubscription<br />

Reference<br />

If the logged-in user is following this user, this<br />

contains information about the subscription, else<br />

returns null<br />

23.0<br />

name<br />

String<br />

Locale-based concatenation of user's first and last<br />

names<br />

23.0<br />

phoneNumbers<br />

Phone Number[]<br />

Collection of user's phone numbers<br />

23.0<br />

photo<br />

Photo<br />

Information about the user's photos<br />

23.0<br />

title<br />

String<br />

Title of the user<br />

23.0<br />

type<br />

String<br />

User<br />

23.0<br />

url<br />

String<br />

URL to the user's profile<br />

23.0<br />

username<br />

String<br />

User name of the user, such as<br />

Admin@my<strong>com</strong>pany.<strong>com</strong>.<br />

24.0<br />

userType<br />

String<br />

Type of user. Values are:<br />

• <strong>Chatter</strong>Guest—User is a <strong>Chatter</strong> customer in<br />

an external group<br />

• Guest—Unauthenticated users<br />

• Internal—User is a standard organization<br />

member<br />

• Portal—User is a Customer Portal User, a<br />

<strong>com</strong>munities user, and so on.<br />

• System—User is <strong>Chatter</strong> Expert or a system<br />

user<br />

26.0<br />

4


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding <strong>Chatter</strong> <strong>API</strong> Resources<br />

In JSON format, the output is as follows:<br />

{<br />

"aboutMe": "I&#39;m excited to be part of the team focused on building out our apps<br />

business<br />

and showing our customers their future.",<br />

"address": {<br />

"city": "Seattle",<br />

"country": "US",<br />

"state": "WA",<br />

"street": "2001 8th Ave",<br />

"zip": "98121"<br />

"formattedAdress": "2001 8th Ave\nSeattle, WA 98121\nUS"<br />

},<br />

"chatterActivity": {<br />

"<strong>com</strong>mentCount": 0,<br />

"<strong>com</strong>mentReceivedCount": 1,<br />

"likeReceivedCount": 0,<br />

"postCount": 2<br />

},<br />

"<strong>com</strong>panyName": "Seattle Apps",<br />

"email": "mraven@seattleapps.<strong>com</strong>",<br />

"firstName": "Marion",<br />

"followersCount": 1,<br />

"followingCounts": {<br />

"people": 5,<br />

"records": 0,<br />

"total": 5<br />

},<br />

"groupCount": 3,<br />

"id": "005D0000001Kl6xIAC",<br />

"isActive": true,<br />

"lastName": "Raven",<br />

"managerId": null,<br />

"managerName": null,<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Marion Raven",<br />

"phoneNumbers": [{<br />

"number": "(206) 999-2846",<br />

"type": "Work"<br />

}],<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1i9x6Z16L8wXEGigpcWjAd",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1q43x_rW2ciXBHst0Eh3Y6",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001Kl6xIAC",<br />

"userType": "Internal";<br />

"username": "mraven@seattleapps.<strong>com</strong>"<br />

5


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding <strong>Chatter</strong> <strong>API</strong> Resources<br />

Note: <strong>Database</strong>.<strong>com</strong> runs on multiple server instances. The examples in this guide use instance_name to indicate<br />

the instance. The instance for your organization may be similar to na3.database.<strong>com</strong> or na6.my<strong>com</strong>pany.<strong>com</strong>.<br />

Some of the items in a response body have a fully qualified URL, however, most of the returned URLs are relative.<br />

If the URL is relative, prepend it with the instance given to the client app when the item is authenticated.<br />

The following are important characteristics of <strong>Chatter</strong> <strong>API</strong> resources and architecture:<br />

Stateless<br />

Each request from client to server must contain all the information necessary to understand the request, and not use any<br />

stored context on the server. However, the representations of the resources are interconnected using URLs, which allow<br />

the client to progress between states.<br />

Uniform interface<br />

All resources are accessed with a generic interface over HTTP.<br />

Authentication<br />

<strong>Chatter</strong> <strong>API</strong> uses OAuth 2.0.<br />

Support for JSON and XML<br />

The JavaScript Object Notation (JSON) format is supported with UTF-8. Date-time information is in ISO8601 format.<br />

XML serialization is similar to SOAP <strong>API</strong>. XML requests are supported in UTF-8 and UTF-16, and XML responses<br />

are provided in UTF-8.<br />

Responses are in JSON format by default. To specify XML, use the HTTP header Accept: application/xml.<br />

(To specify JSON, use Accept: application/json.)<br />

You can append either .json or .xml to the URI of any resource to specify how the return is formatted. For example,<br />

/chatter/feeds/filter/me/001/feed-items.xml.<br />

Support for Method Overriding<br />

If you use an HTTP library that doesn’t allow overriding or setting an arbitrary HTTP method name, you can send a<br />

POST request and provide an override to the HTTP method with the request parameter _HttpMethod. For example:<br />

https://instance_name/services/data/v27.0/chatter/<br />

/chatter/users/me/conversations/03MD0000000008KMAQ<br />

?_HttpMethod=PATCH&read=true<br />

Note: The _HttpMethod parameter is case sensitive. Be sure to use the correct case for all values.<br />

Localized names and times<br />

<strong>Chatter</strong> <strong>API</strong> localizes both the names and datetimes to the language and time zone settings of the current user. This<br />

means mobile devices don't need their own language or time zone settings. Users set their locale in their personal<br />

information.<br />

<strong>Chatter</strong> <strong>API</strong> Request Limits<br />

<strong>Chatter</strong> <strong>API</strong> requests are subject to rate limiting. <strong>Chatter</strong> <strong>API</strong> has a per user, per application, per hour rate limit. When<br />

you exceed the rate limit, all <strong>Chatter</strong> <strong>API</strong> resources return a 503 Service Unavailable error code for both the user and<br />

6


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Building the <strong>Chatter</strong> <strong>API</strong> Resource URL<br />

application. When polling for feed updates or private messages, use the /feeds/news/me |userId/is-modified<br />

endpoint and do not exceed one poll per minute.<br />

Note: Though the Is-Modified resource is generally available, your organization may not have permission to<br />

use it automatically. If you can’t access this resource, contact your salesforce.<strong>com</strong> representative and ask about<br />

the “Enabled <strong>Chatter</strong> Feed Polling” permission.<br />

If an application uses a regular session ID for authentication instead of an OAuth token, that application's requests count<br />

against a general allocation of requests where there is no associated OAuth consumer key. However, any other application<br />

the user accesses, that is also authenticating with session IDs, is contending for the same allocation of requests . For<br />

example, your app connects a user to <strong>Database</strong>.<strong>com</strong> using a regular session ID. This user now has the same number of<br />

requests regardless of the app they are using. They no longer have a separate request limit per application: all applications<br />

are now using the same limit. Because of this, we re<strong>com</strong>mend clients use OAuth tokens whenever feasible.<br />

Note: Stated limits aren't a promise that the specified resource is available at its limit in all circumstances. For<br />

example, load, performance and other system issues might prevent some limits from being reached. The stated<br />

limit may change without notice. Applications should make efficient use of available requests and gracefully<br />

handle the 503 error code.<br />

Default HTML Entity Encoding<br />

<strong>Chatter</strong> <strong>API</strong> strings are minimally HTML entity encoded by default, which is suitable in most cases for display between<br />

HTML tags, but not necessarily in other HTML contexts.<br />

For non-HTML contexts, such as native mobile applications, <strong>Chatter</strong> <strong>API</strong> clients may request raw (unencoded) output<br />

by setting the X-<strong>Chatter</strong>-Entity-Encoding HTTP header in your request to false.<br />

For more information, see Response Body Encoding on page 262.<br />

Feed Item Templates<br />

Feed item templates make feed items easier to render by defining their layout. The Feed Item Attachment: Basic Template<br />

is currently used for feed items that announce the creation of a group (the CollaborationGroupCreated feed item<br />

type). However, <strong>Salesforce</strong> may reflect other events in the Basic Template in the future.<br />

Building the <strong>Chatter</strong> <strong>API</strong> Resource URL<br />

Note: Communities are available as a pilot program. Contact your salesforce.<strong>com</strong> representative to find out if your<br />

organization qualifies for the <strong>com</strong>munity pilot.<br />

Access all <strong>Chatter</strong> <strong>API</strong> resources by using the URI for your <strong>com</strong>pany's instance, <strong>com</strong>bined with version information, and the<br />

URI for the resource.<br />

For example, building a URL, if your instance is:<br />

https://na1.database.<strong>com</strong>/<br />

And the version information is:<br />

/services/data/v27.0/<br />

7


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Using <strong>Chatter</strong> <strong>API</strong> Inputs<br />

And the resource is :<br />

chatter/feeds/news/me/feed-items<br />

Put together, the full URL is:<br />

https://na1.database.<strong>com</strong>/services/data/v27.0/chatter/<br />

feeds/news/me/feed-items<br />

You can use the internal shortcut even if <strong>com</strong>munities are not enabled. You may want do this if you’re developing an<br />

application for multiple organizations and not all of them use <strong>com</strong>munities.<br />

The response bodies include URLs with /connect/<strong>com</strong>munities/internal. This format enables you to perform string<br />

interpolation when referencing <strong>com</strong>munities.<br />

Using <strong>Chatter</strong> <strong>API</strong> Inputs<br />

Using POST, PATCH, or PUT for Input<br />

When you make a request using the HTTP POST, PATCH, and PUT methods, you can use request parameters or a request<br />

body. The request body can contain JSON or XML. If you pass request parameters and a request body, the request parameters<br />

are usually ignored. However, if you pass both a request body and a text parameter, you’ll receive a 400 error.<br />

To submit a request using request parameters, use a Content-Type header field with the value<br />

application/x-www-form-urlencoded.<br />

To submit a request using a request body, use one of the following values in a Content-Type header field and in an Accept<br />

header field:<br />

• application/json<br />

• application/xml<br />

Uploading Binary Files<br />

The following table lists the resources that support binary file uploads:<br />

Description<br />

Uploads a file to a new post in the news<br />

feed.<br />

Uploads a file to a new post in the user<br />

profile feed.<br />

Uploads a file to a new post in the record<br />

feed.<br />

Uploads a file to a new <strong>com</strong>ment.<br />

Uploads a user photo.<br />

Uploads a group photo.<br />

Uploads a file to the Files tab.<br />

Resource<br />

/chatter/feeds/news/userId/feed-items<br />

/chatter/feeds/user-profile/userId/feed-items<br />

/chatter/feeds/record/recordId/feed-items<br />

/chatter/feed-items/feedItemId/<strong>com</strong>ments<br />

/chatter/users/userId/photo<br />

/chatter/groups/groupId/photo<br />

/chatter/users/userId/files/<br />

8


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Using <strong>Chatter</strong> <strong>API</strong> Inputs<br />

To upload a binary file, you must send it as a body part in a multipart/form-data request. You can send information such as<br />

the text of a post or <strong>com</strong>ment as a JSON or XML rich input body part in the same multipart/form-data request. Alternately,<br />

you can choose to send that information in request parameters. If you pass both a rich input request body and request parameters,<br />

the request parameters are ignored.<br />

To create a multipart/form-data request, in the head of the request, set the Content-Type HTTP header to<br />

multipart/form-data.<br />

For information about additional HTTP headers, see W3C Form content types, and RFC 2388, which defines the<br />

multipart/form-data internet media type.<br />

The following table describes the HTTP headers and parameters required in the rich input body part of a multipart/form-data<br />

request:<br />

HTTP Headers for Rich<br />

Input Body Part<br />

Content-Disposition<br />

Content-Type<br />

Header Value and Parameters<br />

form-data; name="json"<br />

form-data; name="xml"<br />

application/json; charset=UTF-8<br />

application/xml; charset=UTF-8<br />

Description<br />

The request body for a post or <strong>com</strong>ment.<br />

For JSON, the value of name must be "json".<br />

For XML, the value of name must be "xml".<br />

The data format and character set of the request<br />

body.<br />

For JSON, the value must be<br />

application/json.<br />

For XML, the value must be<br />

application/xml.<br />

The following table describes the HTTP headers and parameters required in the binary upload body part of a multipart/form-data<br />

request:<br />

HTTP Headers for Binary<br />

Upload Body Part<br />

Content-Disposition<br />

Header Value and Parameters<br />

form-data;<br />

name="feedItemFileUpload";<br />

filename=string<br />

form-data; name="fileUpload"<br />

filename=string<br />

form-data; name="fileData"<br />

filename=string<br />

Description<br />

To upload a binary file to a post or <strong>com</strong>ment,<br />

the value of name must be<br />

"feedItemFileUpload".<br />

To upload a user or group photo, the value of<br />

name must be "fileUpload".<br />

To upload a file to the File list, the value of name<br />

must be "fileData".<br />

Note: You must specify a filename<br />

parameter and value. However, please<br />

note that <strong>Chatter</strong> uses the value of the<br />

Attachment Input: New File Upload<br />

title property as the file name, not<br />

the value of the filename parameter.<br />

9


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Using <strong>Chatter</strong> <strong>API</strong> Inputs<br />

HTTP Headers for Binary<br />

Upload Body Part<br />

Content-Type<br />

Header Value and Parameters<br />

application/octet-stream;<br />

charset=ISO-8859-1<br />

Description<br />

The media type and character set of the binary<br />

file.<br />

The following example posts a new feed item, uploads a binary file, and attaches it to the new feed item. The multipart request<br />

in this example includes a part for the request body that has a Content-Type of application/json.<br />

POST /services/data/v27.0/chatter/feeds/user-profile/005x0000001T9PwAAK/feed-items HTTP/1.1<br />

Authorization: OAuth 00DD0000000Jhd2!AQIAQC.lh4qTQcBhOPm4TZom5IaOOZLVPVK4wI_rPYJvmE8r2VW8XA.<br />

OZ7S29JEM_7Ctq1lst2dzoV.owisJc0KacUbDxyae<br />

User-Agent: Jakarta Commons-HttpClient/3.0.1<br />

Host: instance_name<br />

Content-Length: 845<br />

Content-Type: multipart/form-data; boundary=a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq<br />

Accept: application/json<br />

--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq<br />

Content-Disposition: form-data; name="json"<br />

Content-Type: application/json; charset=UTF-8<br />

{ "body":<br />

{<br />

"messageSegments" : [<br />

{<br />

"type" : "Text",<br />

"text" : "High priority content "<br />

}, {<br />

"type" : "Hashtag",<br />

"tag" : "important"<br />

}, {<br />

"type" : "Text",<br />

"text" : "Please review this as soon as possible."<br />

}<br />

]<br />

},<br />

"attachment":<br />

{<br />

"attachmentType" : "NewFile",<br />

"description": "Quarterly review",<br />

"title" : "2012_q1"<br />

}<br />

}<br />

--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq<br />

Content-Disposition: form-data; name="feedItemFileUpload"; filename="foo"<br />

Content-Type: application/octet-stream; charset=ISO-8859-1<br />

This is the content of the file.<br />

--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq--<br />

The following is the same example using XML instead of JSON:<br />

POST /services/data/v27.0/chatter/feeds/user-profile/005x0000001TBMVAA4/feed-items HTTP/1.1<br />

Authorization: OAuth 00DD0000000Jhd2!AQIAQC.lh4qTQcBhOPm4TZom5IaOOZLVPVK4wI_rPYJvmE8r2VW8XA.<br />

OZ7S29JEM_7Ctq1lst2dzoV.owisJc0KacUbDxyae<br />

User-Agent: Jakarta Commons-HttpClient/3.0.1<br />

Host: instance_name<br />

Content-Length: 897<br />

Content-Type: multipart/form-data; boundary=0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r<br />

Accept: application/xml<br />

10


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Using <strong>Chatter</strong> <strong>API</strong> Inputs<br />

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r<br />

Content-Disposition: form-data; name="xml"<br />

Content-Type: application/xml; charset=UTF-8<br />

<br />

<br />

<br />

<br />

High priority content <br />

Text<br />

<br />

<br />

important<br />

Hashtag<br />

<br />

<br />

Please review this as soon as possible<br />

Text<br />

<br />

<br />

<br />

<br />

Quarterly review 2012 Q1<br />

2012_q1<br />

<br />

<br />

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r<br />

Content-Disposition: form-data; name="feedItemFileUpload"; filename="foo"<br />

Content-Type: application/octet-stream; charset=ISO-8859-1<br />

This is the content of the file.<br />

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r--<br />

The following example posts a <strong>com</strong>ment to a feed item and uploads a binary attachment:<br />

POST /services/data/v27.0/chatter/feed-items/0D5x00000000RryCAE/<strong>com</strong>ments HTTP/1.1<br />

Authorization: OAuth 00DD0000000Jhd2!AQIAQC.lh4qTQcBhOPm4TZom5IaOOZLVPVK4wI_rPYJvmE8r2VW8XA.<br />

OZ7S29JEM_7Ctq1lst2dzoV.owisJc0KacUbDxyae<br />

Accept: application/json<br />

User-Agent: Jakarta Commons-HttpClient/3.0.1<br />

Host: instance_name<br />

Content-Length: 978<br />

Content-Type: multipart/form-data; boundary=F9jBDELnfBLAVmLNbnLIYibT5Icp0h3VJ7mkI<br />

--F9jBDELnfBLAVmLNbnLIYibT5Icp0h3VJ7mkI<br />

Content-Disposition: form-data; name="json"<br />

Content-Type: application/json; charset=UTF-8<br />

{ "body":<br />

{<br />

"messageSegments" : [<br />

{<br />

"type" : "Text",<br />

"text" : "Here's another file for review."<br />

}, {<br />

"type" : "Hashtag",<br />

"tag" : "important"<br />

}, {<br />

"type" : "Text",<br />

"text" : "Again, please review this as soon as possible."<br />

}<br />

]<br />

},<br />

"attachment":<br />

11


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Using Wildcards<br />

}<br />

{<br />

}<br />

"attachmentType" : "NewFile",<br />

"description": "Quarterly review 2012 Q2",<br />

"title" : "2012_q2"<br />

--F9jBDELnfBLAVmLNbnLIYibT5Icp0h3VJ7mkI<br />

Content-Disposition: form-data; name="feedItemFileUpload"; filename="foo"<br />

Content-Type: application/octet-stream; charset=ISO-8859-1<br />

This is the content of the file.<br />

--F9jBDELnfBLAVmLNbnLIYibT5Icp0h3VJ7mkI--<br />

Note: Spacing and carriage returns and line feeds (CRLF) are important. For example, the following line requires<br />

spaces: Content-Disposition: form-data; name="feedItemFileUpload";<br />

title="2012_q1_review.ppt" If you had used CRLF instead of spaces, you would have received an error.<br />

Using Wildcards<br />

Some of the resource request parameters support wildcards.<br />

You can specify the following wildcard characters to match text patterns in your search:<br />

Wildcard<br />

*<br />

?<br />

Description<br />

Asterisks match zero or more characters at the middle or end (not the beginning) of your search term. For<br />

example, a search for john* finds items that start with john, such as, john, johnson, or johnny. A search for<br />

mi* meyers finds items with mike meyers or michael meyers. If you are searching for a literal asterisk in a<br />

word or phrase, then escape the asterisk (precede it with the \ character).<br />

Question marks match only one character in the middle or end (not the beginning) of your search term.<br />

For example, a search for jo?n finds items with the term john or joan but not jon or johan.<br />

When using wildcards, consider the following issues:<br />

• Wildcards take on the type of the preceding character. For example, aa*a matches aaaa and aabcda, but not aa2a or aa.!//a,<br />

and p?n matches pin and pan, but not p1n or p!n. Likewise, 1?3 matches 123 and 143, but not 1a3 or 1b3.<br />

• A wildcard (*) is appended at the end of single characters in Chinese, Japanese, Korean, and Thai (CJKT) searches, except<br />

in exact phrase searches.<br />

• The more focused your wildcard search, the faster the search results are returned, and the more likely the results will reflect<br />

your intention. For example, to search for all occurrences of the word prospect (or prospects, the plural form), it is<br />

more efficient to specify prospect* in the search string than to specify a less restrictive wildcard search (such as prosp*)<br />

that could return extraneous matches (such as prosperity).<br />

• Tailor your searches to find all variations of a word. For example, to find property and properties, you would specify<br />

propert*.<br />

• Punctuation is indexed. To find * or ? inside a phrase, you must enclose your search string in quotation marks and you<br />

must escape the special character. For example, "where are you\?" finds the phrase where are you?. The escape<br />

character (\) is required in order for this search to work correctly.<br />

12


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Send HTTP Requests with cURL<br />

Send HTTP Requests with cURL<br />

<strong>Chatter</strong> <strong>API</strong> uses HTTP methods to send and receive JSON and XML content, so it is very simple to build client applications<br />

using the tool or the language of your choice. We re<strong>com</strong>mend a <strong>com</strong>mand-line tool called cURL to simplify sending and<br />

receiving HTTP requests and responses.<br />

cURL is pre-installed on many Linux and Mac systems. Windows users can download a version at curl.haxx.se/. When<br />

using HTTPS on Windows, ensure that your system meets the cURL requirements for SSL.<br />

Your HTTP requests to a <strong>Chatter</strong> <strong>API</strong> resource should contain the following information:<br />

• An HTTP method (such as HEAD, GET, POST, or DELETE).<br />

• An OAuth 2.0 access token used to authenticate the request. For information on how to retrieve the token, see Step One:<br />

Set Up Authorization on page 25.<br />

• The <strong>Chatter</strong> <strong>API</strong> resource URL.<br />

• Any JSON or XML files containing information needed for requests, such as updating a record with new information.<br />

The HTTP methods are used to indicate the desired action, such as retrieving information, as well as creating, updating, and<br />

deleting records.<br />

• GET is used to retrieve information, such as basic resource summary information.<br />

• POST is used to create a new <strong>Chatter</strong> <strong>API</strong> item, such as a <strong>com</strong>ment or like, or subscribe to a group.<br />

• PATCH is used for partial updates to an item, for example, renaming a file.<br />

• PUT is used for whole updates to an item, for example, marking a conversation as read.<br />

• DELETE is used to delete a <strong>Chatter</strong> <strong>API</strong> item, such as a feed-item, or unsubscribe from a group.<br />

• HEAD is used to retrieve resource metadata. It's similar to using GET but without the response body. You can use HEAD<br />

for testing the availability of a resource.<br />

To access a resource, submit an HTTP request containing a header, method, and resource URL.<br />

Understanding OAuth and <strong>Chatter</strong> <strong>API</strong><br />

OAuth is an open protocol that allows secure authentication for access to a user's data, without handing out the user's username<br />

and password. It is often described as the valet key of software access: a valet key only allows access to certain features of your<br />

car: for example, you can’t open the trunk or glove <strong>com</strong>partment using a valet key.<br />

<strong>Chatter</strong> <strong>API</strong> uses OAuth to securely identify your application before connecting to <strong>Database</strong>.<strong>com</strong>.<br />

When you use OAuth, you can avoid storing login credentials in your application. Instead, your application can prompt the<br />

user to login using a standard <strong>Database</strong>.<strong>com</strong> page, which returns an access token to your application. Your application can use<br />

this access token to access <strong>Chatter</strong> <strong>API</strong> Web services. This approach to authentication can be used in both mobile apps and<br />

from a Web page.<br />

<strong>Chatter</strong> <strong>API</strong> uses OAuth 2.0..<br />

Understanding Connected Apps<br />

To use <strong>Chatter</strong> <strong>API</strong>, you must create a <strong>REST</strong> entry point in your organization. <strong>Database</strong>.<strong>com</strong> defines this entry point as a<br />

Connected App definition.<br />

13


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding OAuth and <strong>Chatter</strong> <strong>API</strong><br />

For an example in creating a Connected App definition, see Step One: Set Up Authorization on page 25.<br />

Considerations when creating and using a Connected App:<br />

• The following maps the labels used in the Connected App definition to OAuth terms:<br />

Connected App Label<br />

Consumer Key<br />

Consumer Secret<br />

Callback URL<br />

OAuth Term<br />

client_id<br />

client_secret<br />

redirect_uri<br />

Description<br />

A unique identifier that identifies your<br />

application to <strong>Database</strong>.<strong>com</strong>.<br />

A secret key associated with your<br />

application.<br />

A URL associated with your client<br />

application. In some contexts, this must<br />

be a real URL that the client’s Web<br />

browser is redirected to. In others, the<br />

URL isn’t used; however, between your<br />

client application and the server (the<br />

Connected App definition) the value<br />

must be the same. For example, you<br />

may want to use a value that identifies<br />

the application, such as<br />

http://my<strong>com</strong>ponent.myapp.<br />

• If you are developing a mobile app, you can use the following value for the Callback URL (redirect_uri) to avoid<br />

setting up an application server of your own:<br />

https://login.instance_name/services/oauth2/success<br />

This value should NOT be used when developing a Web application.<br />

• Your Connected App does not have to reside in the same organization as your users. The Connected App you create can<br />

be used to sign into any organization.<br />

• We re<strong>com</strong>mend creating more than one Connected App definition: one for testing and one for production. If you create<br />

only one, you must change the value of the Callback URL to reflect the location of your application code. In addition,<br />

you should create more than one Connected App if you are developing for different platforms, such as iOS and Android.<br />

OAuth Basics<br />

• OAuth grants access by client applications to resources owned by resource owners. In terms of OAuth, a resource is anything<br />

that must be kept secured. For <strong>Chatter</strong> <strong>API</strong>, the resource we are concerned about protecting is all the data accessible<br />

through the <strong>API</strong>.<br />

• It is up to a resource owner to grant access to resources. In our context, the resource owner is a <strong>com</strong>bination of the<br />

administrator (who administers users and the connected app) and the users (who log in and grant access to third party<br />

applications).<br />

• When an application wants to access a resource, it requests authorization from the resource owner. OAuth outlines various<br />

ways that an application can be granted access to a resource. These are referred to as grant types or flows. Different flows<br />

are suitable for different contexts.<br />

• Once a client application has been authorized to access to a resource, the client application is given an access token and a<br />

refresh token. The access token must be included by the authorized client application in any subsequent Web service<br />

requests to identify itself. Access tokens have a limited lifetime. When an access token expires, the authorized client<br />

application can make a special request using the refresh token to obtain a new access token.<br />

14


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding the Web Server OAuth Authentication Flow<br />

OAuth Flows<br />

A user must be authenticated before accessing <strong>Database</strong>.<strong>com</strong>. OAuth has multiple authentication flows. There are several<br />

steps in each authentication flow, as dictated by the OAuth standard and the type of application trying to access <strong>Database</strong>.<strong>com</strong>.<br />

On successful authorization, the client application is provided with access and refresh tokens.<br />

<strong>Database</strong>.<strong>com</strong> supports the following flows for use with the <strong>Chatter</strong> <strong>API</strong>:<br />

• Web server flow<br />

• User-agent flow<br />

In addition, you can also use the refresh token to get a new access token after your application has been authorized for access.<br />

Revoking Access<br />

After a user has granted access to a client application, they can revoke access by clicking My Personal Information > Personal<br />

Information, then in the Remote Access related section, clicking Revoke.<br />

Understanding the Web Server OAuth Authentication Flow<br />

Typically this flow is used by web applications that can confidentially store the client secret. A critical aspect of the Web server<br />

flow is that the application must be able to protect the consumer secret.<br />

The following is the general flow. The individual step descriptions follow.<br />

15


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding the Web Server OAuth Authentication Flow<br />

The following is a general description of the OAuth web-server flow:<br />

1. To request authorization for a resource, the client application redirects the end-user’s browser to a web page hosted on the<br />

resource owner’s authorization server. In this case, it is the <strong>Database</strong>.<strong>com</strong> log in page.<br />

2. The end-user logs into <strong>Database</strong>.<strong>com</strong> to authenticate themselves. Since this web page is hosted by the resource owner<br />

(<strong>Database</strong>.<strong>com</strong>) and interacted with directly by the end user, the client web application never finds out the user’s login<br />

credentials. The end-user also grants authorization to the client application.<br />

3. <strong>Database</strong>.<strong>com</strong> sends the authorization code back to the client application using the specified callback URL.<br />

4. After obtaining the authorization code, the client application passes back the authorization code to obtain an access token.<br />

5. After validating the authorization code, <strong>Database</strong>.<strong>com</strong> passes back a response token. If there was no error, the response<br />

token includes an access code, a refresh token, and additional information.<br />

6. The protected resources are <strong>Chatter</strong> <strong>API</strong> endpoints.<br />

Using the Web Server Flow with <strong>Chatter</strong> <strong>API</strong> and <strong>Database</strong>.<strong>com</strong><br />

The following provides specific details for the OAuth Web-server flow when used with <strong>Database</strong>.<strong>com</strong> and <strong>Chatter</strong> <strong>API</strong>:<br />

1. Direct the client’s web browser to the page https://login.instance_name/services/oauth2/authorize, with<br />

the following request parameters:<br />

16


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding the Web Server OAuth Authentication Flow<br />

Parameter<br />

response_type<br />

client_id<br />

redirect_url<br />

Description<br />

Must be code for this authentication flow<br />

The Consumer Key value from the remote access<br />

application defined for this application<br />

The Callback URL value from the remote access<br />

application defined for this application<br />

You can also include the following optional request parameters:<br />

Parameter<br />

state<br />

immediate<br />

display<br />

Description<br />

Specifies URL-encoded state data to be returned in the<br />

callback URL after approval.<br />

Determines whether the user should be prompted for login<br />

and approval. Values are either true or false. Default is<br />

false.<br />

• If set to true, and if the user is currently logged in and<br />

has previously approved the application, the approval<br />

step is skipped.<br />

• If set to true and the user is not logged in or has not<br />

previously approved the application, the session is<br />

immediately terminated with the<br />

immediate_unsuccessful error code.<br />

Indicates the type of web pages that is provided. Valid values<br />

are:<br />

• page—Full-page authorization screen. This is the default<br />

value if none is specified.<br />

• popup—Compact dialog optimized for modern web<br />

browser popup windows.<br />

• touch—mobile-optimized dialog designed for modern<br />

smartphones such as Android and iPhone.<br />

• mobile—mobile optimized dialog designed for less<br />

capable smartphones such as BlackBerry OS 5.<br />

2. After successfully being logged in, the user is asked to authorize the application. Note that if the user has already authorized<br />

the application, this step is skipped.<br />

3. Once <strong>Database</strong>.<strong>com</strong> has confirmed that the client application is authorized, the end-user’s web browser is redirected to<br />

the callback URL specified by the redirect_url parameter, appended with the following values in its query string:<br />

Parameter<br />

code<br />

state<br />

Description<br />

The authorization code that is passed to get the access and<br />

refresh tokens<br />

The state value that was passed in as part of the initial<br />

request, if applicable.<br />

17


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding the Web Server OAuth Authentication Flow<br />

It is expected that the redirect_uri web page is hosted by the client application server.<br />

4. The client application server must extract the authorization code and pass it in a request to <strong>Database</strong>.<strong>com</strong> for an access<br />

token. This request should be made as a POST against this URL:<br />

https://login.instance_name/services/oauth2/token with the following query parameters:<br />

Parameter<br />

grant_type<br />

client_id<br />

client_secret<br />

redirect_uri<br />

code<br />

format<br />

Description<br />

Value must be authorization_code for this flow.<br />

Consumer key from the remote access application definition.<br />

Consumer secret from the remote access application<br />

definition.<br />

URI to redirect the user to after approval. This must match<br />

the value in the Callback URL field in the remote access<br />

application definition exactly, and is the same value sent by<br />

the initial redirect.<br />

Authorization code obtained from the callback after approval.<br />

Expected return format. This parameter is optional. The<br />

default is json. Values are:<br />

• urlencoded<br />

• json<br />

• xml<br />

5. If this request is successful, the server returns a response body holding the following:<br />

Parameters<br />

access_token<br />

refresh_token<br />

Description<br />

Session ID that you can use for making <strong>Chatter</strong> <strong>API</strong><br />

requests. This session ID cannot be used in the user interface.<br />

Treat this like a user's session and diligently protect it.<br />

Token that can be used in the future to obtain new access<br />

tokens (sessions).<br />

Warning: This value is a secret. You should treat<br />

it like the user's password and use appropriate<br />

measures to protect it.<br />

instance_url<br />

id<br />

signature<br />

URL indicating the instance of the user's organization. In<br />

this example, the instance is na1:<br />

https://na1.database.<strong>com</strong><br />

Identity URL that can be used to both identify the user as<br />

well as query for more information about the user. Can be<br />

used in an HTTP request to get more information about<br />

the end user.<br />

Base64-encoded HMAC-SHA256 signature signed with<br />

the consumer's private key containing the concatenated ID<br />

18


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding the User-Agent OAuth Authentication Flow<br />

Parameters<br />

issued_at<br />

Description<br />

and issued_at. This can be used to verify the identity<br />

URL was not modified since it was sent by the server.<br />

When the signature was created.<br />

Understanding the User-Agent OAuth Authentication Flow<br />

Typically this flow is used by mobile apps or applications that directly access the <strong>Chatter</strong> <strong>API</strong> from JavaScript. In this flow,<br />

it is assumed that the client application can’t be trusted to store client credentials, nor the user login credentials.<br />

Warning: Because the access token is encoded into the redirection URI, it might be exposed to the end-user and<br />

other applications residing on the <strong>com</strong>puter or device.<br />

If you are authenticating using JavaScript, we re<strong>com</strong>mend calling window.location.replace(); to remove the<br />

callback from the browser’s history.<br />

The following is the general flow. The individual step descriptions follow.<br />

The following is a general description of the OAuth user-agent flow:<br />

19


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Understanding the User-Agent OAuth Authentication Flow<br />

1. To request authorization for a resource, the client application redirects the end-user’s browser to a Web page hosted on<br />

the resource owner’s authorization server. In this case, it’s the <strong>Database</strong>.<strong>com</strong> login page.<br />

2. The end-user logs into <strong>Database</strong>.<strong>com</strong> to authenticate themselves. Since this Web page is hosted by the resource owner<br />

(<strong>Database</strong>.<strong>com</strong>) and interacted with directly by the end user, the client Web application never finds out the user’s login<br />

credentials.<br />

If the client application is running in the browser already, the browser can just be redirected. If the client application is a<br />

mobile app, a browser must be opened (such as an UIWebView in iOS). The end-user uses this web page to authenticate<br />

themselves and then grant authorization to the client application.<br />

3. Once authorization has been granted, the authorization server redirects the end-user’s Web browser to a redirection URL.<br />

This URL can be used by the client application to retrieve the access and refresh tokens.<br />

4. The protected resources are <strong>Chatter</strong> <strong>API</strong> resources.<br />

Using the User-Agent Flow with <strong>Chatter</strong> <strong>API</strong> and <strong>Database</strong>.<strong>com</strong><br />

The following provides specific details for the OAuth user-agent flow when used with <strong>Database</strong>.<strong>com</strong> and <strong>Chatter</strong> <strong>API</strong>:<br />

1. Direct the client’s Web browser to the page https://login.instance_name/services/oauth2/authorize, with<br />

the following request parameters:<br />

Parameter<br />

response_type<br />

client_id<br />

redirect_url<br />

Description<br />

Must be token for this authentication flow<br />

The Consumer Key value from the remote access<br />

application defined for this application<br />

The Callback URL value from the remote access<br />

application defined for this application<br />

You can also include the following optional request parameters:<br />

Parameter<br />

display<br />

scope<br />

state<br />

Description<br />

Indicates the type of Web page that’s provided. Valid values<br />

are:<br />

• page—Full-page authorization screen. This is the default<br />

value if none is specified.<br />

• popup—Compact dialog optimized for modern Web<br />

browser popup windows.<br />

• touch—mobile-optimized dialog designed for modern<br />

smartphones such as Android and iPhone.<br />

• mobile—mobile optimized dialog designed for older<br />

smartphones such as BlackBerry OS 5.<br />

Specifies what data your app can access. You do not have to<br />

specify any value to access <strong>Chatter</strong> <strong>API</strong> If you specify any<br />

values, you must include the chatter_api value.<br />

Specifies URL-encoded state data to be returned in the<br />

callback URL after approval.<br />

20


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Using Tokens<br />

2. After successfully logging in, the user is asked to authorize the application. Note that if the user has already authorized the<br />

application, this step is skipped.<br />

3. Once <strong>Database</strong>.<strong>com</strong> has confirmed that the client application is authorized, the end-user’s Web browser is redirected to<br />

the callback URL specified by the redirect_uri parameter, appended with the following values after the hash sign (#).<br />

This is not a query string.<br />

Parameters<br />

access_token<br />

expires_in<br />

refresh_token<br />

Description<br />

Session ID that you can use for making <strong>Chatter</strong> <strong>API</strong><br />

requests. This session ID cannot be used in the user interface.<br />

Treat this like a user's session and diligently protect it.<br />

Amount of time the access token is valid, in seconds.<br />

Token that can be used in the future to obtain new access<br />

tokens (sessions).<br />

Warning: This value is a secret. You should treat<br />

it like the user's password and use appropriate<br />

measures to protect it.<br />

The refresh token is only returned if the redirect URI is<br />

https://login.instance_name/services/oauth2/success<br />

or used with a custom protocol that is not HTTPS.<br />

The following additional parameters are returned; however, they aren't used with this flow and <strong>Chatter</strong> <strong>API</strong>:<br />

• instance_url<br />

• id<br />

• signature<br />

• issued_at<br />

4. If the client application is a Web app, the redirection Web page that it uses may include JavaScript that the client application<br />

can manipulate in order to retrieve the access and refresh tokens.<br />

Alternatively, a client application (native or web) may use the page<br />

https://login.instance_name/services/oauth2/success as their callback URL. Instead of actually loading<br />

the page on redirect, they should intercept the redirection URI and extract the parameters values. Note that the<br />

refresh_token parameter values are only provided if the redirection URI is this URI or if the redirection URI uses a<br />

custom protocol.<br />

Once the client application has retrieved the access and refresh tokens, it can use them to make requests to <strong>Chatter</strong> <strong>API</strong>.<br />

Using Tokens<br />

As part of both authentication flows, you will be working with access tokens and refresh tokens.<br />

Using Access Tokens<br />

To make a successful <strong>Chatter</strong> <strong>API</strong> request, you must include a valid access token in the request. This can be done by using<br />

the HTTP Authorization header:<br />

Authorization: OAuth <br />

21


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Requesting Static Assets and Posting Forms Directly from<br />

HTML<br />

If the request yields an error response due to an expired token, the refresh token can be used to get a new access token.<br />

If the request yields an error because an access token has been revoked, the client application must be re-authorized by the<br />

user in order to gain access.<br />

Using Refresh Tokens<br />

If the client application has a refresh token, it can use it to send a request for a new access token.<br />

To ask for a new access token, the client application should send a POST request to<br />

https://login.instance_name/services/oauth2/token with the following query parameters:<br />

Parameters<br />

grant_type<br />

refresh_token<br />

client_id<br />

Description<br />

Value must be refresh_token for this flow.<br />

The refresh token the client application already received.<br />

Consumer key from the remote access application definition.<br />

You can also include the following optional parameters:<br />

Parameters<br />

client_secret<br />

format<br />

Description<br />

Consumer secret from the remote access application definition.<br />

Expected return format. The default is json. Values are:<br />

• urlencoded<br />

• json<br />

• xml<br />

If this request is successful, the server returns a payload holding the access_token.<br />

The following additional parameters are also returned, however, they aren't used with this flow and <strong>Chatter</strong> <strong>API</strong>:<br />

• instance_url<br />

• id<br />

• signature<br />

• issued_at<br />

Requesting Static Assets and Posting Forms Directly from HTML<br />

HTML pages that aren’t hosted on <strong>Salesforce</strong> have had difficulty displaying user and group images and posting file attachments<br />

in forms. The reason is that URLs for these assets require authentication, which is provided with a session cookie when pages<br />

are hosted on <strong>Salesforce</strong>. Pages not hosted on <strong>Salesforce</strong> don't have access to the session cookie. Also, it isn’t possible to pass<br />

an OAuth token from the HTML contexts , , and .<br />

To solve this problem, request self-authenticating bearer token URLs. A bearer token URL is a <strong>Chatter</strong> <strong>API</strong> resource with an<br />

appended bearer token that provides access to the resource. Use bearer token URLs in , , and tags to do<br />

the following:<br />

• Request static <strong>Chatter</strong> <strong>API</strong> assets such as <strong>Chatter</strong> user profile images, files, and file and dashboard previews.<br />

22


Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Requesting Static Assets and Posting Forms Directly from<br />

HTML<br />

• Post form requests to <strong>Chatter</strong> <strong>API</strong> when files are attached, for example, feed items or <strong>com</strong>ments with a file attachment,<br />

or user profile photo updates.<br />

To request static assets or post form requests, request a resource that returns a bearer token URL. Then use the bearer token<br />

URL to request the resource.<br />

1. Request a resource with a response body property that contains a bearer token URL:<br />

• Photo—largePhotoUrl, smallPhotoUrl, url*<br />

• Feed Item Attachment-Dashboard—fullSizeImageUrl, thumbNailUrl<br />

• Comment Page—currentPageUrl*<br />

• Feed Item—photoUrl<br />

• Feed—feedItemsUrl*<br />

• Feed Item Attachment-Content—downloadUrl, renditionUrl<br />

• File Summary—downloadUrl, renditionUrl<br />

• File Detail—downloadUrl, renditionUrl<br />

*Use to POST or PUT for new items that include binary files: for example, a feed item or <strong>com</strong>ment with a file attachment.<br />

2. Pass the X-Connect-Bearer-Urls request header with a value of true:<br />

X-Connect-Bearer-Urls: true<br />

3. Parse the bearer token URL from the response body and use it in an HTML tag to request a static asset or to post a form<br />

request.<br />

Bearer token URLs have the following characteristics:<br />

• The bearer token is good for the given URL only. Adding or reordering query parameters invalidates the URL.<br />

• The bearer token has a time-to-live (TTL) of 20 minutes. If the token expires you must request it again.<br />

• The request to the bearer token URL authenticates as the user who requested the resource that returned the bearer<br />

token URL.<br />

23


Chapter 2<br />

Quick Start<br />

In this chapter ...<br />

• Prerequisites<br />

• Step One: Set Up Authorization<br />

• Step Two: Connect to <strong>Chatter</strong> <strong>API</strong><br />

Using OAuth<br />

Create a sample application in your development environment to see the power<br />

and flexibility of the <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>.<br />

24


Quick Start<br />

Prerequisites<br />

Prerequisites<br />

Completing the prerequisites makes it easier to build and use the quick-start sample:<br />

• Install your development platform according to its product documentation.<br />

• Be<strong>com</strong>e familiar with cURL, the tool used to execute <strong>REST</strong> requests in this quick start. If you use another tool, you should<br />

be familiar enough with it to translate the example code.<br />

• Be<strong>com</strong>e familiar with JavaScript Object Notation (JSON), which is used in this quick start, or be able to translate samples<br />

from JSON to the standard you use.<br />

• Enable an SSL endpoint in your application server.<br />

• Be<strong>com</strong>e familiar with OAuth 2.0, which requires some setup. We provide the steps, but it will help if you are familiarize<br />

yourself with terms and concepts.<br />

See Also:<br />

Quick Start<br />

Step One: Set Up Authorization<br />

Step One: Set Up Authorization<br />

Setting up OAuth 2.0 requires that you take some steps within your development environment and in other locations. If any<br />

of the steps are unfamiliar, you can consult the online help or the OAuth 2.0 documentation.<br />

1. Decide where to create your Connected App.<br />

Your Connected App does not have to reside in the same organization as your users. The Connected App you create can<br />

be used to sign into any organization.<br />

2. In the appropriate organization, navigate to Create > Apps, and in the Connected Apps section, click New to create a<br />

new Connected App.<br />

3. Enter a Connected App name.<br />

4. Enter the contact email, as well as any other information appropriate to your application.<br />

5. Enter a Callback URL. It must be secure: http:// does not work, only https://.<br />

For development environments, the callback URL is generally the instance plus whatever URL you want the user to be<br />

redirected to, for example: https://instance_name/ConnectTest/oauth/_callback.<br />

6. Enter an OAuth scope. Select Access and manage your <strong>Chatter</strong> feed in addition to any other scope you want<br />

your Connected App to allow access to.<br />

7. Click Save.<br />

The Consumer Key is created and displayed, and a Consumer Secret is created (click the link to reveal it).<br />

Use this Connected App to connect to the servers.<br />

See Also:<br />

Quick Start<br />

Prerequisites<br />

Step Two: Connect to <strong>Chatter</strong> <strong>API</strong> Using OAuth<br />

25


Quick Start<br />

Step Two: Connect to <strong>Chatter</strong> <strong>API</strong> Using OAuth<br />

Step Two: Connect to <strong>Chatter</strong> <strong>API</strong> Using OAuth<br />

You must create a Connected App (such as the example in Step One: Set Up Authorization) before you can do this step.<br />

Note: The OAuth 2.0 specification uses “client” instead of “consumer.”<br />

The following maps the terms used in the Connected App you just created to the OAuth values used in the examples.<br />

Connected App Application Label<br />

Consumer Key<br />

Consumer Secret<br />

Callback URL<br />

Value in Example<br />

client_id<br />

client_secret<br />

redirect_uri<br />

In addition, the value of grant_type depends on the OAuth authentication flow you are using. For this flow, the value is<br />

password.<br />

Important: The OAuth flow being used in this example is not suitable for production client apps because it involves<br />

passing in the client secret. Use of the username-password flow is not re<strong>com</strong>mended for most applications.<br />

This example also uses the following values:<br />

Note: Communities are available as a pilot program. Contact your salesforce.<strong>com</strong> representative to find out if your<br />

organization qualifies for the <strong>com</strong>munity pilot.<br />

Name<br />

Instance<br />

username<br />

Consumer key<br />

Consumer secret<br />

Callback URL<br />

Grant type<br />

Password<br />

Value<br />

na1.database.<strong>com</strong><br />

admin@seattleapps.<strong>com</strong><br />

3MVG9PhR6g6B7ps4xDycwGrI4PvjVZvK9<br />

8870355475032095511<br />

https://www.seattleapps.<strong>com</strong><br />

password<br />

1Lsfdc!<br />

1. Generate the access token.<br />

The following is an example of the cURL <strong>com</strong>mand to generate an access token:<br />

curl --form client_id=3MVG9PhR6g6B7ps4xDycwGrI4PvjVZvK9<br />

--form client_secret=8870355475032095511<br />

--form grant_type=password<br />

--form username=admin@seattleapps.<strong>com</strong><br />

--form password=1Lsfdc!<br />

https://na1.database.<strong>com</strong>/services/oauth2/token<br />

26


Quick Start<br />

Step Two: Connect to <strong>Chatter</strong> <strong>API</strong> Using OAuth<br />

The following is the response that includes the access token:<br />

{<br />

"id":"https://login.na1.database.<strong>com</strong>/id/00DD0000000FJ6TMAW/<br />

005D0000001B5T4IAK",<br />

"issued_at":"1302907727777",<br />

"instance_url":"https://na1.database.<strong>com</strong>",<br />

"signature":"5jcevY5fUai0lWntuSxkwBzWcvRjd01RCOkIBZpyGv0=",<br />

"access_token":"00DD0000000FJ6T!AQkAQPde_DMF2vGzddfZmBRS95GojDbtA<br />

rKkgukAgZP0OVFYY5KkAqhLw9ejeKIlpJ3FgwGAWeRlBiWRt8mfXEuAZGbZNosk"<br />

}<br />

2. Access <strong>Chatter</strong> <strong>API</strong> using the access token.<br />

curl -X GET https://na1.database.<strong>com</strong>/services/data/v27.0/chatter/users/me<br />

-H 'Authorization: Bearer 00DD0000000FJ6T!AQkAQPde_DMF2vGzddfZmBRS95Goj<br />

DbtArKkgukAgZP0OVFYY5KkAqhLw9ejeKIlpJ3FgwGAWeRlBiWRt8mfXEuAZGbZNosk'<br />

See Also:<br />

Quick Start<br />

Step One: Set Up Authorization<br />

27


Chapter 3<br />

<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

• Filter a response body?<br />

• Post a feed item?<br />

• Add a <strong>com</strong>ment to a record or user?<br />

• Post a <strong>com</strong>ment or feed item with an @mention?<br />

• Post a <strong>com</strong>ment or feed item with multiple @mentions?<br />

• Like a feed item?<br />

• Share a feed item?<br />

• Poll my news feed for updates?<br />

• Get my news feed?<br />

• Search a record feed?<br />

• Get feed items posted to a record?<br />

• Get the list of records a specific user follows?<br />

• Get <strong>Chatter</strong> activity statistics?<br />

• Get re<strong>com</strong>mendations of people to follow?<br />

• Join a group?<br />

• Request to join a private group?<br />

• Respond to a request to join a private group?<br />

• Post to a group?<br />

• Follow a record?<br />

• Unfollow a record?<br />

• Send a private message?<br />

• Create auto<strong>com</strong>plete for @mentions?<br />

• Retrieve all the information for a group of users?<br />

While using the <strong>Chatter</strong> <strong>API</strong>, keep the following in mind:<br />

• Request parameters are included as part of the <strong>Chatter</strong> <strong>API</strong> resource URL, for example, /chatter/users?q=searchtext.<br />

A request body is a rich input included as part of the request. When accessing a resource, you can use either a request body<br />

or request parameters. You cannot use both.<br />

• With a request body, use Content-Type: application/json or Content-Type: application/xml.<br />

• With request parameters, use Content-Type: application/x-www-form-urlencoded.<br />

For more information on request bodies, see Using POST, PATCH, or PUT for Input.<br />

For examples of how to upload a binary file, see Uploading Binary Files.<br />

Filter a response body<br />

Resource:<br />

All<br />

28


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

GET<br />

NA<br />

exclude and include<br />

Use the exclude and include query parameters to filter a response body when making a<br />

request. The query value is a bar (|) delimited list of properties. URL encode the bar as %7C.<br />

Use a forward slash (/) before each property name.<br />

The following News Feed URL resource:<br />

/chatter/users/me?include=/aboutMe%7C/address<br />

Returns the following for the Feed response body:<br />

{<br />

"aboutMe": "<strong>Salesforce</strong> Administrator and Citizen Developer",<br />

"address": {<br />

"city": "San Francisco",<br />

"country": "US",<br />

"formattedAddress": "1 Market St\nSan Francisco, CA<br />

94105\nUS",<br />

"state": "CA",<br />

"street": "1 Market St",<br />

"zip": "94105"<br />

}<br />

}<br />

For a detailed list of rules and examples, see Response Body Filters on page 258.<br />

Returns:<br />

A filtered response body<br />

Post feed item<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Use one of the feed resources, such as /chatter/feeds/news/userId/feed-items.<br />

POST<br />

Feed Item Input<br />

text<br />

29


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Request body example:<br />

{ "body" :<br />

{<br />

"messageSegments" : [<br />

{<br />

"type": "Text",<br />

"text" : "New post"<br />

}<br />

]<br />

}<br />

}<br />

Request parameter<br />

example:<br />

/services/data/v27.0/chatter/feeds/news<br />

/me/feed-items?text=New+post<br />

Returns:<br />

Feed Item<br />

Add <strong>com</strong>ments<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

/chatter/feed-items/feedItemId/<strong>com</strong>ments<br />

POST<br />

Comment input<br />

text<br />

{ "body" :<br />

{<br />

"messageSegments" : [<br />

{<br />

"type": "Text",<br />

"text" : "New <strong>com</strong>ment"<br />

}<br />

]<br />

}<br />

}<br />

Request parameter<br />

example:<br />

/services/data/v27.0/chatter/feed-items/<br />

0D5D0000000DaSbKAK/<strong>com</strong>ments?text=New+<strong>com</strong>ment<br />

Returns:<br />

Comment<br />

Post @mentions<br />

Resource:<br />

To post a feed-item with an @mention, use one of the feed resources, such as<br />

/chatter/feeds/user-profile/userId/feed-items. To post a <strong>com</strong>ment, use the<br />

Feed-Items resource: /chatter/feed-items/feedItemId/<strong>com</strong>ments<br />

30


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

HTTP method:<br />

Request body:<br />

Request body example:<br />

POST<br />

The appropriate container input, such as <strong>com</strong>ment input or feed-item input, with the message<br />

segment input: mention<br />

{ "body" :<br />

{<br />

"messageSegments" : [<br />

{<br />

"type": "mention",<br />

"id" : "005D0000001GpHp"<br />

},<br />

{<br />

"type": "text",<br />

"text" : " Did you see the new plans?"<br />

}<br />

]<br />

}<br />

}<br />

Note: No spaces are added either before or after the @mention, so the text message<br />

segment includes a space.<br />

Returns<br />

Feed Item<br />

Post multiple @mentions<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

To post a feed-item with multiple @mentions, use one of the feed resources, such as<br />

/chatter/feeds/user-profile/userId/feed-items. To post a <strong>com</strong>ment with<br />

multiple @mentions, use the Feed-Items resource:<br />

/chatter/feed-items/feedItemId/<strong>com</strong>ments.<br />

POST<br />

The appropriate container input, such as <strong>com</strong>ment input or feed-item input, with multiple<br />

Message Segment Input: Mention bodies.<br />

31


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Request body example:<br />

{ "body" :<br />

{<br />

"messageSegments" : [<br />

{<br />

"type": "mention",<br />

"id":"005D0000001LL8YIAW"<br />

},<br />

{<br />

"type": "mention",<br />

"id":"005D0000001LL8sIAG"<br />

},<br />

{<br />

"type": "text",<br />

"text":" Did you see the new plans?"} ]<br />

}<br />

]<br />

}<br />

}<br />

Note: No spaces are added either before or after the @mention, so the text message<br />

segment includes a space.<br />

Returns<br />

Feed Item<br />

Like feed items<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Example:<br />

/chatter/feed-items/feedItemId/likes<br />

POST<br />

NA<br />

NA<br />

/services/data/v27.0/chatter/feed-items/0D5D0000000DaZBKA0<br />

/likes<br />

Returns:<br />

Like<br />

Share a feed item<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Use one of the feed resources, such as<br />

/chatter/feeds/user-profile/userId/feed-items.<br />

POST<br />

originalFeedItemId<br />

originalFeedItemId<br />

32


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Request body example:<br />

{<br />

}<br />

"originalFeedItemId": "0D5D0000000DaZBKA0"<br />

Returns:<br />

Feed Item<br />

Poll news feed<br />

Resource: 1. Use either of the following resources to get the latest items from a news feed or to get<br />

information about the feed: /chatter/feeds/news/me/feed-items,<br />

/chatter/feeds/news/me.<br />

The response bodies for both resources contain the isModifiedUrl property. This<br />

property contains the URL to the Is-Modified resource, which includes a since request<br />

parameter that defines the last modified date of the feed. Note that if the sort order of<br />

the request to the news feed changes, the news feed is modified.<br />

2. Issue a GET request to the URL in the isModifiedUrl property.<br />

The Feed Modified Info response contains the following properties:<br />

• isModified—a boolean indicating whether the feed has been updated since the last<br />

time you checked. Note that conditions under which this property is true depend on<br />

the sort order of the original request to the news feed. For example, if the feed is sorted<br />

by posts (CreatedDateDesc) and a <strong>com</strong>ment was added, isModified is false.<br />

• nextPollUrl—a string containing the URL of the Is-Modified resource. This<br />

property contains a URL only if isModified is false. If isModified is true,<br />

nextPollUrl is null.<br />

3. If the isModified property is true, issue a GET request to the News Feed Items<br />

resource to refresh the news feed.<br />

4. If the isModified property is false, issue a GET request to the URL in the<br />

nextPollUrl property. This request also returns a Feed Modified Info response body<br />

that contains the isModified and nextPollUrl properties.<br />

Note: We don’t re<strong>com</strong>mend polling the news feed for updates more than once a<br />

minute.<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

GET<br />

NA<br />

NA<br />

The following News Feed URL resource:<br />

/chatter/feeds/news/005xx000001Sv1mAAB<br />

33


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Returns the following for the Feed response body:<br />

{<br />

"feedItemsUrl":<br />

"/services/data/v27.0/chatter/feeds/news/005xx000001Sv1mAAB/feed-items",<br />

"isModifiedUrl":<br />

"/services/data/v27.0/chatter/feeds/news/005xx000001Sv1mAAB/is-modified?since=2%3A1344352279000"<br />

}<br />

The Is-Modified resource for polling this news feed is:<br />

/chatter/feeds/news/005xx000001Sv1mAAB/is-modified?since=2%3A1344352279000<br />

Returns:<br />

Feed Modified Info<br />

Get news feeds<br />

The following gets the news feed of the current user.<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Example:<br />

/chatter/feeds/news/me/feed-items<br />

GET<br />

NA<br />

NA<br />

/services/data/v27.0/chatter/feeds/news/me/feed-items<br />

Returns:<br />

Feed Item Page<br />

Search a record feed<br />

The following example searches the record feed of the current user. The record can be a group, person, object, file, and<br />

so on. For example, use this resource to search a group feed. The search string can contain wildcards and must contain at<br />

least two characters that aren’t wildcards.<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Example:<br />

/chatter/feeds/record/me/feed-items<br />

GET<br />

NA<br />

q<br />

/services/data/v27.0/chatter/feeds<br />

/record/me/feed-items?q=track<br />

Returns:<br />

Feed Item Page<br />

34


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Get feed items for a record<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

/chatter/feeds/record/recordId/feed-items<br />

GET<br />

NA<br />

page (optional)<br />

Note: Page tokens are returned as part of the response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Request parameter<br />

example:<br />

/services/data/v27.0/chatter/feeds/record<br />

/005x0000001oXx9AAE/feed-items?page=2011-03-31T20:57:24Z,0D5x0000001C2XPCA0<br />

Returns:<br />

Feed Item Page<br />

Get list of what user is following<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request parameter<br />

example:<br />

/chatter/users/userId/following<br />

GET<br />

NA<br />

page (optional)<br />

/services/data/v27.0/chatter/users<br />

/005D0000001GLowIAB/following?page=1<br />

Returns:<br />

Subscription Page<br />

Get <strong>Chatter</strong> activity statistics<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Example:<br />

/chatter/users/userId<br />

GET<br />

NA<br />

NA<br />

/services/data/v27.0/chatter/users<br />

/005D0000001GLowIAB<br />

Returns:<br />

User Detail<br />

35


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Get re<strong>com</strong>mendations<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Example:<br />

/chatter/users/me/re<strong>com</strong>mendations/follow/users<br />

GET<br />

NA<br />

NA<br />

/services/data/v27.0/chatter/users<br />

/me/re<strong>com</strong>mendations/follow/users<br />

Returns:<br />

Re<strong>com</strong>mendation<br />

Join a group<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

Request parameter<br />

example:<br />

/chatter/groups/groupId/members<br />

POST<br />

Group member input<br />

userId<br />

{"userId": "005D0000001GpHp" }<br />

/services/data/v27.0/chatter/groups/0F9D000000006bOKAQ<br />

/members?userId=005D0000001GpHp<br />

Returns:<br />

Group Member<br />

Request to join a private group<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

Request parameter<br />

example:<br />

/chatter/groups/groupId/members/requests<br />

POST<br />

NA<br />

NA<br />

NA<br />

/services/data/v27.0/chatter/groups/0F9D000000006bOKAQ<br />

/members/requests<br />

Returns:<br />

Group Membership Request<br />

36


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Respond to request to join a private group<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameters:<br />

/chatter/group-memberships-requests/requestId<br />

PATCH<br />

Group Membership Request Update<br />

status and responseMessage<br />

The responseMessage parameter is used only if the value of status is Declined.<br />

Request body example:<br />

{<br />

}<br />

"status " : "Accepted"<br />

Request parameter<br />

example:<br />

/services/data/v27.0/chatter/group-membership-requests<br />

/0I5D000000002fwKAA?status=Accepted<br />

Returns:<br />

Group Membership Request<br />

Post to a group<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

/chatter/feeds/record/groupId/feed-items<br />

POST<br />

Feed item<br />

Text<br />

{ "body" :<br />

{<br />

"messageSegments" : [<br />

{<br />

"type": "Text",<br />

"text" : "Has everyone seen the latest building<br />

proposal?"<br />

}<br />

]<br />

}<br />

}<br />

Request parameter<br />

example:<br />

/feeds/record/0F9D000000006bO/feed-items?<br />

text=Has+everyone+seen+the+latest+building+proposal?<br />

Returns:<br />

Feed Item<br />

37


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Follow a record<br />

The subjectId is the ID of the item you want to follow.<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

Request parameter<br />

example:<br />

/chatter/users/me/following<br />

POST<br />

Following input<br />

subjectId<br />

{ "subjectId" : "001D000000Iyu2p" }<br />

/services/data/v27.0/chatter/users/me<br />

/following?subjectId=001D000000Iyu2p<br />

Returns:<br />

Subscription<br />

Unfollow records<br />

Note that a <strong>com</strong>plete structured resource is not returned, just a return code.<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Example:<br />

/chatter/subscriptions/subscriptionId<br />

DELETE<br />

NA<br />

NA<br />

/services/data/v27.0/chatter/subscriptions/0E8D00000001JkFKAU<br />

Returns:<br />

204: Successful Delete<br />

Send a private message<br />

Resource:<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

/chatter/users/me/messages/<br />

POST<br />

Messaging input<br />

recipients OR inReplyTo<br />

text<br />

38


<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Request body example:<br />

{ "body" : "Are we ready for next week's customer meeting?",<br />

"recipients" : ["005D0000001GOYpIAO", "005D0000001GbdHIAS"]<br />

}<br />

Request parameters<br />

example:<br />

/services/data/v27.0/chatter/users<br />

/me/messages?recipients=005D0000001GOYpIAO,<br />

005D0000001GbdHIAS&Are+we+ready+for+next+week's+customer+meeting?<br />

Returns:<br />

Message<br />

Build a user name auto<strong>com</strong>plete for @mentions<br />

Resource:<br />

HTTP method:<br />

Request parameter:<br />

Request parameters<br />

example:<br />

/chatter/users?q=searchtext where searchtext includes wildcards. For every two<br />

or three characters the user types, you can add a wildcard and get the list of matching user<br />

names. For example, /chatter/users?q=cha* finds all users whose user names begin<br />

with "cha".<br />

GET<br />

q=searchtext<br />

/services/data/v27.0/chatter/users?q=cha*<br />

Returns:<br />

User Page<br />

Return all user information for multiple users<br />

Resource:<br />

HTTP method:<br />

Request parameter:<br />

Request parameters<br />

example:<br />

/chatter/users/batch/user_list where user_list is a list of user Ids. Your app<br />

may need to call <strong>Chatter</strong> <strong>API</strong> twice: once to get the feed items and user Ids, the second time<br />

to call this resource with the list of user Ids.<br />

GET<br />

NA<br />

/services/data/v27.0/chatter/users<br />

/batch/005D0000001Kl6xIAC,005D0000005J3D4HVB, . . .<br />

Returns:<br />

Batch Results<br />

39


Chapter 4<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

The following are <strong>Chatter</strong> <strong>API</strong> resources:<br />

Resource<br />

Bookmarks Resources<br />

<strong>Chatter</strong> Resource on page 52<br />

Comments Resources<br />

Connect Resources<br />

Company Feed Resources<br />

Favorites Feed Resources<br />

Feeds Resource on page 65<br />

Description<br />

Feed made up of <strong>Chatter</strong> feed items posted to bookmarks saved by the logged-in user.<br />

Available resources are:<br />

Bookmarks Feed URL on page 47<br />

Bookmarks Feed Items on page 48<br />

Directory of the general resources available. Contains a single resource.<br />

Information about the specified <strong>com</strong>ment. Also used to delete a <strong>com</strong>ment, or to like a<br />

<strong>com</strong>ment.<br />

Available resources are:<br />

Comment on page 53<br />

Comment Likes on page 55<br />

Information about all possible resources, as well as the current user’s organization and<br />

settings.<br />

Available resources are:<br />

Connect on page 58<br />

Organization on page 59<br />

A feed that displays all posts and <strong>com</strong>ments from an entire <strong>com</strong>pany.<br />

Available resources are:<br />

Company Feed URL on page 56<br />

Company Feed Items on page 57<br />

Feeds made up of <strong>Chatter</strong> favorites saved by the logged-in user.<br />

Available resources are:<br />

List of Favorites on page 60<br />

Favorite on page 62<br />

Favorites Feed Items on page 64<br />

A list of all of the feeds the logged in user is able to view. Contains a single resource.<br />

40


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Resource<br />

Feed-Items Resources<br />

Files Resources<br />

Files Feed Resources<br />

Filter Feed Resources<br />

Groups Feed Resources<br />

Description<br />

Represents a specific feed item. Also used to query all feed items, post <strong>com</strong>ments to<br />

feed-items, as well as delete a specific feed item.<br />

Available resources are:<br />

Feed-Items Query on page 68<br />

Feed-Items, Specific Feed Item on page 69<br />

Feed-Items Comments on page 73<br />

Feed-Items Likes on page 77<br />

Feed-Items Polls on page 78<br />

Information about the specified file, including content, rendered version, and sharing.<br />

Available resources are:<br />

File Information on page 79<br />

File Content on page 82<br />

File Shares on page 82<br />

File Rendition on page 85<br />

File Information, Batch on page 86<br />

All feed items that contain files posted by people or groups that the current user follows.<br />

Available resources are:<br />

Files Feed URL on page 86<br />

Files Feed Items on page 87<br />

Feeds filtered by the specified criteria for the logged-in user.<br />

Available resources are:<br />

List of Filters on page 90<br />

Key Prefix Filter Feed on page 91<br />

Key Prefix Filtered Feed Items on page 92<br />

All feed items from all groups the current user either owns or is a member of.<br />

Note: To get the feed for a specific group, use the Record Feed Resource<br />

resource with a groupId.<br />

Available resources are:<br />

Groups Feed URL on page 94<br />

Groups Feed Items on page 95<br />

Group-Memberships Resources<br />

Access information about a member of a group, or remove a member from a group.<br />

Available resources are:<br />

Group Memberships Information on page 98<br />

41


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Resource<br />

Groups Resources<br />

Influence Resource on page 117<br />

Likes Resource on page 118<br />

Motifs Resources<br />

News Feed Resources<br />

People Feed Resources<br />

Record Feed Resource<br />

Description<br />

Batch Group Memberships on page 99<br />

Information about groups, such as the group's members, photo, and the groups in the<br />

organization. Also used to add members to a group and change the group photo. This<br />

is not a feed. To get the feed for a specific group, use the Record Feed Resource resource<br />

with a groupId.<br />

Available resources are:<br />

List of Groups on page 101<br />

Batch Group Information on page 105<br />

Group Files on page 105<br />

Group Information on page 103<br />

Group Members on page 107<br />

Group Members—Private on page 110<br />

Group Membership Requests—Private on page 113<br />

Group Photo on page 114<br />

Group Settings on page 116<br />

List of the percentile thresholds used to categorize an organization’s users by their<br />

influence in <strong>Chatter</strong>. Contains a single resource.<br />

Information about the specified like. Also used to delete a like. Contains a single resource.<br />

Returns URLs for sets of small, medium, and large motif icons. Records have different<br />

sets of motif icons depending on the record type.<br />

Available resources are:<br />

Motifs Resource on page 119<br />

Batch Motifs Resource on page 120<br />

The news feed of the current user. It is made up of items that are of interest to the current<br />

user. You can also use the feed-items resource to add feed-items.<br />

Available resources are:<br />

News Feed URL on page 121<br />

News Feed Is-Modified on page 122<br />

News Feed Items on page 123<br />

All feed items posted by all of the people the current user follows.<br />

Available resources are:<br />

People Feed URL on page 135<br />

People Feed Items on page 135<br />

The feed of the specified record, which could be a group, person, object, file and so on.<br />

Available resources are:<br />

42


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Resource<br />

Records Resources<br />

Subscriptions Resource on page 156<br />

To Feed Resources<br />

User-Profile Feed Resources<br />

Users Resources<br />

Description<br />

Record Feed URL on page 138<br />

Record Feed Items on page 139<br />

Information about the specified record, including followers. This is not a feed. To access<br />

a record feed, use the Record Feed Resource.<br />

Available resources are:<br />

Record Information on page 154<br />

Record Followers on page 155<br />

Information about the specified subscription. Also used to delete a subscription, for<br />

example, to unfollow a record. Contains a single resource.<br />

Feed of all @mentions of the current user and posts others make to the logged-in user's<br />

feed.<br />

Available resources are:<br />

To Feed URL on page 158<br />

To Feed Items on page 158<br />

Feed of actions by the current user on records that can be tracked in a feed. This is<br />

different than/chatter/feeds/news, which returns more items, including posts,<br />

group updates, and record updates. You can also post feed items to the user-profile feed.<br />

Available resources are:<br />

User–Profile Feed URL on page 161<br />

User–Profile Feed Items on page 162<br />

Information about the user, such as who is following the user, the user’s files or<br />

re<strong>com</strong>mendations. Also used for posting feed items and updating conversation status.<br />

This is not a feed. To access the user profile feed, use User-Profile Feed Resources.<br />

Available resources are:<br />

Batch User Information on page 174<br />

Change Status of Conversations on page 177<br />

Users Files, General on page 178<br />

User Files, Filtered by Group on page 181<br />

User Files, Filtered by Sharing on page 182<br />

Following Users on page 184<br />

User Information on page 172<br />

User Messages, General on page 186<br />

User Messages, Specific on page 192<br />

User Re<strong>com</strong>mendations, General on page 194<br />

Get Unread Count for Conversations on page 178<br />

User Conversations, General on page 174<br />

43


<strong>Chatter</strong> <strong>API</strong> Resources<br />

<strong>Chatter</strong> <strong>API</strong> Resources Relationships<br />

Resource<br />

Description<br />

User Conversations, Specific on page 176<br />

User Followers on page 183<br />

User Groups on page 186<br />

User Photo on page 193<br />

User Profile Information on page 173<br />

User Re<strong>com</strong>mendations for a Specific Action on page 197<br />

User Re<strong>com</strong>mendations for a Specific Action and Object Category on page 197<br />

User Re<strong>com</strong>mendations for a Specific Action and Key Prefix on page 199<br />

User Re<strong>com</strong>mendations for a Specific Action and Object ID on page 200<br />

User Settings on page 201<br />

<strong>Chatter</strong> <strong>API</strong> Resources Relationships<br />

Note: Communities are available as a pilot program. Contact your salesforce.<strong>com</strong> representative to find out if your<br />

organization qualifies for the <strong>com</strong>munity pilot.<br />

The following shows the relationships between the various resources.<br />

44


<strong>Chatter</strong> <strong>API</strong> Resources<br />

<strong>Chatter</strong> <strong>API</strong> Resources Relationships<br />

Figure 1: <strong>Chatter</strong> <strong>API</strong> Resources Relationships Part I<br />

45


<strong>Chatter</strong> <strong>API</strong> Resources<br />

<strong>Chatter</strong> <strong>API</strong> Resources Relationships<br />

Figure 2: <strong>Chatter</strong> <strong>API</strong> Resources Relationships Part II<br />

46


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Bookmarks Resources<br />

Bookmarks Resources<br />

Feed made up of <strong>Chatter</strong> feed items posted to bookmarks saved by the logged-in user.<br />

To bookmark an item, use PATCH with the Feed-Items resource and the isBookmarkedByCurrentUser parameter. For<br />

example:<br />

/chatter/feed-items/0D5D0000000Ir6zKAC?isBookmarkedByCurrentUser=true<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/bookmarks/me<br />

/chatter/feeds/bookmarks/me/feed-items<br />

Description<br />

Returns the URL for the bookmarks feed for the logged-in<br />

user.<br />

Returns all feed items for all bookmarks for the logged-in user.<br />

Bookmarks Feed URL<br />

Returns the URL for the bookmarks feed for the logged-in user.<br />

Resource<br />

/chatter/feeds/bookmarks/me<br />

OR<br />

/chatter/feeds/bookmarks/userId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameter<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

47


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Bookmarks Resources<br />

Response body<br />

Feed<br />

Bookmarks Feed Items<br />

Returns all feed items for all bookmarks for the logged-in user.<br />

Resource<br />

/chatter/feeds/bookmarks/me/feed-items<br />

OR<br />

/chatter/feeds/bookmarks/userId/feed-items<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

sort<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

48


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Bookmarks Resources<br />

Parameter Name<br />

Type<br />

Description<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed Item Page<br />

Example response body<br />

{<br />

"currentPageUrl": "/services/data/v27.0/chatter/feeds/bookmarks/<br />

005D0000001LL8OIAW/feed-items",<br />

"isModifiedToken": null,<br />

"isModifiedUrl": null,<br />

"items": [{<br />

"actor": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl": "https://instance_name/ncsphoto/<br />

SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sY0heczeNaGmYGdLWP8_jwf",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl": "https://instance_name/ncsphoto/<br />

SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saxNHGd3SJobWSeBWfI9EzW",<br />

"url": "/services/data/v27.0/chatter/users<br />

/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"attachment": null,<br />

"body": {<br />

"messageSegments": [{<br />

"text": "I have contacts at this <strong>com</strong>pany. Feel free to ping me for<br />

information.",<br />

"type": "Text"<br />

}],<br />

"text": "I have contacts at this <strong>com</strong>pany. Feel free to ping me for information."<br />

},<br />

"canShare": true,<br />

"clientInfo": null,<br />

"<strong>com</strong>ments": {<br />

"<strong>com</strong>ments": [],<br />

"currentPageUrl": "/services/data/v27.0/chatter/feed-items<br />

/0D5D0000000IYyoKAG/<strong>com</strong>ments",<br />

49


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Bookmarks Resources<br />

"nextPageUrl": null,<br />

"total": 0<br />

},<br />

"createdDate": "2012-10-30T21:38:43.000Z",<br />

"event": false,<br />

"id": "0D5D0000000IYyoKAG",<br />

"isBookmarkedByCurrentUser": true,<br />

"isDeleteRestricted": false,<br />

"isLikedByCurrentUser": false,<br />

"likes": {<br />

"currentPageUrl": "/services/data/v27.0/chatter/feed-items<br />

/0D5D0000000IYyoKAG/likes",<br />

"likes": [],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

},<br />

"likesMessage": null,<br />

"modifiedDate": "2012-11-08T20:29:48.000Z",<br />

"myLike": null,<br />

"originalFeedItem": null,<br />

"originalFeedItemActor": null,<br />

"parent": {<br />

"id": "001D000000JDsCDIA1",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/accounts64.png",<br />

"mediumIconUrl": "/img/icon/accounts32.png",<br />

"smallIconUrl": "/img/icon/accounts16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T780KAC",<br />

"url": "/services/data/v27.0/chatter/subscriptions<br />

/0E8D0000000T780KAC"<br />

},<br />

"name": "Hazel",<br />

"type": "Account",<br />

"url": "/services/data/v27.0/chatter/records<br />

/001D000000JDsCDIA1"<br />

},<br />

"photoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"preamble": {<br />

"messageSegments": [<br />

{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/accounts64.png",<br />

"mediumIconUrl": "/img/icon/accounts32.png",<br />

"smallIconUrl": "/img/icon/accounts16.png"<br />

},<br />

"reference": {<br />

"id": "001D000000JDsCDIA1",<br />

"url": "/services/data/v27.0/chatter/records<br />

/001D000000JDsCDIA1"<br />

},<br />

"text": "Hazel",<br />

"type": "EntityLink"<br />

},<br />

{<br />

"text": " \u2014 ",<br />

"type": "Text"<br />

},<br />

{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

50


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Bookmarks Resources<br />

}<br />

},<br />

{<br />

},<br />

{<br />

"reference": {<br />

"id": "005D0000001LL8OIAW",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW"<br />

},<br />

"text": "Deanna Li",<br />

"type": "EntityLink"<br />

"text": " to ",<br />

"type": "Text"<br />

"text": "Universal Containers Only",<br />

"type": "Text"<br />

}<br />

],<br />

"text": "Hazel \u2014 Deanna Li to Universal Containers Only"<br />

},<br />

"topics": null,<br />

"type": "TextPost",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000IYyoKAG",<br />

"visibility": "InternalUsers"<br />

}],<br />

"nextPageUrl": null<br />

Bookmarks Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

/chatter/feeds/bookmarks/me/feed-items/flat<br />

or<br />

/chatter/feeds/bookmarks/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

51


<strong>Chatter</strong> <strong>API</strong> Resources<br />

<strong>Chatter</strong> Resource<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

Integer<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

<strong>Chatter</strong> Resource<br />

Directory of the general resources available.<br />

Resource<br />

/chatter<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

<strong>Chatter</strong> Directory<br />

52


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Comments Resources<br />

Example response body<br />

{<br />

}<br />

"feeds": "/services/data/v27.0/chatter/feeds",<br />

"groups": "/services/data/v27.0/chatter/groups",<br />

"users": "/services/data/v27.0/chatter/users"<br />

Comments Resources<br />

Information about the specified <strong>com</strong>ment. Also used to delete a <strong>com</strong>ment, or to like a <strong>com</strong>ment.<br />

Available resources:<br />

Resource<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId/likes<br />

Description<br />

Returns information about the specified <strong>com</strong>ment. Also used<br />

to delete a <strong>com</strong>ment.<br />

Returns information about the likes for the specified <strong>com</strong>ment.<br />

Also used to add a like to a <strong>com</strong>ment.<br />

Comment<br />

Returns information about the specified <strong>com</strong>ment. Also used to delete a <strong>com</strong>ment.<br />

Resource<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, DELETE or HEAD<br />

Response body for GET or HEAD<br />

Comment<br />

Example<br />

You can find the ID for a specific <strong>com</strong>ment from any feed, such as a news feed or a record feed.<br />

Use the following resource and the HTTP method GET to return information about a <strong>com</strong>ment:<br />

/chatter/<strong>com</strong>ments/0D7D00000000NtkKAE<br />

Which returns the following:<br />

{<br />

"attachment": null,<br />

53


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Comments Resources<br />

"body": {<br />

"messageSegments": [<br />

{<br />

"accessible": true,<br />

"name": "Martin Fredrick",<br />

"text": "@Martin Fredrick",<br />

"type": "Mention",<br />

"user": {<br />

"<strong>com</strong>panyName": null,<br />

"firstName": "Martin",<br />

"id": "005D0000001LJvRIAW",<br />

"isActive": true,<br />

"lastName": "Fredrick",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T59zKAC",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T59zKAC"<br />

},<br />

"name": "Martin Fredrick",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1i9x6Z16L8wXEGigpcWjAd",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyWvj8Hy5cv5voDy7d7Kam12q55tdEhTcGehjW_lHrWP",<br />

},<br />

{<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LJvRIAW",<br />

"userType": "Internal"<br />

"text": " Please review.",<br />

"type": "Text"<br />

}<br />

],<br />

"text": "@Martin Fredrick Please review."<br />

},<br />

"clientInfo": null,<br />

"createdDate": "2012-07-17T22:07:42.000Z",<br />

"feedItem": {<br />

"id": "0D5D0000000HxSuKAK",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000HxSuKAK"<br />

},<br />

"id": "0D7D00000000NtkKAE",<br />

"isDeleteRestricted": false,<br />

"likes": {<br />

"currentPageUrl": null,<br />

"likes": [],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

54


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Comments Resources<br />

},<br />

"myLike": null,<br />

"parent": {<br />

"id": "0F9D00000000HwEKAU",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000HwEKAU"<br />

},<br />

"type": "TextComment",<br />

"url": "/services/data/v27.0/chatter/<strong>com</strong>ments/0D7D00000000NtkKAE",<br />

"user": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

}, "mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyWvj8Hy5cv5voDy7d7Kam0yU5fZl49rmMAeVigTKI9v",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyWvj8Hy5cv5voDy7d7Kam12q55tdEhTcGehjW_lHrWP",<br />

}<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLOBIA4/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

Comment Likes<br />

Returns information about the likes for the specified <strong>com</strong>ment. Also used to add a like to a <strong>com</strong>ment.<br />

Resource<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId/likes<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST or HEAD<br />

Request parameters for GET or HEAD<br />

Note: POST takes no request parameters, nor a request body.<br />

55


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Company Feed Resources<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Integer<br />

Integer<br />

Description<br />

Specifies the number of the page you<br />

want returned.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Response body for GET or HEAD<br />

Like Page<br />

Response body for POST<br />

Like<br />

Company Feed Resources<br />

A feed that displays all posts and <strong>com</strong>ments from an entire <strong>com</strong>pany. This includes posts and <strong>com</strong>ments from:<br />

• People in the <strong>com</strong>pany, the ones a user follows and the ones a user doesn’t follow<br />

• Public groups, including the ones a user is not a member of<br />

• Private groups a user is a member of<br />

• Updates for records and fields that an administrator configured for feed tracking, including the ones a user is not following.<br />

However, a user only sees updates for records they are allowed to access.<br />

Please note the following:<br />

• These resources are not available for <strong>com</strong>munities.<br />

• Only the administrator for the organization has access to these resources.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/<strong>com</strong>pany<br />

/chatter/feeds/<strong>com</strong>pany/feed-items<br />

Description<br />

Returns a URL to the <strong>com</strong>pany feed.<br />

Returns the feed items of a <strong>com</strong>pany feed.<br />

Company Feed URL<br />

Returns a URL to the <strong>com</strong>pany feed.<br />

Resource<br />

/chatter/feeds/<strong>com</strong>pany<br />

Available since version<br />

23.0<br />

56


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Company Feed Resources<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

Example response body<br />

{<br />

}<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/<strong>com</strong>pany/feed-items",<br />

"isModifiedUrl": null<br />

Company Feed Items<br />

Returns the feed items of a <strong>com</strong>pany feed.<br />

Resource<br />

/chatter/feeds/<strong>com</strong>pany/feed-items<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

57


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Connect Resources<br />

Parameter Name<br />

Type<br />

Description<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

sort<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed Item Page<br />

Connect Resources<br />

Information about all possible resources, as well as the current user’s organization and settings.<br />

Note: These resources have the base URL of /services/data/v27.0/connect, not<br />

/services/data/v27.0/chatter.<br />

Available resources are:<br />

Resource<br />

/connect<br />

/connect/organization<br />

Description<br />

List of all resources in the organization, as well as all<br />

<strong>com</strong>munity resources available to the current user.<br />

Information about the current user’s organization and settings.<br />

Connect<br />

Note: Communities are available as a pilot program. Contact your salesforce.<strong>com</strong> representative to find out if your<br />

organization qualifies for the <strong>com</strong>munity pilot.<br />

58


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Connect Resources<br />

List of all resources in the organization, as well as all <strong>com</strong>munity resources available to the current user.<br />

Resource<br />

/connect<br />

Available since version<br />

26.0<br />

HTTP methods<br />

GET and HEAD<br />

Response body<br />

Comment Page<br />

Organization<br />

Information about the current user’s organization and settings.<br />

Resource<br />

/connect/organization<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Organization<br />

Example response body<br />

{<br />

"accessTimeout": 0,<br />

"features": {<br />

"chatter": true,<br />

"chatterActivity": true,<br />

"chatterGlobalInfluence": true,<br />

"chatterMessages": true,<br />

"chatterTopics": false,<br />

"dashboardComponentSnapshots": false,<br />

"feedPolling": false,<br />

"files": true,<br />

"filesOnComments": true,<br />

"trendingTopics": true,<br />

"viralInvitesAllowed": true<br />

},<br />

"name": "SeattleApps",<br />

"orgId": "00DD0000000JfSyMAK",<br />

"userSettings": {<br />

"approvalPosts": true,<br />

"canFollow": true,<br />

"canModifyAllData": true,<br />

"canOwnGroups": true,<br />

59


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Favorites Feed Resources<br />

}<br />

}<br />

"canViewAllData": true,<br />

"canViewAllGroups": true,<br />

"canViewAllUsers": true,<br />

"canViewFullUserProfile": true,<br />

"canViewPublicFiles": true,<br />

"externalUser": false,<br />

"hasFileSync": false,<br />

"userId": "005D0000001LFNnIAO",<br />

"userLocale": "en_US"<br />

See Also:<br />

News Feed Resources<br />

Favorites Feed Resources<br />

Feeds made up of <strong>Chatter</strong> favorites saved by the logged-in user. Favorites are feed searches, list views, and topics that the<br />

logged-in user has added as a <strong>Chatter</strong> favorite.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/favorites/me<br />

/chatter/feeds/favorites/me/favoriteId<br />

Description<br />

Returns a list of all the favorites for the logged-in user. Creates<br />

a favorite of a <strong>Chatter</strong> feed search.<br />

Returns the feed for the specified favorite. Deletes the specified<br />

favorite. Updates the last view date of the specified favorite.<br />

/chatter/feeds/favorites/me/favoriteId/feed-items<br />

Returns a filtered feed, only showing those feed items for the<br />

specified favorite.<br />

List of Favorites<br />

Returns a list of all the favorites for the logged-in user. Creates a favorite of a <strong>Chatter</strong> feed search.<br />

Resource<br />

or<br />

/chatter/feeds/favorites/me<br />

/chatter/feeds/favorites/userId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

24.0<br />

60


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Favorites Feed Resources<br />

HTTP methods<br />

GET, HEAD, or POST<br />

Request body for POST<br />

Root XML tag<br />

<br />

Properties for POST<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

searchText<br />

String<br />

Text of the feed search.<br />

This parameter can only be<br />

used with saved searches<br />

and not list views.<br />

24.0<br />

Request parameters for POST<br />

Name<br />

searchText<br />

Type<br />

String<br />

Description<br />

Text of the feed search. This parameter<br />

can only be used with saved searches<br />

and not list views.<br />

Response body for GET or HEAD<br />

Favorites Page<br />

Response body for POST<br />

Favorite<br />

Sample response body for GET<br />

{<br />

"favorites": [{<br />

"<strong>com</strong>munity": null,<br />

"createdBy": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1i9x6Z16L8wXEGigpcWjAd",<br />

61


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Favorites Feed Resources<br />

"largePhotoUrl": "https://instance_name/profilephoto/005/F",<br />

"photoVersionId": null,<br />

"smallPhotoUrl": "https://instance_name/profilephoto/005/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyWvj8Hy5cv5voDy7d7Kam12q55tdEhTcGehjW_lHrWP",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"feedUrl":<br />

"/services/data/v27.0/chatter/feeds/favorites/me/07FD00000000Q1CMAU/feed-items",<br />

"id": "07FD00000000Q1CMAU",<br />

"lastViewDate": "2012-07-17T22:52:29.000Z",<br />

"name": "dreamforce",<br />

"searchText": "dreamforce",<br />

"type": "Search",<br />

"url": "/services/data/v27.0/chatter/feeds/favorites/me/07FD00000000Q1CMAU",<br />

"user": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes", "motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

}<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1i9x6Z16L8wXEGigpcWjAd",<br />

"largePhotoUrl": "https://instance_name/profilephoto/005/F",<br />

"photoVersionId": null,<br />

"smallPhotoUrl": "https://instance_name/profilephoto/005/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyWvj8Hy5cv5voDy7d7Kam12q55tdEhTcGehjW_lHrWP",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

}<br />

}],<br />

"total": 1<br />

Favorite<br />

Returns the feed for the specified favorite. Deletes the specified favorite. Updates the last view date of the specified favorite.<br />

Resource<br />

/chatter/feeds/favorites/me/favoriteId<br />

62


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Favorites Feed Resources<br />

or<br />

/chatter/feeds/favorites/userId/favoriteId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET, HEAD, PATCH, or DELETE<br />

Request parameter for GET or HEAD<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Request body for PATCH<br />

Root XML tag<br />

<br />

Properties for PATCH<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

updateLastViewDate<br />

Boolean<br />

Sets the last view date of<br />

the specified feed favorite<br />

to the current system time.<br />

Default value is false.<br />

24.0<br />

Request parameter for PATCH<br />

Parameter Name<br />

updateLastViewDate<br />

Type<br />

Boolean<br />

Description<br />

Sets the last view date of the specified<br />

feed favorite to the current system time.<br />

Default value is false.<br />

63


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Favorites Feed Resources<br />

Response body for GET or HEAD<br />

Favorite<br />

Response body for PATCH<br />

Favorite<br />

Favorites Feed Items<br />

Returns a filtered feed, only showing those feed items for the specified favorite.<br />

Resource<br />

/chatter/feeds/favorites/me/favoriteId/feed-items<br />

or<br />

/chatter/feeds/favorites/userId/favoriteId/feed-items<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

Integer<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

64


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feeds Resource<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed Item Page<br />

Feeds Resource<br />

A list of all of the feeds the logged in user is able to view.<br />

Each user may have a different set of feeds. Use this resource to determine what feeds are available. In addition, the different<br />

feeds may have unique labels as well as URLs. Use the given labels returned in this resource and avoid hard-coding any of<br />

these values.<br />

Resource<br />

/chatter/feeds/<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Feed Directory<br />

Example response body<br />

{<br />

"favorites": [{<br />

"<strong>com</strong>munity": null,<br />

"createdBy": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

65


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feeds Resource<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T"<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"feedUrl":<br />

"/services/data/v27.0/chatter/feeds/favorites/me/07FD00000000Q1CMAU/feed-items",<br />

"id": "07FD00000000Q1CMAU",<br />

"lastViewDate": "2012-07-17T22:52:29.000Z",<br />

"name": "dreamforce",<br />

"searchText": "dreamforce",<br />

"type": "Search",<br />

"url": "/services/data/v27.0/chatter/feeds/favorites/me/07FD00000000Q1CMAU",<br />

"user": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T"<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

}<br />

}],<br />

"feeds": [<br />

{<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/bookmarks/me/feed-items",<br />

},<br />

{<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/bookmarks/me",<br />

"label": "Bookmarked"<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/files/me/feed-items",<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/files/me",<br />

66


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Resources<br />

},<br />

{<br />

},<br />

{<br />

},<br />

{<br />

},<br />

{<br />

},<br />

{<br />

"label": "Files"<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/groups/me/feed-items",<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/groups/me",<br />

"label": "Groups"<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/news/me/feed-items",<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/news/me",<br />

"label": "What I Follow"<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/people/me/feed-items",<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/people/me",<br />

"label": "People"<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/record/me/feed-items",<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/record/me",<br />

"label": "Record"<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/to/me/feed-items",<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/to/me",<br />

"label": "To Me"<br />

},<br />

{<br />

"feedItemsUrl": "/services/data/v27.0/chatter/feeds/user-profile/me/feed-items",<br />

]<br />

}<br />

"feedUrl": "/services/data/v27.0/chatter/feeds/user-profile/me",<br />

"label": "User Profile"<br />

Feed-Items Resources<br />

Represents a specific feed item. Also used to query all feed items, post <strong>com</strong>ments to feed-items, as well as delete a specific<br />

feed item.<br />

Available resources:<br />

Resource<br />

/chatter/feed-items?q=searchTerm<br />

/chatter/feed-items/feedItemId<br />

Description<br />

Used to search for specific feed items.<br />

The query parameter (q) is required with<br />

this resource. All types of feed items are<br />

searched, including tracked changes. A<br />

search returns feed items with the search<br />

term in the feed item body, as well as feed<br />

items that have <strong>com</strong>ments that contain<br />

the search term.<br />

Used to access or delete a specific feed<br />

item. Also used to mark a feed item as<br />

bookmarked.<br />

67


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Query<br />

Resource<br />

/chatter/feed-items/feedItemId/<strong>com</strong>ments<br />

/chatter/feed-items/feedItemId/likes<br />

Description<br />

Access the latest three <strong>com</strong>ments for a<br />

specific feed item or post a <strong>com</strong>ment.<br />

Used to access likes for a specific feed<br />

item, or to add a like to a specific feed<br />

item.<br />

Feed-Items Query<br />

Used to search for specific feed items. The query parameter (q) is required with this resource. All types of feed items are<br />

searched, including tracked changes. A search returns feed items with the search term in the feed item body, as well as feed<br />

items that have <strong>com</strong>ments that contain the search term. You can also use wildcards with the query parameter.<br />

Resource<br />

/chatter/feed-items?q=searchTerm<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

Type<br />

Description<br />

Available<br />

Since<br />

page<br />

String<br />

A generated token that indicates the view of feed items in the<br />

feed.<br />

23.0<br />

pageSize<br />

Integer<br />

Specifies the number of items per page. Valid values are<br />

between 1 and 100. If you don't specify a size, the default is<br />

25.<br />

23.0<br />

q<br />

String<br />

Specifies the string to search. The search string must contain<br />

at least two characters, not including any wildcards. For more<br />

information about wildcards, see Using Wildcards.<br />

23.0<br />

Note: The query parameter searches all types of feed items, including tracked changes. The search returns feed<br />

items with the search term in the feed item body, as well as feed items that have <strong>com</strong>ments that contain the<br />

search term.<br />

Response body<br />

Feed Item Page<br />

68


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items, Specific Feed Item<br />

Feed-Items, Specific Feed Item<br />

Used to access or delete a specific feed item. Also used to mark a feed item as bookmarked.<br />

Resource<br />

/chatter/feed-items/feedItemId<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, DELETE, PATCH, or HEAD<br />

Request body for PATCH<br />

In XML form, the root XML tag is expected to be .<br />

Parameter Name<br />

isBookmarkedByCurrentUser<br />

Type<br />

Boolean<br />

Description<br />

Specify true to add the current feed<br />

item to the list of bookmarked feed<br />

items for the current user. Specify<br />

false to remove this feed item from<br />

the list of bookmarked feed items for<br />

the current user.<br />

Request parameter for PATCH<br />

Parameter Name<br />

isBookmarkedByCurrentUser<br />

Type<br />

Boolean<br />

Description<br />

Specify true to add the current feed<br />

item to the list of bookmarked feed<br />

items for the current user. Specify<br />

false to remove this feed item from<br />

the list of bookmarked feed items for<br />

the current user.<br />

Response body for GET, PATCH, or HEAD<br />

Feed Item<br />

Example response body<br />

{<br />

"actor": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Pam",<br />

"id": "005D0000001LLOBIA4",<br />

"isActive": true,<br />

"lastName": "Jones",<br />

69


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items, Specific Feed Item<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T5ZeKAK",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5ZeKAK"<br />

},<br />

"name": "Pam Jones",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEMr0vGaMXWexPO6dLMe-pvnqPDbj_JcECRt9UYGCUHS",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJP/F",<br />

"photoVersionId": "729D00000000LJPIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJP/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEMr0vGaMXWexPO6dLMe-psauUpms4pS8qMTLGMq5tZR",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLOBIA4/photo"<br />

},<br />

"title": "IT Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLOBIA4",<br />

"userType": "Internal"<br />

},<br />

"attachment": {<br />

"choices": [<br />

{<br />

"id": "09AD000000000AxMAI",<br />

"position": 1,<br />

"text": "Developer Console",<br />

"voteCount": 1,<br />

"voteCountRatio": 1<br />

},<br />

{<br />

"id": "09AD000000000AyMAI",<br />

"position": 2,<br />

"text": "Force.<strong>com</strong> IDE",<br />

"voteCount": 0,<br />

"voteCountRatio": 0<br />

}<br />

],<br />

"myChoiceId": "09AD000000000AxMAI",<br />

"totalVoteCount": 1<br />

},<br />

"body": {<br />

"messageSegments": [{<br />

"text": "Which dev tool do you use more often?",<br />

"type": "Text"<br />

}],<br />

"text": "Which dev tool do you use more often?"<br />

},<br />

"canShare": false,<br />

"clientInfo": null,<br />

"<strong>com</strong>ments": {<br />

"<strong>com</strong>ments": [{<br />

"attachment": null,<br />

"body": {<br />

"messageSegments": [{<br />

"text": "I use the ANT Migration Tool more than either of these.",<br />

"type": "Text"<br />

}],<br />

"text": "I use the ANT Migration Tool more than either of these."<br />

},<br />

70


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items, Specific Feed Item<br />

"clientInfo": null,<br />

"createdDate": "2012-09-12T23:54:42.000Z",<br />

"feedItem": {<br />

"id": "0D5D0000000HwlIKAS",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000HwlIKAS"<br />

},<br />

"id": "0D7D00000000NyKKAU",<br />

"isDeleteRestricted": false,<br />

"likes": {<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/<strong>com</strong>ments/0D7D00000000NyKKAU/likes",<br />

"likes": [],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

},<br />

"likesMessage": null,<br />

"myLike": null,<br />

"parent": {<br />

"id": "0F9D00000000I4OKAU",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000I4OKAU"<br />

},<br />

"type": "TextComment",<br />

"url": "/services/data/v27.0/chatter/<strong>com</strong>ments/0D7D00000000NyKKAU",<br />

"user": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

}<br />

}],<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000HwlIKAS/<strong>com</strong>ments",<br />

"nextPageUrl": null,<br />

"total": 1<br />

},<br />

"createdDate": "2012-09-12T00:58:52.000Z",<br />

"event": false,<br />

"id": "0D5D0000000HwlIKAS",<br />

"isBookmarkedByCurrentUser": true,<br />

71


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items, Specific Feed Item<br />

"isDeleteRestricted": false,<br />

"isLikedByCurrentUser": false,<br />

"likes": {<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000HwlIKAS/likes",<br />

"likes": [],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

},<br />

"likesMessage": null,<br />

"modifiedDate": "2012-09-12T23:54:42.000Z",<br />

"myLike": null,<br />

"originalFeedItem": null,<br />

"originalFeedItemActor": null,<br />

"parent": {<br />

"canHave<strong>Chatter</strong>Guests": false,<br />

"<strong>com</strong>munity": null,<br />

"description": "A group for people building Force.<strong>com</strong> apps.",<br />

"fileCount": 1,<br />

"id": "0F9D00000000I4OKAU",<br />

"lastFeedItemPostDate": "2012-09-13T16:11:51.000Z",<br />

"memberCount": 2,<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

"myRole": "GroupOwner",<br />

"mySubscription": {<br />

"id": "0FBD00000002vOVOAY",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002vOVOAY"<br />

},<br />

"name": "App Builders",<br />

"owner": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl":<br />

"https://instance_namec.na1-blitz02.content.soma.force.<strong>com</strong>/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.027.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

72


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Comments<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyMkZkpEttUCohuRK3CoTiCHVH-ymjcxVfbaCBWV-Myc",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJK/F",<br />

"photoVersionId": "729D00000000LJKIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJK/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyMkZkpEttUCohuRK3CoTiB0odq_wQk-3SKlQQYp-u8G",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"type": "CollaborationGroup",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000I4OKAU",<br />

"visibility": "PublicAccess"<br />

},<br />

"photoUrl": "https://instance_name/profilephoto/729D00000000LJP/T",<br />

"preamble": {<br />

"messageSegments": [{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"reference": {<br />

"id": "005D0000001LLOBIA4",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLOBIA4"<br />

},<br />

"text": "Pam Jones",<br />

"type": "EntityLink"<br />

}],<br />

"text": "Pam Jones"<br />

},<br />

"topics": null,<br />

"type": "PollPost",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000HwlIKAS",<br />

"visibility": "AllUsers"<br />

Feed-Items Comments<br />

Access the latest three <strong>com</strong>ments for a specific feed item or post a <strong>com</strong>ment.<br />

For information about posting a <strong>com</strong>ment, see Using POST, PATCH, or PUT for Input.<br />

To upload a binary file to attach to a <strong>com</strong>ment, you must send it in a multipart/form-data request. To send the text of the<br />

<strong>com</strong>ment, you can choose to include a JSON or XML rich input body part in the multipart/form-data request. Alternately,<br />

you can choose to pass the information in request parameter parts. For information about how to create the multipart/form-data<br />

message, see Uploading Binary Files.<br />

Resource<br />

/chatter/feed-items/feedItemId/<strong>com</strong>ments<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST or HEAD<br />

73


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Comments<br />

Request body for POST<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

attachment<br />

Type<br />

Depends on type.<br />

Description<br />

Optional. Values are:<br />

• Attachment Input: Existing Content<br />

• Attachment Input: New File Upload<br />

Note: To upload a new file,<br />

you must include it in a<br />

multipart/form–data message.<br />

See Uploading Binary Files.<br />

Available<br />

Version<br />

24.0<br />

body<br />

Message Body Input<br />

Description of message body<br />

23.0<br />

Request parameters for POST<br />

Parameters for attaching an existing file<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Available Version<br />

attachmentType<br />

String<br />

The type of attachment. Must contain<br />

the value ExistingContent.<br />

Required<br />

27.0<br />

contentDocumentId<br />

String<br />

ID of an existing file to be posted.<br />

Required<br />

24.0<br />

text<br />

String<br />

Text of the <strong>com</strong>ment.<br />

Optional<br />

23.0<br />

Parameters for attaching a new file<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Available Version<br />

attachmentType<br />

String<br />

The type of attachment. Must contain<br />

the value NewFile.<br />

Required<br />

27.0<br />

desc<br />

String<br />

Description of file being posted.<br />

Optional<br />

24.0<br />

text<br />

String<br />

Text of the <strong>com</strong>ment.<br />

Optional<br />

23.0<br />

title<br />

String<br />

Title of the file.<br />

Required<br />

24.0<br />

Parameters for posting text<br />

74


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Comments<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional Available Version<br />

text<br />

String<br />

The <strong>com</strong>ment text.<br />

Required<br />

23.0<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Available Version<br />

page<br />

String<br />

A generated token that Optional<br />

indicates the view of<br />

feed items in the feed.<br />

Page tokens are<br />

returned as part of the<br />

response body, in one<br />

of the URL<br />

parameters, such as<br />

nextPageURL.<br />

23.0<br />

pageSize<br />

Integer<br />

Specifies the number<br />

of items per page.<br />

Valid values are<br />

between 1 and 100. If<br />

you don't specify a<br />

size, the default is 25.<br />

Optional<br />

23.0<br />

Response body for GET or HEAD<br />

Comment Page<br />

Response body for POST<br />

Comment<br />

Example response body using POST<br />

{<br />

"<strong>com</strong>ments": [{<br />

"attachment": null,<br />

"body": {<br />

"messageSegments": [<br />

{<br />

"accessible": true,<br />

"name": "Martin Fredrick",<br />

"text": "@Martin Fredrick",<br />

"type": "Mention",<br />

"user": {<br />

"<strong>com</strong>panyName": null,<br />

"firstName": "Martin",<br />

"id": "005D0000001LJvRIAW",<br />

"isActive": true,<br />

"lastName": "Fredrick",<br />

"mySubscription": {<br />

"id": "0E8D0000000T59zKAC",<br />

"url":<br />

"/services/data/v27.0/chatter/subscriptions/0E8D0000000T59zKAC"<br />

},<br />

75


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Comments<br />

"name": "Martin Fredrick",<br />

"photo": {<br />

"largePhotoUrl":<br />

"https://instance_name/profilephoto/729D000000007ux/F",<br />

"photoVersionId": "729D000000007ux",<br />

"smallPhotoUrl":<br />

"https://instance_name/profilephoto/729D000000007ux/T"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LJvRIAW",<br />

"userType": "Internal"<br />

}<br />

},<br />

{<br />

"text": " Please review.",<br />

"type": "Text"<br />

}<br />

],<br />

"text": "@Martin Fredrick Please review."<br />

},<br />

"clientInfo": null,<br />

"createdDate": "2012-07-17T22:07:42.000Z",<br />

"feedItem": {<br />

"id": "0D5D0000000HxSuKAK",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000HxSuKAK"<br />

},<br />

"id": "0D7D00000000NtkKAE",<br />

"isDeleteRestricted": false,<br />

"likes": {<br />

"currentPageUrl": null,<br />

"likes": [],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

},<br />

"myLike": null,<br />

"parent": {<br />

"id": "0F9D00000000HwEKAU",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000HwEKAU"<br />

},<br />

"type": "TextComment",<br />

"url": "/services/data/v27.0/chatter/<strong>com</strong>ments/0D7D00000000NtkKAE",<br />

"user": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D000000007ux/F",<br />

"photoVersionId": "729D000000007ux",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D000000007ux/T"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

}<br />

}],<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000HxSuKAK/<strong>com</strong>ments",<br />

"nextPageUrl": null,<br />

76


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Likes<br />

}<br />

"total": 1<br />

Feed-Items Likes<br />

Used to access likes for a specific feed item, or to add a like to a specific feed item.<br />

Resource<br />

/chatter/feed-items/feedItemId/likes<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST or HEAD<br />

Request parameters for GET or HEAD<br />

Note: There aren’t any request parameters for POST.<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Integer<br />

Integer<br />

Description<br />

Specifies the number of the page you<br />

want returned.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Response body for GET or HEAD<br />

Like Page<br />

Response body for POST<br />

Like<br />

Example response body with GET<br />

{<br />

"currentPageUrl": "/services/data/v27.0/chatter/feed-items/0D5D0000000IPZuKAO/likes",<br />

"likes": [{<br />

"id": "0I0D000000003KeKAI",<br />

"likedItem": {<br />

"id": "0D5D0000000IPZuKAO",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000IPZuKAO"<br />

},<br />

"url": "/services/data/v27.0/chatter/likes/0I0D000000003KeKAI",<br />

"user": {<br />

77


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Feed-Items Polls<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

}<br />

}],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 1<br />

Feed-Items Polls<br />

Used to access or vote in an existing poll.<br />

Resource<br />

/chatter/feed-items/feedItemId/poll<br />

The feedItemId must have the type PollPost.<br />

Available since version<br />

26.0<br />

HTTP methods<br />

GET, PATCH or HEAD<br />

Use PATCH to either vote in an existing poll, or change the current user’s vote.<br />

Request body for PATCH<br />

Root XML tag<br />

<br />

78


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Resources<br />

Properties<br />

Name<br />

myChoiceId<br />

Type<br />

String<br />

Description<br />

Id of an existing choice on 26.0<br />

the feed poll. Used to<br />

specify the Id of the poll<br />

choice that the current user<br />

is voting on.<br />

Available Version<br />

Request parameters for PATCH<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

myChoiceId<br />

String<br />

Id of an existing choice on<br />

the feed poll. Used to specify<br />

the Id of the poll choice that<br />

the current user is voting on.<br />

26.0<br />

Response body<br />

Feed Item Attachment: Poll<br />

Files Resources<br />

Information about the specified file, including content, rendered version, and sharing.<br />

Available resources are:<br />

Resource<br />

/chatter/files/fileId<br />

/chatter/files/fileId/content<br />

/chatter/files/fileId/file-shares<br />

/chatter/files/fileId/rendition<br />

/chatter/files/batch/fileIds<br />

Description<br />

Return details about the specified file. Can also be used to<br />

rename an existing file.<br />

Return the content of the file. The content is streamed as the<br />

body of the response.<br />

Returns information about the entities with which the specified<br />

file has been shared. These can be users, groups, or records.<br />

Returns a rendition of the file. A rendition is a binary preview<br />

of the file. The format of the binary depends on the format<br />

specified in the request.<br />

Returns information for a list of files, specified by file IDs.<br />

File Information<br />

Return details about the specified file. Can also be used to rename an existing file.<br />

79


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Resources<br />

Resource<br />

/chatter/files/fileId<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET, POST, PATCH, DELETE, or HEAD<br />

Note: POST, PATCH, and DELETE available since version 26.0.<br />

Request body for POST<br />

Can only be used to update an existing file.<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

desc<br />

String<br />

Description of the file to be<br />

uploaded<br />

24.0<br />

title<br />

String<br />

Title of the file<br />

24.0<br />

Request parameters for GET or HEAD<br />

Name<br />

versionNumber<br />

Type<br />

Integer<br />

Description<br />

Specify an existing version number for<br />

the file. If not specified, the latest<br />

version is returned.<br />

Request parameters for PATCH<br />

Name<br />

title<br />

Type<br />

String<br />

Description<br />

Specify a new title for the file. Used to<br />

rename an existing file.<br />

Response body for GET, POST, PATCH, or HEAD<br />

File Details<br />

Response body for DELETE<br />

Returns a status code of 204.<br />

80


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Resources<br />

Example response body<br />

{<br />

"checksum": "a65b71bc6a31fa95dd0a9232c9f58c86",<br />

"contentSize": 100377,<br />

"contentUrl": null,<br />

"description": null,<br />

"downloadUrl":<br />

"/services/data/v27.0/chatter/files/069D00000001E32IAE/content?versionNumber=1",<br />

"fileExtension": "png",<br />

"fileType": "Png",<br />

"flashRenditionStatus": "Na",<br />

"id": "069D00000001E32IAE",<br />

"isInMyFileSync": false,<br />

"mimeType": "image/png",<br />

"modifiedDate": "2012-07-17T21:47:27.000Z",<br />

"motif": {<br />

"largeIconUrl": "/img/content/content64.png",<br />

"mediumIconUrl": "/img/content/content32.png",<br />

"smallIconUrl": "/img/icon/files16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Recruitment Poster",<br />

"origin": "<strong>Chatter</strong>",<br />

"owner": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"pageCount": 0,<br />

"pdfRenditionStatus": "Na",<br />

"renditionUrl": "/services/data/v27.0/chatter/files/069D00000001E32IAE/rendition",<br />

"thumb120By90RenditionStatus": "Success",<br />

"thumb240By180RenditionStatus": "Success",<br />

"thumb720By480RenditionStatus": "Success",<br />

"title": "Recruitment Poster",<br />

"type": "ContentDocument",<br />

"url": "/services/data/v27.0/chatter/files/069D00000001E32IAE?versionNumber=1",<br />

"versionNumber": "1"<br />

81


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Resources<br />

File Content<br />

Return the content of the file. The content is streamed as the body of the response.<br />

Resource<br />

/chatter/files/fileId/content<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET<br />

Request parameters<br />

Name<br />

versionNumber<br />

Type<br />

Integer<br />

Description<br />

Specify an existing version number for<br />

the file. If not specified, the latest<br />

version is returned.<br />

Response body<br />

Binary stream of the file content.<br />

File Shares<br />

Returns information about the entities with which the specified file has been shared. These can be users, groups, or records.<br />

Resource<br />

/chatter/files/fileId/file-shares<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body for GET or HEAD<br />

File Shares Page<br />

Example response body for GET or HEAD<br />

{<br />

"currentPageUrl": "/services/data/v27.0/chatter/files/069D00000001E32IAE/file-shares",<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"shares": [<br />

{<br />

82


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Resources<br />

"entity": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

},<br />

{<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"sharingType": "I"<br />

"entity": {<br />

"<strong>com</strong>panyName": null,<br />

"firstName": "Desmond",<br />

"id": "005D0000001LJvOIAW",<br />

"isActive": true,<br />

"lastName": "Catillo",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T59yKAC",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T59yKAC"<br />

},<br />

"name": "Desmond Catillo",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000KMS/F",<br />

"photoVersionId": "729D00000000KMS",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000KMS/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO/photo"<br />

},<br />

"title": "Senior Developer",<br />

83


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Resources<br />

},<br />

{<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LJvOIAW",<br />

"userType": "Internal"<br />

},<br />

"sharingType": "C"<br />

"entity": {<br />

"canHave<strong>Chatter</strong>Guests": false,<br />

"<strong>com</strong>munity": null,<br />

"description": null,<br />

"fileCount": 1,<br />

"id": "0F9D00000000HwEKAU",<br />

"lastFeedItemPostDate": "2012-07-17T22:07:42.000Z",<br />

"memberCount": 1,<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

"myRole": "GroupOwner",<br />

"mySubscription": {<br />

"id": "0FBD00000002vAmOAI",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002vAmOAI"<br />

},<br />

"name": "Dreamforce &#39;12",<br />

"owner": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000MMK/F",<br />

84


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Resources<br />

"photoVersionId": "729D00000000MMK",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000MMK/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

}<br />

]<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"type": "CollaborationGroup",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000HwEKAU",<br />

"visibility": "PublicAccess"<br />

},<br />

"sharingType": "V"<br />

File Rendition<br />

Returns a rendition of the file. A rendition is a binary preview of the file. The format of the binary depends on the format<br />

specified in the request.<br />

Note: Renditions are processed asynchronously and may not be available immediately after the file has been uploaded.<br />

Resource<br />

/chatter/files/fileId/rendition<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET<br />

Request parameters<br />

Name<br />

page<br />

type<br />

Type<br />

Integer<br />

String<br />

Description<br />

Specify a rendition of a specific page.<br />

The first page is 0. If you don’t specify<br />

a specific page, a rendition of the first<br />

page is returned.<br />

For a PDF file rendition, the rendition<br />

is for the entire document. The only<br />

valid value is 0: you can’t get the<br />

rendition of a single page.<br />

Specify the type of rendition to be<br />

returned. Default value is<br />

THUMB120BY90. Valid values are:<br />

• FLASH<br />

• PDF<br />

85


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Feed Resources<br />

Name<br />

Type<br />

Description<br />

• SLIDE<br />

• THUMB120BY90<br />

• THUMB240BY180<br />

• THUMB720BY480<br />

Response body<br />

Binary stream of the rendition.<br />

File Information, Batch<br />

Returns information for a list of files, specified by file IDs. The number of file Ids you can specify is limited by the length of<br />

the URL. In general, you can specify up to 100 file Ids in a <strong>com</strong>ma-separated list.<br />

Resource<br />

/chatter/files/batch/fileIds<br />

Available since version<br />

26.0<br />

HTTP methods<br />

GET<br />

Response body<br />

Batch Results<br />

Files Feed Resources<br />

All feed items that contain files posted by people or groups that the current user follows.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/files/me<br />

/chatter/feeds/files/me/feed-items<br />

Description<br />

Returns the URL to the feed-items that contain files that are<br />

posted by users or groups the current user is following.<br />

Returns all feed items posted with files by people or groups<br />

that the logged-in user follows.<br />

Files Feed URL<br />

Returns the URL to the feed-items that contain files that are posted by users or groups the current user is following.<br />

86


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Feed Resources<br />

Resource<br />

/chatter/feeds/files/me<br />

OR<br />

/chatter/feeds/files/userId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameter<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

Files Feed Items<br />

Returns all feed items posted with files by people or groups that the logged-in user follows.<br />

Resource<br />

/chatter/feeds/files/me/feed-items<br />

or<br />

/chatter/feeds/files/userId/feed-items<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

87


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Feed Resources<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

sort<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed Item Page<br />

Response body example<br />

{<br />

"currentPageUrl" :<br />

"/services/data/v27.0/chatter/feeds/files/005D0000001L3zVIAS/feed-items?page=2012-04-17T18%3A13%3A57Z",<br />

"isModifiedToken" : null,<br />

"isModifiedUrl" : null<br />

"items" : [ ],<br />

"nextPageUrl" : null,<br />

}<br />

Files Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

88


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Files Feed Resources<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

/chatter/feeds/files/me/feed-items/flat<br />

or<br />

/chatter/feeds/files/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

Integer<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

89


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Filter Feed Resources<br />

Response body<br />

Flat Feed<br />

Filter Feed Resources<br />

Feeds filtered by the specified criteria for the logged-in user.<br />

A filter feed is a feed across many things. For example, suppose you’re a member of five groups. The following resource returns<br />

all of the feed items visible to you that are posted to all five of those groups:<br />

/chatter/feeds/filter/me/0F9/feed-items<br />

Contrast that with the following, which returns all of the feed items posted to a particular group:<br />

/chatter/feeds/record/0F9XXXXXXXXX<br />

Note that for the filter feed, it only returns the posts visible to you. The filter feed is very similar to the news feed, just filtered<br />

to show only objects of the specified type. In the second case, if the group is public, even if you are not a member, the resource<br />

returns all the feed items posted to it. Because you are not a member of this group, the first example would not return these<br />

posts.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/filter/me<br />

/chatter/feeds/filter/me/idPrefix<br />

/chatter/feeds/filter/me/idPrefix/feed-items<br />

Description<br />

Use this resource to return a list of the<br />

possible filters for a user. You should get<br />

this list, then construct additional<br />

resource URLs using the key prefixes that<br />

are returned.<br />

Use this resource to return the URL for<br />

the specified key prefix feed.<br />

Use this resource to return the feed items<br />

for the specified key prefix, such as the<br />

feed items from all the groups the<br />

logged-in user is a member of.<br />

List of Filters<br />

Use this resource to return a list of the possible filters for a user. You should get this list, then construct additional resource<br />

URLs using the key prefixes that are returned. If this list is empty, it means the user isn’t following anything.<br />

Resource<br />

or<br />

/chatter/feeds/filter/me<br />

/chatter/feeds/filter/userId<br />

90


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Filter Feed Resources<br />

userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Feed Directory<br />

Key Prefix Filter Feed<br />

Use this resource to return the URL for the specified key prefix feed. The key prefix is the three-character prefix code in the<br />

object ID. Object IDs are prefixed with three-character codes that specify the type of the object. For example, User objects<br />

have a prefix of 005 and Group objects have a prefix of 0F9.<br />

You don’t need to generate the key prefixes yourself. Use the List of Filters to see the available key prefixes.<br />

Resource<br />

/chatter/feeds/filter/me/keyPrefix<br />

or<br />

/chatter/feeds/filter/userId/keyPrefix<br />

userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

91


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Filter Feed Resources<br />

Example response body<br />

The following is an example of a URL that’s filtered by user Id, that is prefix 005.<br />

{<br />

"feedItemsUrl":<br />

"/services/data/v27.0/chatter/feeds/filter/005D0000001Gl4rIAC/005/feed-items",<br />

}<br />

"isModifiedUrl": null<br />

Key Prefix Filtered Feed Items<br />

Use this resource to return the feed items for the specified key prefix, such as the feed items from all the groups the logged-in<br />

user is a member of.<br />

Resource<br />

/chatter/feeds/filter/me/keyPrefix/feed-items<br />

or<br />

/chatter/feeds/filter/userId/keyPrefix/feed-items<br />

userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

Integer<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

92


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Filter Feed Resources<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed Item Page<br />

Filter Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

/chatter/feeds/filter/me/feed-items/flat<br />

or<br />

/chatter/feeds/filter/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

Type<br />

Integer<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

93


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Groups Feed Resources<br />

Parameter Name<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

Groups Feed Resources<br />

All feed items from all groups the current user either owns or is a member of.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/groups/me<br />

/chatter/feeds/groups/me/feed-items<br />

Description<br />

Returns a URL to the feed-items for all the groups the current,<br />

signed-in user is a member of.<br />

Returns all feed items from all groups the current user either<br />

owns or is a member of.<br />

Groups Feed URL<br />

Returns a URL to the feed-items for all the groups the current, signed-in user is a member of.<br />

Resource<br />

or<br />

/chatter/feeds/groups/me<br />

/chatter/feeds/groups/userId<br />

94


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Groups Feed Resources<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

Groups Feed Items<br />

Returns all feed items from all groups the current user either owns or is a member of.<br />

Resource<br />

/chatter/feeds/groups/me/feed-items<br />

or<br />

/chatter/feeds/groups/userId/feed-items<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

95


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Groups Feed Resources<br />

Request parameters<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

sort<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed Item Page<br />

Groups Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

/chatter/feeds/groups/me/feed-items/flat<br />

or<br />

/chatter/feeds/groups/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

96


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group-Memberships Resources<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

Integer<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

See Also:<br />

Groups Resources<br />

Group-Memberships Resources<br />

Information about memberships in <strong>Chatter</strong> groups.<br />

Available resources are:<br />

97


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group-Memberships Resources<br />

Resource<br />

/chatter/group-memberships/membershipId<br />

/chatter/group-memberships/batch/membershipIds<br />

Description<br />

Access information about a member of a group, or remove a<br />

member from a group.<br />

Access information about a list of group members.<br />

Group Memberships Information<br />

Access information about a member of a group, or remove a member from a group.<br />

Membership IDs are returned from the /chatter/groups/groupId/memberships resource.<br />

Resource<br />

/chatter/group-memberships/membershipId<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, DELETE or HEAD<br />

Response body for GET or HEAD<br />

Group Member<br />

Response body example for GET<br />

{<br />

"id": "0FBD00000002kYFOAY",<br />

"role": "GroupOwner",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002kYFOAY",<br />

"user": {<br />

"<strong>com</strong>panyName": "Seattle Apps",<br />

"firstName": "Adam",<br />

"id": "005D0000001Gl4rIAC",<br />

"isActive": true,<br />

"lastName": "Grant",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Adam Grant",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D000000007ux/F",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D000000007ux/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": "Service Engineer",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001Gl4rIAC",<br />

98


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group-Memberships Resources<br />

}<br />

}<br />

"userType": "Internal"<br />

Batch Group Memberships<br />

Access information about a list of group members. The members don’t have to belong to the same group. Each membership<br />

ID is associated with a specific group.<br />

Membership IDs are returned in the response bodies of several groups resources.<br />

The following groups resource lists every member of a group in its own Group Member response body. The id property of<br />

every Group Member response body contains a membership Id:<br />

/chatter/groups/groupId/members<br />

Resource<br />

/chatter/group-memberships/batch/membershipIds<br />

Where membershipIds is a <strong>com</strong>ma separated list of membership IDs.<br />

Available since version<br />

27.0<br />

HTTP methods<br />

GET, HEAD<br />

Response body for GET or HEAD<br />

Batch Results<br />

Example for GET<br />

This request gets the group membership information for two users:<br />

/services/data/v27.0/chatter/group-memberships/batch/0FBD00000003GAPOA2,0FBD00000003GAKOA<br />

This is the Batch Results response body which contains nested User Summary response bodies:<br />

{"results": [<br />

{<br />

"result": {<br />

"id": "0FBD00000003GAPOA2",<br />

"role": "StandardMember",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000003GAPOA2",<br />

"user": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Gordon",<br />

"id": "005D0000001LLO1IAO",<br />

"isActive": true,<br />

"lastName": "Johnson",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

99


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group-Memberships Resources<br />

"mySubscription": {<br />

"id": "0E8D0000000T5ZUKA0",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5ZUKA0"<br />

},<br />

"name": "Gordon Johnson",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cPhKrC7plNhUw5eOz7Aj1u-zWLMxsSybO7lwUPg5_Xne",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJL/F",<br />

"photoVersionId": "729D00000000LJLIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJL/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cPhKrC7plNhUw5eOz7Aj1u_2Vnyzx4jZ2zFiKBz_sTt2",<br />

},<br />

{<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO/photo"<br />

},<br />

"title": "VP Sales",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO",<br />

"userType": "Internal"<br />

}<br />

},<br />

"statusCode": 200<br />

"result": {<br />

"id": "0FBD00000003GAKOA2",<br />

"role": "GroupOwner",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000003GAKOA2",<br />

"user": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

}<br />

},<br />

"statusCode": 200<br />

100


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Groups Resources<br />

}<br />

]}<br />

Groups Resources<br />

Information about groups, such as the group's members, photo, and the groups in the organization. Also used to add members<br />

to a group and change the group photo.<br />

Note: The groups resource is not a feed. To view the feed for a group, or post to it, use the record feed resource with<br />

a groupId.<br />

Available resources:<br />

Resource<br />

/chatter/groups/<br />

/chatter/groups/groupId<br />

/chatter/groups/batch/group_list<br />

/chatter/groups/groupID/files<br />

/chatter/groups/groupId/members<br />

/chatter/groups/groupId/members/requests<br />

/chatter/group-membership-requests/requestId<br />

/chatter/groups/groupId/my-settings<br />

/chatter/groups/groupId/photo<br />

Description<br />

Returns a list of groups in the organization.<br />

Returns information about the specified group.<br />

Returns information about more than one group at the same<br />

time.<br />

Returns information about the files posted to the specified<br />

group.<br />

Returns a list of members for the specified group. Also use<br />

this resource and POST to add members to a group.<br />

Request membership in a private group or get the status of<br />

requests to a join a private group.<br />

Update the status of a request by a user to join a private group<br />

or get information about a request to join a private group.<br />

Information about the context user’s <strong>Chatter</strong> settings for the<br />

specified group.<br />

Use this resource to access the photo for the specified group,<br />

add, update, or delete the photo.<br />

See Also:<br />

Groups Feed Resources<br />

List of Groups<br />

Returns a list of groups in the organization.<br />

101


<strong>Chatter</strong> <strong>API</strong> Resources<br />

List of Groups<br />

Resource<br />

/chatter/groups/<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

pageSize<br />

q<br />

Type<br />

Integer<br />

Integer<br />

String<br />

Description<br />

An integer specifying a page of items.<br />

The default value is 0, which returns<br />

the first page.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 250.<br />

The default value is 25.<br />

Specifies the string to search. The<br />

search string must contain at least two<br />

characters, not including any wildcards.<br />

For more information about wildcards,<br />

see Using Wildcards.<br />

Response body<br />

Group Page<br />

Example response body<br />

"currentPageUrl": "/services/data/v27.0/chatter/groups",<br />

"groups": [<br />

{<br />

"canHave<strong>Chatter</strong>Guests": false,<br />

"<strong>com</strong>munity": null<br />

"description": "Get <strong>com</strong>pany announcements and other important updates",<br />

"fileCount": 0,<br />

"id": "0F9D00000000FG0KAM",<br />

"lastFeedItemPostDate": "2011-09-21T19:58:58.000Z",<br />

"memberCount": 2,<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

"myRole": "GroupOwner",<br />

"mySubscription": {<br />

"id": "0FBD00000002oJVOAY",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002oJVOAY"<br />

},<br />

"name": "All Seattle Apps",<br />

102


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Information<br />

"owner": {<br />

"<strong>com</strong>panyName": "Seattle Apps",<br />

"firstName": "Marion",<br />

"id": "005D0000001Kl6xIAC",<br />

"isActive": true,<br />

"lastName": "Raven",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Marion Raven",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T"<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001Kl6xIAC",<br />

"userType: "Internal"<br />

},<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDQ/F",<br />

"photoVersionId": "729D00000000BDQ",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDQ/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"type": "CollaborationGroup",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000FG0KAM",<br />

"visibility": "PublicAccess"<br />

}],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null<br />

Group Information<br />

Returns information about the specified group.<br />

Resource<br />

/chatter/groups/groupId<br />

103


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Information<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Group<br />

Example response body<br />

{<br />

"canHave<strong>Chatter</strong>Guests": false,<br />

"<strong>com</strong>munity": null,<br />

"description": "Get <strong>com</strong>pany announcements and other important updates",<br />

"fileCount": 0,<br />

"id": "0F9D00000000HRRKA2",<br />

"lastFeedItemPostDate": "2012-06-05T20:36:51.000Z",<br />

"memberCount": 1,<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

"myRole": "GroupOwner",<br />

"mySubscription": {<br />

"id": "0FBD00000002tgWOAQ",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002tgWOAQ"<br />

},<br />

"name": "All SeattleApps",<br />

"owner": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/005/F",<br />

"photoVersionId": null,<br />

"smallPhotoUrl": "https://instance_name/profilephoto/005/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

104


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Batch Group Information<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000JWt/F",<br />

"photoVersionId": "729D00000000JWtIAM",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000JWt/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"type": "CollaborationGroup",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000HRRKA2",<br />

"visibility": "PublicAccess"<br />

Batch Group Information<br />

Returns information about more than one group at the same time.<br />

Resource<br />

/chatter/groups/batch/group_list<br />

Where group_list is a <strong>com</strong>ma separated list of group IDs.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Batch Results<br />

Group Files<br />

Returns information about the files posted to the specified group.<br />

Resource<br />

/chatter/groups/groupID/files<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

105


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Files<br />

Request parameters<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

page<br />

Integer<br />

An integer specifying a page<br />

of items. The default value<br />

is 0, which returns the first<br />

page.<br />

24.0<br />

pageSize<br />

Integer<br />

Specifies the number of<br />

items per page. Valid values<br />

are between 1 and 100. If<br />

you don't specify a size, the<br />

default is 25.<br />

24.0<br />

q<br />

String<br />

A query string to filter the<br />

results. The string must<br />

contain at least two<br />

characters, not including<br />

wildcards. For information<br />

about wildcards, see Using<br />

Wildcards.<br />

27.0<br />

Response body<br />

File Page<br />

Example response body<br />

{<br />

"currentPageUrl": "/services/data/v27.0/chatter/groups/0F9D00000000HwEKAU/files",<br />

"files": [{<br />

"checksum": "a65b71bc6a31fa95dd0a9232c9f58c86",<br />

"contentSize": 100377,<br />

"contentUrl": null,<br />

"description": null,<br />

"downloadUrl":<br />

"/services/data/v27.0/chatter/files/069D00000001E32IAE/content?versionNumber=1",<br />

"fileExtension": "png",<br />

"fileType": "Png",<br />

"flashRenditionStatus": "Na",<br />

"id": "069D00000001E32IAE",<br />

"isInMyFileSynced": false,<br />

"mimeType": "image/png",<br />

"modifiedDate": "2012-07-17T21:47:27.000Z",<br />

"motif": {<br />

"largeIconUrl": "/img/content/content64.png",<br />

"mediumIconUrl": "/img/content/content32.png",<br />

"smallIconUrl": "/img/icon/files16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T5JrKAK",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5JrKAK"<br />

},<br />

"name": "Recruitment Poster",<br />

"origin": "<strong>Chatter</strong>",<br />

"owner": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

106


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Members<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile.png",<br />

"smallIconUrl": "/img/icon/profile.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"pdfRenditionStatus": "Na",<br />

"renditionUrl": "/services/data/v27.0/chatter/files/069D00000001E32IAE/rendition",<br />

}<br />

"thumb120By90RenditionStatus": "Success",<br />

"thumb240By180RenditionStatus": "Success",<br />

"thumb720By480RenditionStatus": "Success",<br />

"title": "Recruitment Poster",<br />

"type": "ContentDocument",<br />

"url": "/services/data/v27.0/chatter/files/069D00000001E32IAE?versionNumber=1",<br />

"versionNumber": "1"<br />

}],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null<br />

Group Members<br />

Returns a list of members for the specified group. Also use this resource and POST to add members to a group.<br />

Resource<br />

/chatter/groups/groupId/members<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST or HEAD<br />

107


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Members<br />

Request body for POST<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

userId<br />

String<br />

The user ID of the member<br />

to be added to the group<br />

23.0<br />

Request parameter for POST<br />

Parameter Name<br />

userId<br />

Type<br />

String<br />

Description<br />

ID of the user to add to the group.<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Integer<br />

Integer<br />

Description<br />

An integer specifying a page of items.<br />

The default value is 0, which returns<br />

the first page.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 1000.<br />

If you don’t specify a size, the default<br />

is 25.<br />

Response body for GET or HEAD<br />

Group Member Page<br />

Response body for POST<br />

Group Member<br />

Example response body for GET<br />

{<br />

"currentPageUrl": "/services/data/v27.0/chatter/groups/0F9D00000000BsTKAU/members",<br />

"members": [<br />

{<br />

"id": "0FBD00000002kYFOAY",<br />

"role": "GroupOwner",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002kYFOAY",<br />

"user": {<br />

"<strong>com</strong>panyName": "Seattle Apps",<br />

"firstName": "Adam",<br />

108


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Members<br />

"id": "005D0000001Gl4rIAC",<br />

"isActive": true,<br />

"lastName": "Grant",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Adam Grant",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D000000007ux/F",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D000000007ux/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": "Service Engineer",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001Gl4rIAC",<br />

"userType": "Internal"<br />

},<br />

{<br />

"id": "0FBD00000002zClOAI",<br />

"role": "StandardMember",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002zClOAI",<br />

"user": {<br />

"<strong>com</strong>panyName": "Seattle <strong>Chatter</strong>",<br />

"firstName": "Devi",<br />

"id": "005D0000001GpHpIAK",<br />

"isActive": true,<br />

"lastName": "Tapash",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": {<br />

"id": "005D0000001GpHpIAK",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D00000001VQCKA2"<br />

},<br />

"name": "Devi Tapash",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://na1-blitz02.soma.salesforce.<strong>com</strong>instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1i9x6Z16L8wXEGigpcWjAd",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000CSQ/F",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000CSQ/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1q43x_rW2ciXBHst0Eh3Y6",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLOBIA4/photo"<br />

},<br />

"title": "Service Engineer",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001GpHpIAK",<br />

"userType": "Internal"<br />

109


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Members—Private<br />

}<br />

}<br />

}<br />

],<br />

"myMembership": {<br />

"id": "0FBD00000002kYFOAY",<br />

"url": "/services/data/v27.0/chatter/group-memberships/0FBD00000002kYFOAY"<br />

},<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"totalMemberCount": 2<br />

Group Members—Private<br />

Request membership in a private group or get the status of requests to a join a private group.<br />

Note: To request membership in a public group use the Group Members resource.<br />

Resource<br />

/chatter/groups/groupId/members/requests<br />

Available since version<br />

27.0<br />

HTTP methods<br />

GET, HEAD, and POST<br />

Request parameter for GET<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

status<br />

String<br />

Optional. If you include this<br />

parameter, results are filtered<br />

to include those that match<br />

the specified status. Valid<br />

values:<br />

• Accepted<br />

• Declined<br />

• Pending<br />

27.0<br />

Response body for GET or HEAD<br />

Group Membership Request Collection<br />

Response body for POST<br />

Group Membership Request<br />

110


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Members—Private<br />

This table lists HTTP response code descriptions that are unique to this resource. For descriptions of other HTTP<br />

response codes, see Status Codes and Error Responses.<br />

HTTP Response Code<br />

201<br />

Description<br />

One of the following:<br />

• Success<br />

• User already has a membership request for this group<br />

204<br />

403<br />

User is already a member of this group.<br />

One of the following:<br />

• Group is private: INSUFFICIENT_ACCESS_OR_READONLY<br />

• User is an external user: INSUFFICIENT_ACCESS<br />

Example for GET<br />

This example gets information about all the requests to join that have been accepted for this private group:<br />

/chatter/groups/0F9D00000000izfKAA/members/requests?status=Accepted<br />

The JSON Group Membership Request Collection response body includes one request from the user Gordon Johnson:<br />

{<br />

"requests": [{<br />

"createdDate": "2012-10-19T00:23:23.000Z",<br />

"id": "0I5D000000002fmKAA",<br />

"lastUpdateDate": "2012-10-19T00:24:06.000Z",<br />

"requestedGroup": {<br />

"id": "0F9D00000000izfKAA",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000izfKAA"<br />

},<br />

"responseMessage": null,<br />

"status": "Accepted",<br />

"url": "/services/data/v27.0/chatter/group-membership-requests/0I5D000000002fmKAA",<br />

"user": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Gordon",<br />

"id": "005D0000001LLO1IAO",<br />

"isActive": true,<br />

"lastName": "Johnson",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T5ZUKA0",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5ZUKA0"<br />

},<br />

"name": "Gordon Johnson",<br />

"photo": {<br />

"fullEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cPhK<br />

rC7plNhUw5eOz7Aj1u-zWLMxsSybO7lwUPg5_Xne",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJL/F",<br />

"photoVersionId": "729D00000000LJLIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJL/T",<br />

111


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Members—Private<br />

"standardEmailPhotoUrl": "https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0<br />

cPhKrC7plNhUw5eOz7Aj1u_2Vnyzx4jZ2zFiKBz_sTt2",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO/photo"<br />

},<br />

"title": "VP Sales",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO",<br />

"userType": "Internal"<br />

}<br />

}],<br />

"total": 1<br />

}<br />

Example for POST<br />

This example requests membership in a private group with the ID 0F9D00000000izfKAA:<br />

/chatter/groups/0F9D00000000izfKAA/members/requests<br />

The Group Membership Request response body is in JSON format:<br />

{<br />

"createdDate": "2012-10-24T00:55:23.000Z",<br />

"id": "0I5D000000002frKAA",<br />

"lastUpdateDate": "2012-10-24T00:55:23.000Z",<br />

"requestedGroup": {<br />

"id": "0F9D00000000j3wKAA",<br />

"url": "/services/data/v27.0<br />

/chatter/groups/0F9D00000000j3wKAA"<br />

},<br />

"responseMessage": null,<br />

"status": "Pending",<br />

"url": "/services/data/v27.0<br />

/chatter/group-membership-requests/0I5D000000002frKAA",<br />

"user": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl": "https://instance_name<br />

/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/<br />

profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/<br />

profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl": "https://instance_name<br />

/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0<br />

/chatter/users/005D0000001LL8OIAW",<br />

112


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Membership Requests—Private<br />

}<br />

}<br />

"userType": "Internal"<br />

Group Membership Requests—Private<br />

Update the status of a request by a user to join a private group or get information about a request to join a private group. Get<br />

the value of requestId from the Group Membership Request response from a POST request to<br />

/chatter/groups/groupId/members/requests.<br />

Resource<br />

/chatter/group-membership-requests/requestId<br />

Available since version<br />

27.0<br />

HTTP methods<br />

GET, HEAD, and PATCH<br />

Request body for PATCH<br />

Group Membership Request Update<br />

Request parameters for PATCH<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

responseMessage<br />

String<br />

Use this property to provide a message to the<br />

user if their membership request is declined.<br />

The value of this property is used only when<br />

the value of the status property is<br />

Declined.<br />

27.0<br />

The maximum length is 756 characters.<br />

status<br />

String<br />

Valid values:<br />

• Accepted<br />

• Declined<br />

27.0<br />

Response body for PATCH<br />

Group Membership Request<br />

Response body for GET or HEAD<br />

Group Membership Request<br />

Example for PATCH<br />

This example updates a request to join a private group from Pending to Accepted:<br />

/chatter/group-membership-requests/0I5D000000002fwKAA?status=Accepted<br />

113


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Photo<br />

This is the JSON Group Membership Request response body:<br />

{<br />

"createdDate": "2012-10-24T16:36:36.000Z",<br />

"id": "0I5D000000002fwKAA",<br />

"lastUpdateDate": "2012-10-24T16:43:57.000Z",<br />

"requestedGroup": {<br />

"id": "0F9D00000000j46KAA",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000j46KAA"<br />

},<br />

"responseMessage": null,<br />

"status": "Accepted",<br />

"url": "/services/data/v27.0/chatter/group-membership-requests/0I5D000000002fwKAA",<br />

"user": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB"<br />

}<br />

}<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

Group Photo<br />

Use this resource to access the photo for the specified group, add, update, or delete the photo.<br />

To add a file from the Files list, use the request body or request parameters in this entry.<br />

To upload a binary file, you must send it in a multipart/form-data message. For information about how to create the<br />

multipart/form-data message, see Uploading Binary Files.<br />

Resource<br />

/chatter/groups/groupId/photo<br />

114


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Photo<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST, DELETE, or HEAD<br />

Request body for POST<br />

Describes an existing photo input. To upload a new photo, provide the binary file in a multipart/form-data body<br />

part where name="fileUpload". See Uploading Binary Files.<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

fileId<br />

String<br />

18 character Id of an<br />

existing file. The key prefix<br />

must be 069 and the file<br />

size must be less than 2<br />

MB.<br />

25.0<br />

versionNumber<br />

Integer<br />

Version number of an<br />

existing file. If not<br />

provided, the latest version<br />

is used.<br />

25.0<br />

Request parameters for POST<br />

Parameter Name<br />

Type<br />

Description<br />

Available Version<br />

fileId<br />

String<br />

18 character ID of an<br />

existing file. The key prefix<br />

must be 069 and the file size<br />

must be less than 2 MB.<br />

25.0<br />

versionNumber<br />

Integer<br />

Version number of the<br />

existing content. If not<br />

provided, the latest version<br />

is used.<br />

25.0<br />

Note: Photos are processed asynchronously and may not be visible right away.<br />

Response body for GET or HEAD<br />

Photo<br />

115


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Group Settings<br />

Response body for POST<br />

Photo<br />

Group Settings<br />

Information about the context user’s <strong>Chatter</strong> settings for the specified group.<br />

Resource<br />

/chatter/groups/groupId/my-settings<br />

Available since version<br />

27.0<br />

HTTP methods<br />

GET, HEAD, or PATCH<br />

Request body for PATCH<br />

Root XML tag<br />

<br />

Properties<br />

A user’s <strong>Chatter</strong> settings.<br />

Name<br />

emailFrequency<br />

Type<br />

String<br />

Description<br />

The frequency with which a group<br />

member receives email from a group.<br />

Valid values are:<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

• Never<br />

Available<br />

Version<br />

27.0<br />

Request parameter for PATCH<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

emailFrequency<br />

String<br />

The frequency with which a<br />

group member receives email<br />

from a group. Valid values<br />

are:<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

27.0<br />

116


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Influence Resource<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

• Never<br />

Response body for GET, HEAD, or PATCH<br />

Group <strong>Chatter</strong> Settings<br />

Influence Resource<br />

List of the percentile thresholds used to categorize an organization’s users by their influence in <strong>Chatter</strong>. Users are ranked<br />

based on the number of posts and <strong>com</strong>ments made, and <strong>com</strong>ments and likes received. The percentile associated with a category<br />

represents the bottom threshold for that influencer category. For example: 0.25 defines the cutoff for the Active Influencer<br />

category, which means it includes users with an influence rank equal to or greater than the 25th percentile (25%) and less than<br />

the next highest category threshold.<br />

Influence Thresholds<br />

Resource<br />

/chatter/influence/thresholds<br />

Available since version<br />

24.0<br />

HTTP method<br />

GET or HEAD<br />

Response body<br />

Influence Thresholds<br />

Example response body<br />

{"thresholds": [<br />

{<br />

"name": "Top Influencer",<br />

"threshold": "0.8",<br />

}<br />

{<br />

"name": "Active Influencer",<br />

"threshold": "0.25",<br />

}<br />

{<br />

"name": "Observer",<br />

"threshold": "0.0",<br />

}<br />

]}<br />

117


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Likes Resource<br />

Likes Resource<br />

Information about the specified like. Also used to delete a like.<br />

You can find the ID for a specific like from any feed, such as a news feed or a record feed.<br />

Like<br />

Resource<br />

/chatter/likes/likeId<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, DELETE or HEAD<br />

Response body for GET or HEAD<br />

Like<br />

Example response body<br />

{<br />

"id": "0I0D000000003KeKAI",<br />

"likedItem": {<br />

"id": "0D5D0000000IPZuKAO",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000IPZuKAO"<br />

},<br />

"url": "/services/data/v27.0/chatter/likes/0I0D000000003KeKAI",<br />

"user": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

118


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Motifs Resources<br />

}<br />

}<br />

"userType": "Internal"<br />

Motifs Resources<br />

Returns URLs for sets of small, medium, and large motif icons. Records have different sets of motif icons depending on the<br />

record type.<br />

Available resources are:<br />

Resource<br />

/connect/motifs/idOrPrefix<br />

/connect/motifs/batch/idOrPrefixList<br />

Description<br />

Returns a set of small, medium, and large motif icons for the<br />

specified record.<br />

Returns a set of small, medium, and large motif icons for the<br />

specified records.<br />

Motifs Resource<br />

Returns a set of small, medium, and large motif icons for the specified record.<br />

Specify either an ID or key prefix for idOrPrefix.<br />

Resource<br />

/connect/motifs/idOrPrefix<br />

Available since release<br />

27.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Motif<br />

Example of GET<br />

Request for user motifs: /connect/motifs/005D0000001LLO1<br />

Response:<br />

{<br />

}<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

119


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Batch Motifs Resource<br />

Returns a set of small, medium, and large motif icons for the specified records.<br />

Specify a <strong>com</strong>ma-separated list of IDs and key prefixes for idOrPrefixList. You can mix IDs and key prefixes in the same<br />

request.<br />

Resource<br />

/connect/motifs/batch/idOrPrefixList<br />

Available since release<br />

27.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Batch Results<br />

Example of GET<br />

Request for motifs for a user and a file: /connect/motifs/batch/005D0000001LLO1,069D00000001FHF<br />

Response:<br />

{"results": [<br />

{<br />

"result": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"statusCode": 200<br />

},<br />

{<br />

"result": {<br />

"largeIconUrl": "/img/content/content64.png",<br />

"mediumIconUrl": "/img/content/content32.png",<br />

"smallIconUrl": "/img/icon/files16.png"<br />

},<br />

"statusCode": 200<br />

}<br />

]}<br />

News Feed Resources<br />

The news feed of the current user. It is made up of items that are of interest to the current user. You can also use the feed-items<br />

resource to add feed-items.<br />

Note: The <strong>com</strong>position of this feed may change between releases in order to match the feed displayed in <strong>Chatter</strong>.<br />

Available resources are:<br />

120


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Resource<br />

/chatter/feeds/news/me<br />

/chatter/feeds/news/me/is-modified<br />

/chatter/feeds/news/me/feed-items<br />

Description<br />

Returns a URL to the feed-items for all feeds for the logged–in<br />

user. Also returns an Is-Modified resource for polling the feed<br />

for updates.<br />

Returns information about whether the news feed has been<br />

updated or changed since the specified time and date.<br />

Returns all feed items from all groups the logged-in user either<br />

owns or is a member of, as well as all files, records, and users<br />

the logged-in user follows. You can also use this resource to<br />

post feed-items.<br />

News Feed URL<br />

Returns a URL to the feed-items for all feeds for the logged–in user. Also returns an Is-Modified resource for polling the feed<br />

for updates.<br />

Resource<br />

/chatter/feeds/news/me<br />

or<br />

/chatter/feeds/news/userId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameter<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

121


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Example response body<br />

{<br />

"feedItemsUrl":<br />

"/services/data/v27.0/chatter/feeds/news/005xx000001Sv1mAAB/feed-items",<br />

"isModifiedUrl":<br />

"/services/data/v27.0/chatter/feeds/news/005xx000001Sv1mAAB/is-modified?since=2%3A1344352279000"<br />

}<br />

News Feed Is-Modified<br />

Returns information about whether the news feed has been updated or changed since the specified time and date.<br />

Note: Though the Is-Modified resource is generally available, your organization may not have permission to use it<br />

automatically. If you can’t access this resource, contact your salesforce.<strong>com</strong> representative and ask about the “Enabled<br />

<strong>Chatter</strong> Feed Polling” permission.<br />

Before the introduction of the Is-Modified resource, you had to poll the news feed directly using the News Feed Items resource,<br />

then do a <strong>com</strong>parison to see if the news feed had changed. Retrieving a news feed is a costly use of <strong>com</strong>puting resources. In<br />

addition, when you poll a feed directly, you run a greater risk of exceeding the rate limit imposed by <strong>Chatter</strong> <strong>API</strong>.<br />

If your application polls the news feed directly, we re<strong>com</strong>mend that you adapt your code to use the Is-Modified resource to<br />

lessen your chances of reaching the rate limit and to save <strong>com</strong>puting resources.<br />

Note: If you are working with remote organizations as an ISV, use the Organization resource and the feedPolling<br />

property of the Feature response body to shape your polling strategy. If feedPolling is not enabled, be conservative<br />

in how often you poll for new content.<br />

Use the Is-Modified resource to poll the news feed<br />

1. Use either of the following resources to get the latest items from a news feed or to get information about the feed:<br />

/chatter/feeds/news/me/feed-items, /chatter/feeds/news/me.<br />

The response bodies for both resources contain the isModifiedUrl property. This property contains the URL to<br />

the Is-Modified resource, which includes a since request parameter that defines the last modified date of the feed.<br />

Note that if the sort order of the request to the news feed changes, the news feed is modified.<br />

2. Issue a GET request to the URL in the isModifiedUrl property.<br />

The Feed Modified Info response contains the following properties:<br />

• isModified—a boolean indicating whether the feed has been updated since the last time you checked. Note<br />

that conditions under which this property is true depend on the sort order of the original request to the news<br />

feed. For example, if the feed is sorted by posts (CreatedDateDesc) and a <strong>com</strong>ment was added, isModified<br />

is false.<br />

• nextPollUrl—a string containing the URL of the Is-Modified resource. This property contains a URL only<br />

if isModified is false. If isModified is true, nextPollUrl is null.<br />

3. If the isModified property is true, issue a GET request to the News Feed Items resource to refresh the news<br />

feed.<br />

4. If the isModified property is false, issue a GET request to the URL in the nextPollUrl property. This request<br />

also returns a Feed Modified Info response body that contains the isModified and nextPollUrl properties.<br />

Note: We don’t re<strong>com</strong>mend exceeding one poll per minute.<br />

122


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Resource<br />

/chatter/feeds/news/me/is-modified<br />

or<br />

/chatter/feeds/news/userId/is-modified<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

26.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameter<br />

Parameter Name<br />

since<br />

Type<br />

Required. String.<br />

Description<br />

An opaque token containing<br />

information about the last modified<br />

date of the feed.<br />

Do not construct this token. Retrieve<br />

this token from the<br />

isModifiedToken property of the<br />

Feed Item Page or Feed Modified Info<br />

response body.<br />

Response body<br />

Feed Modified Info<br />

News Feed Items<br />

Returns all feed items from all groups the logged-in user either owns or is a member of, as well as all files, records, and users<br />

the logged-in user follows. You can also use this resource to post feed-items.<br />

For information about posting a feed item, see Using POST, PATCH, or PUT for Input.<br />

To upload a binary file, you must send it as a body part in a multipart/form-data request. You can send information such as<br />

the text of a post or <strong>com</strong>ment as a JSON or XML rich input body part in the same multipart/form-data request. Alternately,<br />

you can choose to send that information in request parameters. If you pass both a rich input request body and request parameters,<br />

the request parameters are ignored. For information about how to create the multipart/form-data message, see Uploading<br />

Binary Files.<br />

GET requests for this resource return the isModifiedUrl property, which contains a News Feed Is-Modified resource for<br />

polling the feed for updates.<br />

123


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Resource<br />

/chatter/feeds/news/me/feed-items<br />

or<br />

/chatter/feeds/news/userId/feed-items<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST, or HEAD<br />

Request body for POST<br />

Root XML tag<br />

JSON<br />

<br />

The following example attaches a poll to a feed item:<br />

{ "attachment":<br />

{<br />

"attachmentType":"Poll",<br />

"pollChoices": [<br />

"Monday",<br />

"Tuesday"<br />

]<br />

},<br />

"body" : {<br />

"messageSegments" : [<br />

{<br />

"type" : "Text",<br />

"text" : "When should we meet for release planning?"<br />

}<br />

]<br />

}<br />

}<br />

Properties<br />

Name<br />

attachment<br />

Type<br />

Depends on type<br />

Description<br />

Optional. You can specify only one of<br />

these values in the attachment parameter.<br />

Values are:<br />

• Attachment Input: Existing Content<br />

(v23.0)<br />

Available<br />

Version<br />

124


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Name<br />

Type<br />

Description<br />

• Attachment Input: Feed Poll (v26.0)<br />

• Attachment Input: Link (v23.0)<br />

• Attachment Input: New File Upload<br />

(v23.0)<br />

Note: To upload a new file,<br />

you must include it in a<br />

multipart/form–data<br />

message. See Uploading<br />

Binary Files.<br />

Available<br />

Version<br />

body<br />

isBookmarkedByCurrentUser<br />

originalFeedItemId<br />

Message Body Input<br />

Boolean<br />

String<br />

Description of message body<br />

Optional. Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default value is<br />

false.<br />

Optional. If this feed item is shared, this<br />

is the original feed item 18-character Id<br />

Note: This parameter takes<br />

precedence over all other<br />

parameters. For example, if you<br />

share a post and also try to<br />

upload a file, the generated<br />

feed-item only contains the<br />

shared post. You should only<br />

share a post or upload a file, not<br />

both in the same post.<br />

23.0<br />

24.0<br />

24.0<br />

visibility<br />

String<br />

Optional. Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers specified.<br />

Also see Record Feed Items for more<br />

information about visibility<br />

Request parameters for POST<br />

Use one of the following sets of parameters. For example, you can’t post a link and attach a file in the same request.<br />

Parameters for attaching an existing file<br />

125


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

attachmentType<br />

String<br />

The attachment type. Must contain<br />

the value ExistingContent.<br />

Required<br />

27.0<br />

contentDocumentId<br />

String<br />

ID of an existing file.<br />

Required<br />

23.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item should<br />

be bookmarked for the user (true) or<br />

not (false). Default value is false.<br />

Optional<br />

26.0<br />

visibility<br />

String<br />

Who can see the post. Valid values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for more<br />

information about visibility.<br />

Parameters for attaching a new file<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

attachmentType<br />

String<br />

The attachment type. Must contain<br />

the value NewFile.<br />

Required<br />

27.0<br />

desc<br />

String<br />

Description of file being posted.<br />

Optional<br />

23.0–26.0<br />

Attention: This<br />

parameter should not<br />

be used as of version<br />

27.0. Use<br />

description<br />

instead.<br />

description<br />

String<br />

Description of file being posted.<br />

Optional<br />

27.0<br />

fileName<br />

String<br />

File name of the file being posted.<br />

Required<br />

23.0–24.0<br />

Attention: This<br />

parameter should not<br />

be used as of version<br />

24.0. Use title<br />

instead.<br />

126


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item should<br />

be bookmarked for the user (true) or<br />

not (false). Default value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

title<br />

String<br />

File name of a file to be uploaded and<br />

posted.<br />

Required<br />

24.0<br />

visibility<br />

String<br />

Who can see the post. Valid values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for more<br />

information about visibility.<br />

Parameters for posting a link<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Link.<br />

Required<br />

27.0<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the<br />

user (true) or not (false).<br />

Default value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

url<br />

String<br />

URL of the link.<br />

Required<br />

23.0<br />

urlName<br />

String<br />

Name of the URL.<br />

Optional<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with<br />

AllUsers specified.<br />

127


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

version<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Parameters for posting a poll<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Poll.<br />

Required<br />

27.0<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default<br />

value is false.<br />

Optional<br />

26.0<br />

pollChoice1 through<br />

pollChoice10<br />

String<br />

The choices used to create a new<br />

feed item with a poll. You must<br />

specify 2–10 poll choices for each<br />

poll.<br />

Required<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Required<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid values<br />

are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Parameters for sharing a post<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

Version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the<br />

user (true) or not (false).<br />

Default value is false.<br />

Optional<br />

26.0<br />

128


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

Version<br />

originalFeedItemId<br />

String<br />

The Id of the feed item you<br />

want to share.18-character Id<br />

Required<br />

24.0<br />

Note: Sharing a post<br />

takes precedence over<br />

uploading a file. Do<br />

not share a post and<br />

upload a file in the<br />

same post.<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still<br />

won’t see posts with<br />

AllUsers specified.<br />

Also see Record Feed-Items<br />

for more information about<br />

visibility.<br />

Text post parameters<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default<br />

value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Required<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid values<br />

are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with AllUsers<br />

specified.<br />

129


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

sort<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body for GET or HEAD<br />

Feed Item Page<br />

Response body for POST<br />

Feed Item<br />

Example of file post<br />

The following is an example of updating a news feed with a file post.<br />

curl --form feedItemFileUpload=@/home/ujones/Desktop/FY12_results.ppt<br />

--form title=FY12_results<br />

--form "description=FY 12 SE Division Sales Results"<br />

130


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

--form "text=Please review"<br />

--header 'Authorization: Bearer 00Dx0000000M5Li!ARIAQCZ4DkPlHzGMaYKgVubVN.<br />

K3ztqnibMTXDGDs8zEjbB7wVC6xA0pcfOMFWwJkjmNhNIH5RbVZ722hBeN0VE_c8jNFrAv'<br />

https://instance_name/services/data/v27.0/chatter/feeds/news/me/feed-items<br />

The following is an example in Java of updating a news feed with a file post.<br />

import java.io.File;<br />

import org.apache.<strong>com</strong>mons.httpclient.*;<br />

import org.apache.<strong>com</strong>mons.httpclient.methods.PostMethod;<br />

import org.apache.<strong>com</strong>mons.httpclient.methods.multipart.*;<br />

...<br />

String oauthToken = "00Dx0000000X42V!AQgAQClp6UqGWNJUf4d3LQkVCysBIS6a";<br />

String url = "https://instance_name/services/data/v27.0/chatter/" +<br />

"feeds/user-profile/me/feed-items";<br />

String text = "I love posting files to <strong>Chatter</strong>!";<br />

File contentFile = getFile();<br />

String description = "This is a test file that I'm posting.";<br />

String title = "contentFile";<br />

Part[] parts = {<br />

new StringPart("description", description),<br />

new StringPart("title", fileName),<br />

new StringPart("text", text),<br />

new FilePart("feedItemFileUpload", contentFile),<br />

};<br />

final PostMethod postMethod = new PostMethod(url);<br />

try {<br />

postMethod.setRequestEntity(new MultipartRequestEntity(parts,<br />

postMethod.getParams()));<br />

postMethod.setRequestHeader("Authorization", "Bearer " + oauthToken);<br />

postMethod.setRequestHeader("Content-type", "multipart/form-data")<br />

postMethod.addRequestHeader("X-PrettyPrint", "1");<br />

HttpClient httpClient = new HttpClient();<br />

httpClient.getParams().setSoTimeout(60000);<br />

int returnCode = httpClient.executeMethod(postMethod);<br />

System.out.println(postMethod.getResponseBodyAsString());<br />

assertTrue("Expected return code of: " + HttpStatus.SC_CREATED,<br />

returnCode == HttpStatus.SC_CREATED);<br />

} finally {<br />

postMethod.releaseConnection();<br />

}<br />

Example of a link post<br />

The following creates a link post using the request parameters:<br />

/chatter/feeds/news/me/feed-items?text=Did+you+see+this?&url=http://www.chatter.<strong>com</strong><br />

The following is the request body for creating a link in a feed-item post:<br />

{ "body" : {<br />

"messageSegments" : [<br />

131


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

}<br />

}<br />

]<br />

{<br />

},<br />

{<br />

}<br />

"type": "Link",<br />

"url" : "http://www.chatter.<strong>com</strong>"<br />

"type": "Text",<br />

"text" : "Is everyone following this?"<br />

The following is the request body for including a link as an attachment to a feed-item post:<br />

{ "body" : {<br />

"messageSegments" : [<br />

{<br />

"type": "Text",<br />

"text" : "Is everyone following this?"<br />

}<br />

]<br />

},<br />

"attachment" :{<br />

"url" : "http://www.chatter.<strong>com</strong>",<br />

"urlName" : "The Future of Social Enterprise"<br />

}<br />

}<br />

News Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

or<br />

/chatter/feeds/news/me/feed-items/flat<br />

/chatter/feeds/news/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

132


<strong>Chatter</strong> <strong>API</strong> Resources<br />

News Feed Resources<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

Integer<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

Example response<br />

{<br />

"items" : [ {<br />

"type" : "Comment",<br />

"item" : {<br />

"parent" : {<br />

"id" : "005D0000001L3zVIAS",<br />

"url" : "/services/data/v27.0/chatter/users/005D0000001L3zVIAS"<br />

},<br />

"id" : "0D7D00000000N5rKAE",<br />

"type" : "TextComment",<br />

"user" : {<br />

"name" : "Pierre Delacruix",<br />

"title" : null,<br />

"firstName" : "Pierre",<br />

"lastName" : "Delacruix",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"<strong>com</strong>panyName" : "Seattle Apps",<br />

"mySubscription" : null,<br />

133


<strong>Chatter</strong> <strong>API</strong> Resources<br />

People Feed Resources<br />

"photo" : {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1i9x6Z16L8wXEGigpcWjAd",<br />

"largePhotoUrl" : "https://instance_name/profilephoto/729D00000000Fj1/F",<br />

"photoVersionId" : "729D00000000Fj1IAE",<br />

"smallPhotoUrl" : "https://instance_name/profilephoto/729D00000000Fj1/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1q43x_rW2ciXBHst0Eh3Y6",<br />

}<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"isActive" : false,<br />

"id" : "005D0000001L3zVIAS",<br />

"url" : "/services/data/v27.0/chatter/users/005D0000001L3zVIAS",<br />

"type" : "User"<br />

},<br />

"url" : "/services/data/v27.0/chatter/<strong>com</strong>ments/0D7D00000000N5rKAE",<br />

"userType" : "Internal",<br />

"body" : {<br />

"text" : "Time to get working",<br />

"messageSegments" : [ {<br />

"type" : "Text",<br />

"text" : "Time to get working"<br />

} ]<br />

},<br />

"clientInfo" : null,<br />

"createdDate" : "2012-03-18T00:03:20.000Z",<br />

"likes" : {<br />

"total" : 0,<br />

"likes" : [ ],<br />

"nextPageUrl" : null,<br />

"currentPageUrl" : null,<br />

"previousPageUrl" : null<br />

},<br />

"isDeleteRestricted" : false,<br />

"myLike" : null,<br />

"attachment" : null,<br />

"feedItem" : {<br />

"id" : "0D5D0000000HWC2KAO",<br />

"url" : "/services/data/v27.0/chatter/feed-items/0D5D0000000HWC2KAO"<br />

}<br />

People Feed Resources<br />

All feed items posted by all of the people the current user follows.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/people/me<br />

/chatter/feeds/people/me/feed-items<br />

Description<br />

Returns a URL to the feed-items for all the people the current<br />

user is following.<br />

Returns all the feed items from all the people the current user<br />

follows.<br />

134


<strong>Chatter</strong> <strong>API</strong> Resources<br />

People Feed Resources<br />

People Feed URL<br />

Returns a URL to the feed-items for all the people the current user is following.<br />

Resource<br />

/chatter/feeds/people/me<br />

or<br />

/chatter/feeds/people/userId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

People Feed Items<br />

Returns all the feed items from all the people the current user follows.<br />

Resource<br />

/chatter/feeds/people/me/feed-items<br />

or<br />

/chatter/feeds/people/userId/feed-items<br />

Note: userId must be the same as the logged-in user.<br />

135


<strong>Chatter</strong> <strong>API</strong> Resources<br />

People Feed Resources<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

sort<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed Item Page<br />

People Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

/chatter/feeds/people/me/feed-items/flat<br />

136


<strong>Chatter</strong> <strong>API</strong> Resources<br />

People Feed Resources<br />

or<br />

/chatter/feeds/people/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

Integer<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

137


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Record Feed Resource<br />

The feed of the specified record, which could be a group, person, object, file and so on.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/record/me<br />

/chatter/feeds/record/me/feed-items<br />

Description<br />

Returns a URL to the feed-items for all the records the current<br />

user is following, or a URL to all the feed-items of the<br />

specified recordId.<br />

Returns the feed-items for all the records the current, signed-in<br />

user is following, or all the feed-items of the specified<br />

recordId. You can also use this resource to post a new feed<br />

item and to search a group feed.<br />

Record Feed URL<br />

Returns a URL to the feed-items for all the records the current user is following, or a URL to all the feed-items of the specified<br />

recordId.<br />

Resource<br />

/chatter/feeds/record/me<br />

or<br />

/chatter/feeds/record/recordId<br />

Note: If recordId is a user ID, it must be the same as the current user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

138


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Response body<br />

Feed<br />

Record Feed Items<br />

Returns the feed-items for all the records the current, signed-in user is following, or all the feed-items of the specified recordId.<br />

You can also use this resource to post a new feed item and to search a group feed.<br />

For information about posting a feed item, see Using POST, PATCH, or PUT for Input.<br />

To upload a binary file, you must send it as a body part in a multipart/form-data request. You can send information such as<br />

the text of a post or <strong>com</strong>ment as a JSON or XML rich input body part in the same multipart/form-data request. Alternately,<br />

you can choose to send that information in request parameters. If you pass both a rich input request body and request parameters,<br />

the request parameters are ignored. For information about how to create the multipart/form-data message, see Uploading<br />

Binary Files.<br />

The visibility parameter is available for posting to most feeds. However, only the Record Feed-Items resource can specify<br />

the value InternalUsers, and only when the record is not a user or a group. All other resources, if you specify the<br />

visibility parameter, you must use AllUsers. In addition, portal users cannot specify InternalUsers, as they wouldn’t<br />

be able to see the post. In general, for posts not to a user or group, the default value for visibility matches the logged-in user<br />

who is posting: internal users post with a visibility of InternalUsers, while portal users post with the visibility of AllUsers.<br />

Resource<br />

or<br />

/chatter/feeds/record/me/feed-items<br />

/chatter/feeds/record/recordId/feed-items<br />

Note: If recordId is a user ID, it must be the same as the current user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST or HEAD<br />

Request body for POST<br />

Root XML tag<br />

JSON<br />

<br />

The following example attaches a poll to a feed item:<br />

{ "attachment":<br />

{<br />

"attachmentType":"Poll",<br />

"pollChoices": [<br />

"Monday",<br />

"Tuesday"<br />

]<br />

139


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

}<br />

},<br />

"body" : {<br />

"messageSegments" : [<br />

{<br />

"type" : "Text",<br />

"text" : "When should we meet for release planning?"<br />

}<br />

]<br />

}<br />

Properties<br />

Name<br />

attachment<br />

Type<br />

Depends on type<br />

Description<br />

Optional. You can specify only one of<br />

these values in the attachment parameter.<br />

Values are:<br />

• Attachment Input: Existing Content<br />

(v23.0)<br />

• Attachment Input: Feed Poll (v26.0)<br />

• Attachment Input: Link (v23.0)<br />

• Attachment Input: New File Upload<br />

(v23.0)<br />

Note: To upload a new file,<br />

you must include it in a<br />

multipart/form–data<br />

message. See Uploading<br />

Binary Files.<br />

Available<br />

Version<br />

body<br />

isBookmarkedByCurrentUser<br />

originalFeedItemId<br />

Message Body Input<br />

Boolean<br />

String<br />

Description of message body<br />

Optional. Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default value is<br />

false.<br />

Optional. If this feed item is shared, this<br />

is the original feed item 18-character Id<br />

Note: This parameter takes<br />

precedence over all other<br />

parameters. For example, if you<br />

share a post and also try to<br />

upload a file, the generated<br />

feed-item only contains the<br />

shared post. You should only<br />

share a post or upload a file, not<br />

both in the same post.<br />

23.0<br />

24.0<br />

24.0<br />

140


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Name<br />

Type<br />

Description<br />

Available<br />

Version<br />

visibility<br />

String<br />

Optional. Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers specified.<br />

Also see Record Feed Items for more<br />

information about visibility<br />

Request parameters for POST<br />

Use one of the following sets of parameters. For example, you can’t post a link and attach a file in the same request.<br />

Parameters for attaching an existing file<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

attachmentType<br />

String<br />

The attachment type. Must contain<br />

the value ExistingContent.<br />

Required<br />

27.0<br />

contentDocumentId<br />

String<br />

ID of an existing file.<br />

Required<br />

23.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item should<br />

be bookmarked for the user (true) or<br />

not (false). Default value is false.<br />

Optional<br />

26.0<br />

visibility<br />

String<br />

Who can see the post. Valid values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for more<br />

information about visibility.<br />

Parameters for attaching a new file<br />

141


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

attachmentType<br />

String<br />

The attachment type. Must contain<br />

the value NewFile.<br />

Required<br />

27.0<br />

desc<br />

String<br />

Description of file being posted.<br />

Optional<br />

23.0–26.0<br />

Attention: This<br />

parameter should not<br />

be used as of version<br />

27.0. Use<br />

description<br />

instead.<br />

description<br />

String<br />

Description of file being posted.<br />

Optional<br />

27.0<br />

fileName<br />

String<br />

File name of the file being posted.<br />

Required<br />

23.0–24.0<br />

Attention: This<br />

parameter should not<br />

be used as of version<br />

24.0. Use title<br />

instead.<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item should<br />

be bookmarked for the user (true) or<br />

not (false). Default value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

title<br />

String<br />

File name of a file to be uploaded and<br />

posted.<br />

Required<br />

24.0<br />

visibility<br />

String<br />

Who can see the post. Valid values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for more<br />

information about visibility.<br />

Parameters for posting a link<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Link.<br />

Required<br />

27.0<br />

142


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the<br />

user (true) or not (false).<br />

Default value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

url<br />

String<br />

URL of the link.<br />

Required<br />

23.0<br />

urlName<br />

String<br />

Name of the URL.<br />

Optional<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with<br />

AllUsers specified.<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Parameters for posting a poll<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Poll.<br />

Required<br />

27.0<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default<br />

value is false.<br />

Optional<br />

26.0<br />

pollChoice1 through<br />

pollChoice10<br />

String<br />

The choices used to create a new<br />

feed item with a poll. You must<br />

specify 2–10 poll choices for each<br />

poll.<br />

Required<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Required<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid values<br />

are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

143


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Parameters for sharing a post<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

Version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the<br />

user (true) or not (false).<br />

Default value is false.<br />

Optional<br />

26.0<br />

originalFeedItemId<br />

String<br />

The Id of the feed item you<br />

want to share.18-character Id<br />

Required<br />

24.0<br />

Note: Sharing a post<br />

takes precedence over<br />

uploading a file. Do<br />

not share a post and<br />

upload a file in the<br />

same post.<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still<br />

won’t see posts with<br />

AllUsers specified.<br />

Also see Record Feed-Items<br />

for more information about<br />

visibility.<br />

Text post parameters<br />

144


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default<br />

value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Required<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid values<br />

are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Request parameters for GET or HEAD<br />

Parameter<br />

Name<br />

page<br />

pageSize<br />

q<br />

sort<br />

Type<br />

Token<br />

Integer<br />

String<br />

Description<br />

A generated token that<br />

indicates the view of feed<br />

items in the feed.<br />

Required or<br />

Optional<br />

Optional<br />

Specifies the number of items Optional<br />

per page. Valid values are<br />

between 1 and 100. If you<br />

don't specify a size, the default<br />

is 25.<br />

Search for one or more Optional<br />

keywords in the body and<br />

<strong>com</strong>ment of feed items in a<br />

record feed. The search string<br />

can contain wildcards and<br />

must contain at least two<br />

characters that aren’t<br />

wildcards. See Using<br />

Wildcards..<br />

String. One of the following: Sorts the feed items by most<br />

• CreatedDateDesc recent post date<br />

• LastModifiedDateDesc (CreatedDateDesc) or by<br />

most recent activity<br />

Optional<br />

Since version<br />

23.0<br />

23.0<br />

27.0<br />

23.0<br />

145


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Parameter<br />

Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since version<br />

(LastModifiedDateDesc).<br />

Activity includes posts and<br />

<strong>com</strong>ments. The default is<br />

CreatedDateDesc.<br />

Response body for GET or HEAD<br />

Feed Item Page<br />

Response body for POST<br />

Feed Item<br />

Example response body for POST<br />

{<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feeds/record/005D0000001LL8OIAW/feed-items",<br />

"isModifiedToken": null,<br />

"isModifiedUrl": null,<br />

"items": [<br />

{<br />

"actor": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"attachment": {<br />

"description": null,<br />

"icon": null,<br />

"linkUrl": "null",<br />

146


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

"subtype": "CollaborationGroupCreated",<br />

"title": null,<br />

"type": "BasicTemplate"<br />

},<br />

"body": {<br />

"messageSegments": [<br />

{<br />

"text": "created the public group ",<br />

"type": "Text"<br />

},<br />

{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

"reference": {<br />

"id": "0F9D00000000I1dKAE",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000I1dKAE"<br />

},<br />

"text": "All Seattle Apps",<br />

"type": "EntityLink"<br />

},<br />

{<br />

"text": ".",<br />

"type": "Text"<br />

}<br />

],<br />

"text": "created the public group All Seattle Apps."<br />

},<br />

"canShare": false,<br />

"clientInfo": null,<br />

"<strong>com</strong>ments": {<br />

"<strong>com</strong>ments": [],<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000Hw6oKAC/<strong>com</strong>ments",<br />

"nextPageUrl": null,<br />

"total": 0<br />

},<br />

"createdDate": "2012-09-07T04:19:17.000Z",<br />

"event": false,<br />

"id": "0D5D0000000Hw6oKAC",<br />

"isBookmarkedByCurrentUser": false,<br />

"isDeleteRestricted": true,<br />

"isLikedByCurrentUser": false,<br />

"likes": {<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000Hw6oKAC/likes",<br />

"likes": [],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

},<br />

"likesMessage": null,<br />

"modifiedDate": "2012-09-07T04:19:17.000Z",<br />

"myLike": null,<br />

"originalFeedItem": null,<br />

"originalFeedItemActor": null,<br />

"parent": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

147


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

},<br />

{<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"photoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"preamble": {<br />

"messageSegments": [{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"reference": {<br />

"id": "005D0000001LL8OIAW",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW"<br />

},<br />

"text": "Deanna Li",<br />

"type": "EntityLink"<br />

}],<br />

"text": "Deanna Li"<br />

},<br />

"topics": null,<br />

"type": "BasicTemplateFeedItem",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000Hw6oKAC",<br />

"visibility": "AllUsers"<br />

"actor": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

148


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"attachment": {<br />

"description": null,<br />

"icon": null,<br />

"linkUrl": "null",<br />

"subtype": "CollaborationGroupCreated",<br />

"title": null,<br />

"type": "BasicTemplate"<br />

},<br />

"body": {<br />

"messageSegments": [<br />

{<br />

"text": "created the public group ",<br />

"type": "Text"<br />

},<br />

{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

"reference": {<br />

"id": "0F9D00000000I1YKAU",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000I1YKAU"<br />

},<br />

"text": "All Universal Containers",<br />

"type": "EntityLink"<br />

},<br />

{<br />

"text": ".",<br />

"type": "Text"<br />

}<br />

],<br />

"text": "created the public group All Universal Containers."<br />

},<br />

"canShare": false,<br />

"clientInfo": null,<br />

"<strong>com</strong>ments": {<br />

"<strong>com</strong>ments": [],<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000Hw6jKAC/<strong>com</strong>ments",<br />

"nextPageUrl": null,<br />

"total": 0<br />

},<br />

"createdDate": "2012-09-07T04:18:34.000Z",<br />

"event": false,<br />

"id": "0D5D0000000Hw6jKAC",<br />

"isBookmarkedByCurrentUser": false,<br />

"isDeleteRestricted": true,<br />

"isLikedByCurrentUser": false,<br />

"likes": {<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000Hw6jKAC/likes",<br />

"likes": [],<br />

149


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

},<br />

"likesMessage": null,<br />

"modifiedDate": "2012-09-07T04:18:34.000Z",<br />

"myLike": null,<br />

"originalFeedItem": null,<br />

"originalFeedItemActor": null,<br />

"parent": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saBc65JKjmm4DaxyLRr1XQK",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZNDZe0BfzuOg1WyB6Vo-DB",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"photoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"preamble": {<br />

"messageSegments": [{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"reference": {<br />

"id": "005D0000001LL8OIAW",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW"<br />

},<br />

"text": "Deanna Li",<br />

"type": "EntityLink"<br />

}],<br />

"text": "Deanna Li"<br />

},<br />

"topics": null,<br />

"type": "BasicTemplateFeedItem",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000Hw6jKAC",<br />

"visibility": "AllUsers"<br />

}<br />

],<br />

"nextPageUrl": null<br />

150


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

Example for GET<br />

This request searches for feed items that contain the string track:<br />

/chatter/feeds/record/me/feed-items?q=track<br />

In the Feed Item Page response body, the string track is found in the feed-items/items/body/text property:<br />

{<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feeds/record/005D0000001LL8OIAW/feed-items",<br />

"isModifiedToken": null,<br />

"isModifiedUrl": null,<br />

"items": [{<br />

"actor": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5savQXz9sPZRCJJB7fC4UIka",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saluKolvB94ZwqX5yHBSBOh",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"attachment": null,<br />

"body": {<br />

"messageSegments": [{<br />

"text": "I&#39;m building an app to track &quot;floater&quot; holidays.<br />

Does anyone have any feature requests?",<br />

"type": "Text"<br />

}],<br />

"text": "I&#39;m building an app to track &quot;floater&quot; holidays.<br />

Does anyone have any feature requests?"<br />

},<br />

"canShare": true,<br />

"clientInfo": null,<br />

"<strong>com</strong>ments": {<br />

"<strong>com</strong>ments": [],<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000HwkyKAC/<strong>com</strong>ments",<br />

"nextPageUrl": null,<br />

"total": 4<br />

},<br />

"createdDate": "2012-09-12T00:54:27.000Z",<br />

151


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

"event": false,<br />

"id": "0D5D0000000HwkyKAC",<br />

"isBookmarkedByCurrentUser": false,<br />

"isDeleteRestricted": false,<br />

"isLikedByCurrentUser": false,<br />

"likes": {<br />

"currentPageUrl":<br />

"/services/data/v27.0/chatter/feed-items/0D5D0000000HwkyKAC/likes",<br />

"likes": [],<br />

"nextPageUrl": null,<br />

"previousPageUrl": null,<br />

"total": 0<br />

},<br />

"likesMessage": null,<br />

"modifiedDate": "2012-09-12T01:01:42.000Z",<br />

"myLike": null,<br />

"originalFeedItem": null,<br />

"originalFeedItemActor": null,<br />

"parent": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5savQXz9sPZRCJJB7fC4UIka",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saluKolvB94ZwqX5yHBSBOh",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"photoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"preamble": {<br />

"messageSegments": [{<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"reference": {<br />

"id": "005D0000001LL8OIAW",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW"<br />

},<br />

"text": "Deanna Li",<br />

"type": "EntityLink"<br />

}],<br />

"text": "Deanna Li"<br />

},<br />

"topics": null,<br />

152


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Record Feed Resource<br />

}<br />

"type": "TextPost",<br />

"url": "/services/data/v27.0/chatter/feed-items/0D5D0000000HwkyKAC",<br />

"visibility": "AllUsers"<br />

}],<br />

"nextPageUrl": null<br />

Record Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

/chatter/feeds/record/me/feed-items/flat<br />

or<br />

/chatter/feeds/record/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

page<br />

Type<br />

Integer<br />

String<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

153


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Records Resources<br />

Parameter Name<br />

recentCommentCount<br />

sort<br />

Type<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

See Also:<br />

Records Resources<br />

Records Resources<br />

Information about the specified record, including followers.<br />

Note: This is not a feed. To obtain a feed for a record, use the Record Feed Resource.<br />

Available resources are:<br />

Resource<br />

/chatter/records/recordId<br />

/chatter/records/recordId/followers<br />

Description<br />

Returns information about the specific record, such as the<br />

name of the record, the record type, a URL to the feed-items<br />

for the record, and so on.<br />

Returns information about the followers of the specified<br />

record.<br />

Record Information<br />

Returns information about the specific record, such as the name of the record, the record type, a URL to the feed-items for<br />

the record, and so on.<br />

Resource<br />

/chatter/records/recordId<br />

Available since version<br />

23.0<br />

154


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Records Resources<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Record Summary<br />

Example response body<br />

{<br />

}<br />

"id": "069D00000001FHFIA2",<br />

"motif": {<br />

"largeIconUrl": "/img/content/content64.png",<br />

"mediumIconUrl": "/img/content/content32.png",<br />

"smallIconUrl": "/img/icon/files16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T5fwKAC",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5fwKAC"<br />

},<br />

"name": "sales",<br />

"type": "ContentDocument",<br />

"url": "/services/data/v27.0/chatter/files/069D00000001FHFIA2"<br />

Record Followers<br />

Returns information about the followers of the specified record.<br />

Resource<br />

/chatter/records/recordId/followers<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Integer<br />

Integer<br />

Description<br />

An integer specifying a page of items.<br />

The default value is 0, which returns<br />

the first page.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 1000.<br />

If you don't specify a size, the default<br />

is 25.<br />

155


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Subscriptions Resource<br />

Response body<br />

Subscription Page<br />

See Also:<br />

Record Feed Resource<br />

Subscriptions Resource<br />

Information about the specified subscription. Also used to delete a subscription, for example, to unfollow a record. A subscription<br />

ID is returned as part of the response body for follower and following resources, for example,<br />

/records/recordId/followers. In addition, subscriptions IDs are also returned in many summary response bodies, such<br />

as group summary or user summary.<br />

Resource<br />

/chatter/subscriptions/subscriptionId<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, DELETE, or HEAD<br />

Response body for GET or HEAD<br />

Subscription<br />

Example response body for GET<br />

{<br />

"<strong>com</strong>munity": null,<br />

"id": "0E8D0000000T5ZUKA0",<br />

"subject": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Gordon",<br />

"id": "005D0000001LLO1IAO",<br />

"isActive": true,<br />

"lastName": "Johnson",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T5ZUKA0",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5ZUKA0"<br />

},<br />

"name": "Gordon Johnson",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cPhKrC7plNhUw5eOz7Aj1u91Xc_BCo43jyG-NY5CSIcR",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJL/F",<br />

"photoVersionId": "729D00000000LJLIA2",<br />

156


<strong>Chatter</strong> <strong>API</strong> Resources<br />

To Feed Resources<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJL/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cPhKrC7plNhUw5eOz7Aj1u-3RD3PFAzXpfnjWrX0_Inp",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO/photo"<br />

},<br />

"title": "VP Sales",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO",<br />

"userType": "Internal"<br />

},<br />

"subscriber": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Deanna",<br />

"id": "005D0000001LL8OIAW",<br />

"isActive": true,<br />

"lastName": "Li",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Deanna Li",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5savQXz9sPZRCJJB7fC4UIka",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/F",<br />

"photoVersionId": "729D00000000LJFIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJF/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5saluKolvB94ZwqX5yHBSBOh",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW",<br />

"userType": "Internal"<br />

},<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5ZUKA0"<br />

To Feed Resources<br />

Feed of all @mentions of the current user and posts others make to the logged-in user's feed.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/to/me<br />

/chatter/feeds/to/me/feed-items<br />

Description<br />

Returns a URL to the feed-items for the feed of the logged-in<br />

user.<br />

Returns the feed-items for all @mentions of the logged-in<br />

user, and all posts made to the user's feed.<br />

157


<strong>Chatter</strong> <strong>API</strong> Resources<br />

To Feed Resources<br />

To Feed URL<br />

Returns a URL to the feed-items for the feed of the logged-in user.<br />

Resource<br />

/chatter/feeds/to/me<br />

OR<br />

/chatter/feeds/to/userId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

To Feed Items<br />

Returns the feed-items for all @mentions of the logged-in user, and all posts made to the user's feed. The To Feed includes<br />

posts that mention you and posts that other users make to your wall. Your own posts are included only if they have a <strong>com</strong>ment.<br />

The <strong>com</strong>ment can be from you or from another user.<br />

Resource<br />

/chatter/feeds/to/me/feed-items<br />

OR<br />

/chatter/feeds/to/userId/feed-items<br />

158


<strong>Chatter</strong> <strong>API</strong> Resources<br />

To Feed Resources<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body for GET or HEAD<br />

Feed Item Page<br />

To Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

/chatter/feeds/to/me/feed-items/flat<br />

or<br />

/chatter/feeds/to/userId/feed-items/flat<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

25.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

Type<br />

Integer<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

159


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Topics Resource<br />

Parameter Name<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

Topics Resource<br />

Trending Topics<br />

List of the trending hashtag topics for the organization.<br />

Resource<br />

/chatter/topics/trending<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

maxResults<br />

Values<br />

Integer<br />

Description<br />

Maximum number of trending topics<br />

that get returned. The default is 5.<br />

Value must be greater than 0 and less<br />

than 100.<br />

160


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Response body<br />

Topics<br />

Example response body<br />

{"topics" : [<br />

{<br />

"name" : "#UniversalPaper"<br />

},<br />

{<br />

"name" : "#caseUpdates"<br />

},<br />

{<br />

"name" : "#salesTips"<br />

},<br />

{<br />

"name" : "#<strong>com</strong>panypicnic"<br />

},<br />

{<br />

"name" : "#AccountExecs"<br />

}<br />

]}<br />

User-Profile Feed Resources<br />

Feed of actions by the current user on records that can be tracked in a feed. This is different than/chatter/feeds/news,<br />

which returns more items, including posts, group updates, and record updates. You can also post feed items to the user-profile<br />

feed.<br />

Note: The <strong>com</strong>position of this feed may change between releases in order to match the feed displayed in <strong>Chatter</strong>.<br />

Available resources are:<br />

Resource<br />

/chatter/feeds/user-profile/me<br />

/chatter/feeds/user-profile/me/feed-items<br />

Description<br />

Returns a URL to the feed-items for the user-profile feed.<br />

Returns the feed-items for all actions on all records that can<br />

be tracked in a feed. You can also use this resource to post a<br />

new feed item.<br />

User–Profile Feed URL<br />

Returns a URL to the feed-items for the user-profile feed.<br />

Resource<br />

or<br />

/chatter/feeds/user-profile/me<br />

/chatter/feeds/user-profile/userId<br />

161


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

sort<br />

Type<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body<br />

Feed<br />

User–Profile Feed Items<br />

Returns the feed-items for all actions on all records that can be tracked in a feed. You can also use this resource to post a new<br />

feed item.<br />

For information about posting a feed item, see Using POST, PATCH, or PUT for Input.<br />

To upload a binary file, you must send it as a body part in a multipart/form-data request. You can send information such as<br />

the text of a post or <strong>com</strong>ment as a JSON or XML rich input body part in the same multipart/form-data request. Alternately,<br />

you can choose to send that information in request parameters. If you pass both a rich input request body and request parameters,<br />

the request parameters are ignored. For information about how to create the multipart/form-data message, see Uploading<br />

Binary Files.<br />

Resource<br />

or<br />

/chatter/feeds/user-profile/me/feed-items<br />

/chatter/feeds/user-profile/userId/feed-items<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST or HEAD<br />

Request body for POST<br />

Root XML tag<br />

<br />

162


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

JSON<br />

The following example attaches a poll to a feed item:<br />

{ "attachment":<br />

{<br />

"attachmentType":"Poll",<br />

"pollChoices": [<br />

"Monday",<br />

"Tuesday"<br />

]<br />

},<br />

"body" : {<br />

"messageSegments" : [<br />

{<br />

"type" : "Text",<br />

"text" : "When should we meet for release planning?"<br />

}<br />

]<br />

}<br />

}<br />

Properties<br />

Name<br />

attachment<br />

Type<br />

Depends on type<br />

Description<br />

Optional. You can specify only one of<br />

these values in the attachment parameter.<br />

Values are:<br />

• Attachment Input: Existing Content<br />

(v23.0)<br />

• Attachment Input: Feed Poll (v26.0)<br />

• Attachment Input: Link (v23.0)<br />

• Attachment Input: New File Upload<br />

(v23.0)<br />

Note: To upload a new file,<br />

you must include it in a<br />

multipart/form–data<br />

message. See Uploading<br />

Binary Files.<br />

Available<br />

Version<br />

body<br />

Message Body Input<br />

Description of message body<br />

23.0<br />

isBookmarkedByCurrentUser<br />

Boolean<br />

Optional. Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default value is<br />

false.<br />

24.0<br />

163


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Name<br />

originalFeedItemId<br />

Type<br />

String<br />

Description<br />

Optional. If this feed item is shared, this<br />

is the original feed item 18-character Id<br />

Note: This parameter takes<br />

precedence over all other<br />

parameters. For example, if you<br />

share a post and also try to<br />

upload a file, the generated<br />

feed-item only contains the<br />

shared post. You should only<br />

share a post or upload a file, not<br />

both in the same post.<br />

Available<br />

Version<br />

24.0<br />

visibility<br />

String<br />

Optional. Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers specified.<br />

Also see Record Feed Items for more<br />

information about visibility<br />

Request parameters for POST<br />

Use one of the following sets of parameters. For example, you can’t post a link and attach a file in the same request.<br />

Parameters for attaching an existing file<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

attachmentType<br />

String<br />

The attachment type. Must contain<br />

the value ExistingContent.<br />

Required<br />

27.0<br />

contentDocumentId<br />

String<br />

ID of an existing file.<br />

Required<br />

23.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item should<br />

be bookmarked for the user (true) or<br />

not (false). Default value is false.<br />

Optional<br />

26.0<br />

visibility<br />

String<br />

Who can see the post. Valid values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

164


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for more<br />

information about visibility.<br />

Parameters for attaching a new file<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

attachmentType<br />

String<br />

The attachment type. Must contain<br />

the value NewFile.<br />

Required<br />

27.0<br />

desc<br />

String<br />

Description of file being posted.<br />

Optional<br />

23.0–26.0<br />

Attention: This<br />

parameter should not<br />

be used as of version<br />

27.0. Use<br />

description<br />

instead.<br />

description<br />

String<br />

Description of file being posted.<br />

Optional<br />

27.0<br />

fileName<br />

String<br />

File name of the file being posted.<br />

Required<br />

23.0–24.0<br />

Attention: This<br />

parameter should not<br />

be used as of version<br />

24.0. Use title<br />

instead.<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item should<br />

be bookmarked for the user (true) or<br />

not (false). Default value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

title<br />

String<br />

File name of a file to be uploaded and<br />

posted.<br />

Required<br />

24.0<br />

visibility<br />

String<br />

Who can see the post. Valid values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

165


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

Version<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t see<br />

posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for more<br />

information about visibility.<br />

Parameters for posting a link<br />

Parameter Name<br />

Type<br />

Description<br />

Required or Optional<br />

Since<br />

version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Link.<br />

Required<br />

27.0<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the<br />

user (true) or not (false).<br />

Default value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

url<br />

String<br />

URL of the link.<br />

Required<br />

23.0<br />

urlName<br />

String<br />

Name of the URL.<br />

Optional<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with<br />

AllUsers specified.<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Parameters for posting a poll<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Poll.<br />

Required<br />

27.0<br />

166


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default<br />

value is false.<br />

Optional<br />

26.0<br />

pollChoice1 through<br />

pollChoice10<br />

String<br />

The choices used to create a new<br />

feed item with a poll. You must<br />

specify 2–10 poll choices for each<br />

poll.<br />

Required<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Required<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid values<br />

are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Parameters for sharing a post<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

Version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the<br />

user (true) or not (false).<br />

Default value is false.<br />

Optional<br />

26.0<br />

originalFeedItemId<br />

String<br />

The Id of the feed item you<br />

want to share.18-character Id<br />

Required<br />

24.0<br />

Note: Sharing a post<br />

takes precedence over<br />

uploading a file. Do<br />

not share a post and<br />

upload a file in the<br />

same post.<br />

text<br />

String<br />

Text of the feed item.<br />

Optional<br />

23.0<br />

167


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

Version<br />

visibility<br />

String<br />

Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still<br />

won’t see posts with<br />

AllUsers specified.<br />

Also see Record Feed-Items<br />

for more information about<br />

visibility.<br />

Text post parameters<br />

Parameter Name<br />

Type<br />

Description<br />

Required or<br />

Optional<br />

Since<br />

version<br />

isBookmarkedByCurrentUser<br />

String<br />

Specifies if the new feed item<br />

should be bookmarked for the user<br />

(true) or not (false). Default<br />

value is false.<br />

Optional<br />

26.0<br />

text<br />

String<br />

Text of the feed item.<br />

Required<br />

23.0<br />

visibility<br />

String<br />

Who can see the post. Valid values<br />

are:<br />

• InternalUsers<br />

• AllUsers<br />

Optional<br />

26.0<br />

Note: Portal users in<br />

<strong>com</strong>munities still won’t<br />

see posts with AllUsers<br />

specified.<br />

Also see Record Feed-Items for<br />

more information about<br />

visibility.<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

page<br />

Type<br />

String<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

168


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User-Profile Feed Resources<br />

Parameter Name<br />

Type<br />

Description<br />

response body, in one of the URL<br />

parameters, such as nextPageURL, for<br />

example:<br />

"nextPageUrl":<br />

"/services/data/v27.0/<br />

chatter/feeds/news/<br />

005D0000001GLowIAN<br />

/feed-items<br />

?page=2011-03-30T17:34:50Z,<br />

0D5D0000000DSv4KAG"<br />

pageSize<br />

sort<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Sorts the feed items by most recent<br />

post date (CreatedDateDesc) or by<br />

most recent activity<br />

(LastModifiedDateDesc). Activity<br />

includes posts and <strong>com</strong>ments. The<br />

default is CreatedDateDesc.<br />

Response body for GET or HEAD<br />

Feed Item Page<br />

Response body for POST<br />

Feed Item<br />

User-Profile Feed Items Flat<br />

This resource is deprecated as of version 26.0.<br />

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and <strong>com</strong>ments: Feed items and <strong>com</strong>ments<br />

are at the same level. All items are returned in chronological order.<br />

Resource<br />

or<br />

/chatter/feeds/user-profile/me/feed-items/flat<br />

/chatter/feeds/user-profile/userId/feed-items/flat<br />

Available since version<br />

25.0<br />

169


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Users Resources<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

numFeedItems<br />

page<br />

recentCommentCount<br />

sort<br />

Type<br />

Integer<br />

String<br />

Integer<br />

String. One of the following:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Description<br />

Specifies the number of feed items<br />

returned. Valid values are between 0<br />

and 100. Default value is 25. Because<br />

feed items may include <strong>com</strong>ments,<br />

specifying 25 flat feed items may<br />

actually return more. For example, if<br />

each feed item has one <strong>com</strong>ment, and<br />

recentCommentCount is greater than<br />

1, 50 flat feed items are returned.<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of recent<br />

<strong>com</strong>ments returned. Valid values are<br />

between 0 and 25. Default value is 3.<br />

Sorts the returned feed either by<br />

created date in ascending order, or by<br />

last modified date, also in ascending<br />

order. The default is<br />

LastModifiedDateDesc<br />

Response body<br />

Flat Feed<br />

Users Resources<br />

Information about the user, such as who is following the user, the user’s files or re<strong>com</strong>mendations. Also used for posting feed<br />

items and updating conversation status.<br />

Available resources are:<br />

Resource<br />

/chatter/users<br />

/chatter/users/me<br />

Description<br />

Returns information about all users in an<br />

organization.<br />

Returns information about the logged-in or<br />

specified user's profile.<br />

170


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Users Resources<br />

Resource<br />

/chatter/users/batch/user_list<br />

/chatter/users/me/conversations<br />

/chatter/users/me/conversations/conversationId<br />

/chatter/users/me/conversations/conversationId/mark-read<br />

/chatter/users/me/conversations/unread-count<br />

/chatter/users/me/files/<br />

/chatter/users/me/files/filter/groups<br />

/chatter/users/me/files/filter/sharedwithme<br />

/chatter/users/me/followers<br />

/chatter/users/me/following<br />

/chatter/users/me/groups<br />

/chatter/users/me/messages<br />

/chatter/users/me/messages/messageId<br />

/chatter/users/me/photo<br />

/chatter/users/me/re<strong>com</strong>mendations<br />

/chatter/users/me/re<strong>com</strong>mendations/action<br />

/chatter/users/me/re<strong>com</strong>mendations/action/objectCategory<br />

/chatter/users/me/re<strong>com</strong>mendations/action/idPrefix<br />

Description<br />

Returns information about the specified users’<br />

profiles.<br />

Returns all private conversations for the<br />

logged–in user. Also used to search across all<br />

conversations.<br />

Returns information about the specified private<br />

conversation for the logged-in user. Also used<br />

to search within a specific conversation.<br />

Changes the status of the specified conversation.<br />

Returns the number of conversations that have<br />

unread messages for the logged-in or specified<br />

user.<br />

Post a file or get information about files a user<br />

owns. These files don’t include files shared with<br />

a user, files a user follows, or general<br />

organization files.<br />

Returns information about files posted to<br />

groups that the specified user is a member of.<br />

Returns information about files that have been<br />

shared with the specified user.<br />

Returns information about the followers for the<br />

specified user.<br />

Returns a list of people, groups, records, and<br />

files that the specified user is following. Also<br />

used to follow records.<br />

Returns the groups the specified user is a<br />

member of.<br />

Returns all the messages for all the private<br />

conversations for the logged-in user. Also used<br />

to search across all messages and post a message.<br />

Returns the specified message.<br />

Get the URL of a user photo and post a user<br />

photo.<br />

Returns the user, group, file, and record<br />

re<strong>com</strong>mendations for the logged-in user.<br />

Returns the re<strong>com</strong>mendations of the specified<br />

action for the logged-in user.<br />

Returns the re<strong>com</strong>mendations of the specified<br />

action and object category for the logged-in<br />

user. Also used to delete re<strong>com</strong>mendations.<br />

Returns the re<strong>com</strong>mendations of the specified<br />

action and key prefix for the logged-in user.<br />

171


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Information<br />

Resource<br />

/chatter/users/me/re<strong>com</strong>mendations/action/objectID<br />

/chatter/users/me/settings<br />

/chatter/users/me/status<br />

Description<br />

Returns the re<strong>com</strong>mendation of the specified<br />

action and object ID for the logged-in user.<br />

Also used to delete a re<strong>com</strong>mendation.<br />

Information about the context user’s global<br />

<strong>Chatter</strong> settings.<br />

Returns the most recent user status feed item.<br />

Also used to update or delete user status.<br />

User Information<br />

Returns information about all users in an organization.<br />

Resource<br />

/chatter/users<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

pageSize<br />

q<br />

Type<br />

Integer<br />

Integer<br />

String<br />

Description<br />

An integer specifying a page of items.<br />

The default value is 0, which returns<br />

the first page.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 250.<br />

The default value is 25.<br />

Specifies the string to search. The<br />

search string must contain at least two<br />

characters, not including any wildcards.<br />

For more information about wildcards,<br />

see Using Wildcards.<br />

Note: The query parameter q only searches user names, not email addresses, titles, and so on.<br />

Response body<br />

User Page<br />

172


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Profile Information<br />

User Profile Information<br />

Returns information about the logged-in or specified user's profile.<br />

Resource<br />

or<br />

/chatter/users/me<br />

/chatter/users/userId<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

User Detail<br />

Example response body<br />

{<br />

"aboutMe": "I&#39;m excited to be part of the team focused on building out our apps<br />

business<br />

and showing our customers their future.",<br />

"address": {<br />

"city": "Seattle",<br />

"country": "US",<br />

"formattedAdress": "2001 8th Ave\nSeattle, WA 98121\nUS"<br />

"state": "WA",<br />

"street": "2001 8th Ave",<br />

"zip": "98121"<br />

},<br />

"chatterActivity": {<br />

"<strong>com</strong>mentCount": 0,<br />

"<strong>com</strong>mentReceivedCount": 1,<br />

"likeReceivedCount": 0,<br />

"postCount": 4<br />

},<br />

"chatterInfluence": {<br />

"percentile": "0.5",<br />

"rank": 1<br />

},<br />

"<strong>com</strong>panyName": "Seattle Apps",<br />

"email": "mraven@seattleapps.<strong>com</strong>",<br />

"firstName": "Marion",<br />

"followersCount": 1,<br />

"followingCounts": {<br />

"people": 5,<br />

"records": 2,<br />

"total": 7<br />

},<br />

"groupCount": 3,<br />

"id": "005D0000001Kl6xIAC",<br />

"isActive": true,<br />

"lastName": "Raven", "managerId": "000000000000000AAA",<br />

173


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Batch User Information<br />

"managerName": "",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Marion Raven",<br />

"phoneNumbers": [{<br />

"phoneNumber": "(206) 999-2846",<br />

"type": "Work"<br />

}],<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",<br />

"photoVersionId": "729D00000000BDV",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo"<br />

},<br />

"title": null,<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001Kl6xIAC",<br />

"userType": "Internal",<br />

"username": "mraven@seattleapps.<strong>com</strong>"<br />

Batch User Information<br />

Returns information about the specified users’ profiles.<br />

Resource<br />

/chatter/users/batch/user_list<br />

Where user_list is a <strong>com</strong>ma separated list of user IDs.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Batch Results<br />

User Conversations, General<br />

Returns all private conversations for the logged–in user. Also used to search across all conversations. See also User Conversations,<br />

Specific on page 176. Also see User Messages, General on page 186.<br />

174


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Conversations, General<br />

Resource<br />

/chatter/users/me/conversations<br />

or<br />

/chatter/users/userId/conversations<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Integer<br />

Integer<br />

Description<br />

Specifies the number of the page you<br />

want returned.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Request parameter for GET<br />

Parameter Name<br />

Type<br />

Description<br />

Since Version<br />

q<br />

String<br />

Specifies the string to search. The search<br />

string must contain at least two characters,<br />

not including any wildcards. For more<br />

information about wildcards, see Using<br />

Wildcards. This parameter is optional.<br />

24.0<br />

Note: The query parameter only<br />

searches message text bodies, not<br />

user names, titles, and so on.<br />

Response body<br />

Conversation Summary Collection<br />

175


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Conversations, Specific<br />

User Conversations, Specific<br />

Returns information about the specified private conversation for the logged-in user. Also used to search within a specific<br />

conversation.<br />

Note: You can also use the Conversations resource to change the status of a specified conversation. See Change<br />

Status of Conversations on page 177.<br />

Resource<br />

/chatter/users/me/conversations/conversationId<br />

or<br />

/chatter/users/userId/conversations/conversationId<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, PATCH, or HEAD<br />

Request parameter for GET<br />

Parameter Name<br />

Type<br />

Description<br />

Since Version<br />

q<br />

String<br />

Specifies the string to search. The search<br />

string must contain at least two characters,<br />

not including any wildcards. For more<br />

information about wildcards, see Using<br />

Wildcards. This parameter is optional.<br />

24.0<br />

Note: The query parameter only<br />

searches message text bodies, not<br />

user names, titles, and so on.<br />

Request body for PATCH<br />

Root XML tag<br />

<br />

176


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Change Status of Conversations<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

read<br />

Boolean<br />

Changes the conversation<br />

status to unread (false)<br />

or read (true).<br />

24.0<br />

Request parameters for PATCH<br />

Parameter Name<br />

read<br />

Type<br />

Boolean<br />

Description<br />

Changes the conversation status to<br />

unread (false) or read (true).<br />

Response body for GET or HEAD<br />

Conversation Detail<br />

Change Status of Conversations<br />

Changes the status of the specified conversation. Also see Using POST, PATCH, or PUT for Input. You can also use PATCH<br />

on the conversations resource to change the status of a specified conversation.<br />

Resource<br />

/chatter/users/me/conversations/conversationId/mark-read<br />

Available since version<br />

23.0<br />

HTTP methods<br />

POST or PUT<br />

Request body<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

read<br />

Boolean<br />

Changes the conversation<br />

status to unread (false)<br />

or read (true).<br />

24.0<br />

177


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Get Unread Count for Conversations<br />

Request parameters<br />

Parameter Name<br />

read<br />

Type<br />

Boolean<br />

Description<br />

Changes the conversation status to<br />

unread (false) or read (true).<br />

Get Unread Count for Conversations<br />

Returns the number of conversations that have unread messages for the logged-in or specified user.<br />

Resource<br />

/chatter/users/me/conversations/unread-count<br />

OR<br />

/chatter/users/userId/conversations/unread-count<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request body<br />

Conversation Unread Count<br />

Users Files, General<br />

Post a file or get information about files a user owns. These files don’t include files shared with a user, files a user follows, or<br />

general organization files. When you post a file, it is uploaded to the Files tab as a private file and is available only to the file<br />

owner.<br />

To upload a file, you must send it in a multipart/form-data request. You can include the description and title of the file in the<br />

multipart/form-data request as a JSON or XML request body. You can also send the information as request parameters. For<br />

information about how to create the multipart/form-data message, see Uploading Binary Files.<br />

Important: Be aware that this resource may return a large amount of data and may take a while to process.<br />

Resource<br />

or<br />

/chatter/users/me/files/<br />

/chatter/users/userId/files/<br />

178


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Users Files, General<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET, POST, or HEAD<br />

Request body for POST<br />

Describes a new file input. To upload a file, provide the binary file in a multipart/form-data body part where<br />

name="fileData". See Uploading Binary Files.<br />

Root XML tag<br />

JSON<br />

<br />

{<br />

}<br />

"desc":"Employee Survey Results",<br />

"title":"emp_surv_results"<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

desc<br />

String<br />

Description of the file to be<br />

uploaded<br />

24.0<br />

title<br />

String<br />

Title of the file<br />

24.0<br />

Request parameters for POST<br />

Name<br />

Type<br />

Description<br />

Since version<br />

desc<br />

String<br />

Description of the file<br />

24.0<br />

title<br />

String<br />

Title of the file<br />

24.0<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

page<br />

Integer<br />

An integer specifying a page<br />

of items. The default value<br />

is 0, which returns the first<br />

page.<br />

24.0<br />

pageSize<br />

Integer<br />

Specifies the number of<br />

items per page. Valid values<br />

are between 1 and 100. If<br />

24.0<br />

179


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Users Files, General<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

you don't specify a size, the<br />

default is 25.<br />

q<br />

String<br />

A query string to filter the<br />

results. The string must<br />

contain at least two<br />

characters, not including<br />

wildcards. For information<br />

about wildcards, see Using<br />

Wildcards.<br />

27.0<br />

Response body for GET or HEAD<br />

File Page<br />

Response body for POST<br />

File<br />

Example POST request<br />

The following are the body parts in a multipart/form-data request. For more information, see Uploading Binary Files.<br />

--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq<br />

Content-Type: application/json; charset=UTF-8<br />

Content-Disposition: form-data; name="json"<br />

{<br />

}<br />

"desc":"A new file",<br />

"title":"a_new_file"<br />

--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq<br />

Content-Disposition: form-data; name="fileData"; filename="foo"<br />

Content-Type: application/octet-stream; charset=ISO-8859-1<br />

This is the content of the file.<br />

--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq--<br />

Example POST response<br />

The following is the response from the previous request:<br />

{<br />

"checksum": "2ad78bcc580405c71b68e06b40427873",<br />

"contentSize": 33,<br />

"contentUrl": null,<br />

"description": "A new file",<br />

"downloadUrl":<br />

"/services/data/v27.0/chatter/files/069xx00000000kEAAQ/content?versionNumber=1",<br />

"fileExtension": null,<br />

"fileType": "Unknown",<br />

"flashRenditionStatus": "Na",<br />

"id": "069xx00000000kEAAQ",<br />

"isInMyFileSync": false,<br />

"mimeType": "binary/file",<br />

"modifiedDate": "2013-01-23T23:45:19.000Z",<br />

180


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Files, Filtered by Group<br />

"motif": {<br />

"largeIconUrl": "/img/content/content64.png",<br />

"mediumIconUrl": "/img/content/content32.png",<br />

"smallIconUrl": "/img/icon/files16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "a_new_file",<br />

"origin": "<strong>Chatter</strong>",<br />

"owner": {<br />

"<strong>com</strong>panyName": "signup.org.test.1354045194308",<br />

"firstName": "Darth",<br />

"id": "005xx000001Sv1mAAC",<br />

"isActive": true,<br />

"lastName": "Vader",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Darth Vader",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"http://jhouston-wsl.internal.salesforce.<strong>com</strong>:8080/ncsphoto/I-72lm_uoAFjw7bpEI9CttSWuwXyrmPgy3Fe3TvaCLzsVFYtThNjjkWPeSX-jVyH",<br />

"largePhotoUrl":<br />

"http://jhouston-wsl.internal.salesforce.<strong>com</strong>:8080/profilephoto/729xx0000000048/F",<br />

"photoVersionId": "729xx0000000048AAA",<br />

"smallPhotoUrl":<br />

"http://jhouston-wsl.internal.salesforce.<strong>com</strong>:8080/profilephoto/729xx0000000048/T",<br />

"standardEmailPhotoUrl":<br />

"http://jhouston-wsl.internal.salesforce.<strong>com</strong>:8080/ncsphoto/I-72lm_uoAFjw7bpEI9CttSWuwXyrmPgy3Fe3TvaCLyCckl76S4UWa24STQON4ov",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005xx000001Sv1mAAC/photo"<br />

},<br />

"title": "Chairman/President/CEO",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005xx000001Sv1mAAC",<br />

"userType": "Internal"<br />

},<br />

"pageCount": 0,<br />

"pdfRenditionStatus": "Na",<br />

"renditionUrl": null,<br />

"thumb120By90RenditionStatus": "Na",<br />

"thumb240By180RenditionStatus": "Na",<br />

"thumb720By480RenditionStatus": "Na",<br />

"title": "a_new_file",<br />

"type": "ContentDocument",<br />

"url": "/services/data/v27.0/chatter/files/069xx00000000kEAAQ?versionNumber=1",<br />

"versionNumber": "1"<br />

User Files, Filtered by Group<br />

Returns information about files posted to groups that the specified user is a member of.<br />

Resource<br />

/chatter/users/me/files/filter/groups<br />

181


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Files, Filtered by Sharing<br />

or<br />

/chatter/users/userId/files/filter/groups<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

page<br />

Integer<br />

An integer specifying a page<br />

of items. The default value<br />

is 0, which returns the first<br />

page.<br />

24.0<br />

pageSize<br />

Integer<br />

Specifies the number of<br />

items per page. Valid values<br />

are between 1 and 100. If<br />

you don't specify a size, the<br />

default is 25.<br />

24.0<br />

q<br />

String<br />

A query string to filter the<br />

results. The string must<br />

contain at least two<br />

characters, not including<br />

wildcards. For information<br />

about wildcards, see Using<br />

Wildcards.<br />

27.0<br />

Response body<br />

File Page<br />

User Files, Filtered by Sharing<br />

Returns information about files that have been shared with the specified user.<br />

Resource<br />

/chatter/users/me/files/filter/shared-with-me<br />

OR<br />

/chatter/users/userId/files/filter/shared-with-me<br />

182


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Followers<br />

Note: The resource can also be accessed with the final keyword as one word:<br />

/chatter/users/me | userid/files/filter/sharedwithme<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

Type<br />

Description<br />

Available Since<br />

page<br />

Integer<br />

An integer specifying a page<br />

of items. The default value<br />

is 0, which returns the first<br />

page.<br />

24.0<br />

pageSize<br />

Integer<br />

Specifies the number of<br />

items per page. Valid values<br />

are between 1 and 100. If<br />

you don't specify a size, the<br />

default is 25.<br />

24.0<br />

q<br />

String<br />

A query string to filter the<br />

results. The string must<br />

contain at least two<br />

characters, not including<br />

wildcards. For information<br />

about wildcards, see Using<br />

Wildcards.<br />

27.0<br />

Response body<br />

File Page<br />

User Followers<br />

Returns information about the followers for the specified user.<br />

Resource<br />

or<br />

/chatter/users/me/followers<br />

/chatter/users/userId/followers<br />

183


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Following Users<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Integer<br />

Integer<br />

Description<br />

An integer specifying a page of items.<br />

The default value is 0, which returns<br />

the first page.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 1000.<br />

If you don't specify a size, the default<br />

is 25.<br />

Response body<br />

Follower Page<br />

Following Users<br />

Returns a list of people, groups, records, and files that the specified user is following. Also used to follow records. See Using<br />

POST, PATCH, or PUT for Input.<br />

Note: You can't use the users resource to add a user to a group. Use the groups resource instead.<br />

Resource<br />

or<br />

/chatter/users/me/following<br />

/chatter/users/userId/following<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST, or HEAD<br />

Request body for POST<br />

Root XML tag<br />

<br />

184


<strong>Chatter</strong> <strong>API</strong> Resources<br />

Following Users<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

subjectId<br />

String<br />

The ID of what to follow,<br />

for example, a user ID, a<br />

record ID, a file ID, and so<br />

on.<br />

23.0<br />

Note: Use Group<br />

Member Input for<br />

adding members<br />

to groups.<br />

Request parameter for POST<br />

Parameter Name<br />

subjectId<br />

Type<br />

String<br />

Description<br />

This request enables the user to follow<br />

the specified record. This could be a<br />

user ID, a file ID, and so on.<br />

Request parameters for GET or HEAD<br />

All parameters are optional.<br />

Parameter Name<br />

filterType<br />

page<br />

pageSize<br />

Type<br />

String<br />

Integer<br />

Integer<br />

Description<br />

Specifies the key prefix to filter the type<br />

of objects returned. The key prefix is<br />

the three-character prefix code in the<br />

object ID. Object IDs are prefixed with<br />

three-character codes that specify the<br />

type of the object. For example, User<br />

objects have a prefix of 005 and Group<br />

objects have a prefix of 0F9.<br />

You don’t need to generate the key<br />

prefixes yourself. Use the List of Filters<br />

to see the available key prefixes.<br />

An integer specifying a page of items.<br />

The default value is 0, which returns<br />

the first page.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 1000.<br />

If you don't specify a size, the default<br />

is 25.<br />

185


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Groups<br />

Response body for GET or HEAD<br />

Following Page<br />

Response body for POST<br />

Subscription<br />

User Groups<br />

Returns the groups the specified user is a member of.<br />

Resource<br />

/chatter/users/me/groups<br />

OR<br />

/chatter/users/userId/groups<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Token<br />

Integer<br />

Description<br />

A generated token that indicates the<br />

view of feed items in the feed. Page<br />

tokens are returned as part of the<br />

response body, in one of the URL<br />

parameters, such as nextPageURL.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 250. If<br />

you don’t specify a size, the default is<br />

25.<br />

Response body<br />

User Group Page<br />

User Messages, General<br />

Returns all the messages for all the private conversations for the logged-in user. Also used to search across all messages and<br />

post a message. See Using POST, PATCH, or PUT for Input. See also User Conversations, General on page 174.<br />

Resource<br />

/chatter/users/me/messages<br />

186


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Messages, General<br />

or<br />

/chatter/users/userId/messages<br />

Note: userId must be the same as the logged-in user.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST, or HEAD<br />

Request body for POST<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

body<br />

String<br />

Text of the message body<br />

23.0<br />

inReplyTo<br />

String<br />

ID of an existing message<br />

that identifies which<br />

conversation this message<br />

is part of<br />

23.0<br />

recipients<br />

User Message Recipient<br />

List Input<br />

List of users who are the<br />

intended message<br />

recipients, up to 9.<br />

Comma-separated list of<br />

user IDs.<br />

23.0<br />

Note: Either recipients or inReplyTo is required You must specify one or the other, not both.<br />

Example XML format:<br />

<br />

Text of the message<br />

<br />

userID<br />

userID<br />

<br />

messageID<br />

<br />

187


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Messages, General<br />

Example JSON format:<br />

{<br />

}<br />

"body": "Text of the message",<br />

"recipients": ["userID","userID"],<br />

"inReplyTo": "messageID"<br />

Request parameters for POST<br />

Parameter Name<br />

Type<br />

Required or Optional<br />

Description<br />

inReplyTo<br />

ID messageID<br />

Either recipients or<br />

inReplyTo is required<br />

ID of an existing message<br />

that identifies which<br />

conversation this message is<br />

part of<br />

recipients<br />

ID userID<br />

Either recipients or<br />

inReplyTo is required<br />

List of users who are the<br />

intended message recipients,<br />

up to 9. Comma-separated<br />

list of user IDs.<br />

text<br />

String<br />

Required<br />

The text of the message, up<br />

to 10,000 characters<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

page<br />

pageSize<br />

Type<br />

Integer<br />

Integer<br />

Description<br />

Specifies the number of the page you<br />

want returned.<br />

Specifies the number of items per page.<br />

Valid values are between 1 and 100. If<br />

you don't specify a size, the default is<br />

25.<br />

Request parameter for GET<br />

Parameter Name<br />

Type<br />

Description<br />

Since Version<br />

q<br />

String<br />

Specifies the string to search. The search<br />

string must contain at least two characters,<br />

not including any wildcards. For more<br />

information about wildcards, see Using<br />

Wildcards. This parameter is optional.<br />

24.0<br />

Note: The query parameter only<br />

searches message text bodies, not<br />

user names, titles, and so on.<br />

188


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Messages, General<br />

Response body for GET or HEAD<br />

Message Collection<br />

Response body for POST<br />

Message<br />

Example response body for GET or HEAD<br />

{<br />

"currentPageUrl": "/services/data/v27.0/chatter/users/me/messages",<br />

"messages": [<br />

{<br />

"body": {<br />

"messageSegments": [],<br />

"text": "Will you be able to meet about your Dreamforce presentation this<br />

week?"<br />

},<br />

"conversationId": "03MD000000002LTMAY",<br />

"conversationUrl":<br />

"/services/data/v27.0/chatter/users/me/conversations/03MD000000002LTMAY",<br />

"id": "03JD000000003XGMAY",<br />

"recipients": [<br />

{<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",<br />

"photoVersionId": "729D00000000XA5",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

},<br />

{<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

"<strong>com</strong>panyName": null,<br />

"firstName": "Desmond",<br />

"id": "005D0000001LJvOIAW",<br />

"isActive": true,<br />

"lastName": "Catillo",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

189


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Messages, General<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Desmond Catillo",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",<br />

"photoVersionId": "729D00000000XA5",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LJvOIAW",<br />

"userType": "Internal"<br />

}<br />

],<br />

"sender": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",<br />

"photoVersionId": "729D00000000XA5",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

},<br />

{<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"sentDate": "2012-07-20T21:27:07.000Z",<br />

"url": "/services/data/v27.0/chatter/users/me/messages/03JD000000003XGMAY"<br />

"body": {<br />

"messageSegments": [],<br />

"text": "Rene Holmes has shared Recruitment Poster.png with you on<br />

<strong>Chatter</strong>.\n\nPlease review.\n\nTo view the file, go to:<br />

https://na1-blitz01.soma.salesforce.<strong>com</strong>/069D00000001E32"<br />

190


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Messages, General<br />

},<br />

"conversationId": "03MD000000002LTMAY",<br />

"conversationUrl":<br />

"/services/data/v27.0/chatter/users/me/conversations/03MD000000002LTMAY",<br />

"id": "03JD000000003VAMAY",<br />

"recipients": [<br />

{<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",<br />

"photoVersionId": "729D00000000XA5",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

},<br />

{<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

"<strong>com</strong>panyName": null,<br />

"firstName": "Desmond",<br />

"id": "005D0000001LJvOIAW",<br />

"isActive": true,<br />

"lastName": "Catillo",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Desmond Catillo",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",<br />

"photoVersionId": "729D00000000XA5",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO1IAO/photo"<br />

191


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Messages, Specific<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LJvOIAW",<br />

"userType": "Internal"<br />

}<br />

],<br />

"sender": {<br />

"<strong>com</strong>panyName": "SeattleApps",<br />

"firstName": "Rene",<br />

"id": "005D0000001LFNnIAO",<br />

"isActive": true,<br />

"lastName": "Holmes",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Rene Holmes",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sZVyX4qlsJTXfOWM77RW7yt",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/F",<br />

"photoVersionId": "729D00000000XA5",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000XA5/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cEw-MQI3xmkJ21oNEOQ-5sbktFTIf9vWhFTTALJiaFz_",<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": "Senior Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LFNnIAO",<br />

"userType": "Internal"<br />

},<br />

"sentDate": "2012-07-18T19:01:51.000Z",<br />

"url": "/services/data/v27.0/chatter/users/me/messages/03JD000000003VAMAY"<br />

},<br />

"nextPageUrl": null<br />

User Messages, Specific<br />

Returns the specified message.<br />

Resource<br />

/chatter/users/me/messages/messageId<br />

or<br />

/chatter/users/userId/messages/messageId<br />

Note: userId must be the same as the logged-in user.<br />

192


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Photo<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET or HEAD<br />

Response body<br />

Message<br />

User Photo<br />

Get the URL of a user photo and post a user photo.<br />

To use a file from the Files list, use the request body or request parameters in this entry.<br />

To upload a binary file, you must send it in a multipart/form-data message. For information about how to create the<br />

multipart/form-data message, see Uploading Binary Files.<br />

To display user profile photos in a feed, cache the user photos. Then use the photoVersionId to determine when you need<br />

to update a photo. This technique helps you avoid running over limits and may improve mobile client performance.<br />

Resource<br />

/chatter/users/me/photo<br />

OR<br />

/chatter/users/userId/photo<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, POST or HEAD<br />

Request body for POST<br />

Describes an existing photo input. To upload a new photo, provide the binary file in a multipart/form-data body<br />

part where name="fileUpload". See Uploading Binary Files.<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

fileId<br />

String<br />

18 character Id of an<br />

existing file. The key prefix<br />

must be 069 and the file<br />

size must be less than 2<br />

MB.<br />

25.0<br />

193


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Re<strong>com</strong>mendations, General<br />

Name<br />

versionNumber<br />

Type<br />

Integer<br />

Description<br />

Version number of an<br />

existing file. If not<br />

provided, the latest version<br />

is used.<br />

Available Version<br />

25.0<br />

Request parameters for POST<br />

Parameter Name<br />

Type<br />

Description<br />

Available Version<br />

fileId<br />

String<br />

18 character ID of an<br />

existing file. The key prefix<br />

must be 069 and the file size<br />

must be less than 2 MB.<br />

25.0<br />

versionNumber<br />

Integer<br />

Version number of the<br />

existing content. If not<br />

provided, the latest version<br />

is used.<br />

25.0<br />

Note: Photos are processed asynchronously and may not be visible right away.<br />

Response body for GET or HEAD<br />

Photo<br />

Response body for POST<br />

Photo<br />

User Re<strong>com</strong>mendations, General<br />

Returns the user, group, file, and record re<strong>com</strong>mendations for the logged-in user.<br />

Resource<br />

/chatter/users/me/re<strong>com</strong>mendations<br />

OR<br />

/chatter/users/userId/re<strong>com</strong>mendations<br />

Note: userId must be the same as the logged-in user.<br />

194


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Re<strong>com</strong>mendations, General<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

maxResults<br />

Type<br />

Integer<br />

Description<br />

Maximum number of re<strong>com</strong>mendation<br />

results; default is 10. Value must be<br />

greater than 0.<br />

Response body<br />

Zero or more Re<strong>com</strong>mendation responses<br />

Example response body for GET with no request parameters<br />

{"re<strong>com</strong>mendations": [<br />

{<br />

"actOnUrl":<br />

"/services/data/v27.0/chatter/users/005D0000001LL8OIAW/following?subjectId=00QD000000GWGuXMAX",<br />

},<br />

{<br />

"action": "follow",<br />

"explanation": {<br />

"detailsUrl": null,<br />

"summary": "Owned by you",<br />

"type": "RecordOwned"<br />

},<br />

"object": {<br />

"id": "00QD000000GWGuXMAX",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/leads64.png",<br />

"mediumIconUrl": "/img/icon/leads32.png",<br />

"smallIconUrl": "/img/icon/leads16.png"<br />

},<br />

"mySubscription": null,<br />

"name": "Pamela Owenby, Hendrickson Trading",<br />

"type": "Lead",<br />

"url": "/services/data/v27.0/chatter/records/00QD000000GWGuXMAX"<br />

}<br />

"actOnUrl":<br />

"/services/data/v27.0/chatter/groups/0F9D00000000I4TKAU/members?userId=005D0000001LL8OIAW",<br />

"action": "join",<br />

"explanation": {<br />

"detailsUrl":<br />

"/services/data/v27.0/chatter/users/me/re<strong>com</strong>mendations/join/0F9D00000000I4TKAU/explanation/GroupMembersFollowed",<br />

"summary": "Has members you follow",<br />

"type": "GroupMembersFollowed"<br />

},<br />

"object": {<br />

"canHave<strong>Chatter</strong>Guests": false,<br />

"<strong>com</strong>munity": null,<br />

"description": "Get help from colleagues to close deals faster",<br />

195


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Re<strong>com</strong>mendations, General<br />

"fileCount": 0,<br />

"id": "0F9D00000000I4TKAU",<br />

"lastFeedItemPostDate": "2012-09-12T01:03:08.000Z",<br />

"memberCount": 2,<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

"myRole": "NotAMember",<br />

"mySubscription": null,<br />

"name": "Sales",<br />

"owner": {<br />

"<strong>com</strong>panyName": "Universal Containers",<br />

"firstName": "Renee",<br />

"id": "005D0000001LLO6IAO",<br />

"isActive": true,<br />

"lastName": "Moreau",<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

"mySubscription": {<br />

"id": "0E8D0000000T5ZZKA0",<br />

"url": "/services/data/v27.0/chatter/subscriptions/0E8D0000000T5ZZKA0"<br />

},<br />

"name": "Renee Moreau",<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1i9x6Z16L8wXEGigpcWjAd",<br />

"largePhotoUrl":<br />

"https://c.na1-blitz02.content.soma.force.<strong>com</strong>/profilephoto/729D00000000LJQ/F",<br />

"photoVersionId": "729D00000000LJQIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJQ/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/SqRfG_-PUTY6KtfOp_f0cGW2pGjfqoWUUgTENHjVyS1q43x_rW2ciXBHst0Eh3Y6",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"title": "Sales Manager",<br />

"type": "User",<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO",<br />

"userType": "Internal"<br />

},<br />

"photo": {<br />

"fullEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyWvj8Hy5cv5voDy7d7Kam0yU5fZl49rmMAeVigTKI9v",<br />

"largePhotoUrl": "https://instance_name/profilephoto/729D00000000LJU/F",<br />

"photoVersionId": "729D00000000LJUIA2",<br />

"smallPhotoUrl": "https://instance_name/profilephoto/729D00000000LJU/T",<br />

"standardEmailPhotoUrl":<br />

"https://instance_name/ncsphoto/0_6z_M1zlQXy0iICaZWfdyWvj8Hy5cv5voDy7d7Kam12q55tdEhTcGehjW_lHrWP",<br />

]}<br />

}<br />

}<br />

"url": "/services/data/v27.0/chatter/users/005D0000001LLO6IAO/photo"<br />

},<br />

"type": "CollaborationGroup",<br />

"url": "/services/data/v27.0/chatter/groups/0F9D00000000I4TKAU",<br />

"visibility": "PublicAccess"<br />

196


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Re<strong>com</strong>mendations for a Specific Action<br />

User Re<strong>com</strong>mendations for a Specific Action<br />

Returns the re<strong>com</strong>mendations of the specified action for the logged-in user.<br />

Resource<br />

or<br />

/chatter/users/me/re<strong>com</strong>mendations/action<br />

/chatter/users/userId/re<strong>com</strong>mendations/action<br />

Note: userId must be the same as the logged-in user.<br />

Valid values for action and resulting re<strong>com</strong>mendations:<br />

• follow returns re<strong>com</strong>mendations to follow users, files, and records.<br />

• join returns re<strong>com</strong>mendations to join groups.<br />

• view returns re<strong>com</strong>mendations to view users, files, groups, and records. Available in versions 25.0 and later.<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET or HEAD<br />

Request parameters<br />

Parameter Name<br />

maxResults<br />

Type<br />

Integer<br />

Description<br />

Maximum number of re<strong>com</strong>mendation<br />

results; default is 10. Value must be<br />

greater than 0.<br />

Response body<br />

Zero or more Re<strong>com</strong>mendation responses<br />

User Re<strong>com</strong>mendations for a Specific Action and Object Category<br />

Returns the re<strong>com</strong>mendations of the specified action and object category for the logged-in user. Also used to delete<br />

re<strong>com</strong>mendations.<br />

Resource<br />

/chatter/users/me/re<strong>com</strong>mendations/action/objectCategory<br />

197


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Re<strong>com</strong>mendations for a Specific Action and Object<br />

Category<br />

or<br />

/chatter/users/userId/re<strong>com</strong>mendations/action/objectCategory<br />

Note: userId must be the same as the logged-in user.<br />

• Valid values for action:<br />

◊<br />

◊<br />

◊<br />

follow<br />

join<br />

view (Available in versions 25.0 and later.)<br />

• Valid values for object category:<br />

◊<br />

◊<br />

◊<br />

If action is follow, object category is users, files, or records.<br />

If action is join, object category is groups.<br />

If action is view, object category is users, files, groups, or records.<br />

Available since version<br />

23.0<br />

HTTP methods<br />

GET, DELETE, or HEAD<br />

DELETE is available as of version 24.0. DELETE is used to remove a re<strong>com</strong>mendation and is only valid for the<br />

following resources:<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/follow/re<strong>com</strong>mendedUserId<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/follow/re<strong>com</strong>mendedFileId<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/follow/re<strong>com</strong>mendedRecordId<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/join/re<strong>com</strong>mendedGroupId<br />

Note: userId must be the same as the logged-in user.<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

Type<br />

Description<br />

Since Version<br />

maxResults<br />

Integer<br />

Maximum number of re<strong>com</strong>mendation<br />

results; default is 10. Value must be<br />

greater than 0.<br />

23.0<br />

followed<br />

String<br />

ID of a user. Provides new<br />

re<strong>com</strong>mendations based on the context<br />

of this user ID.<br />

24.0<br />

viewed<br />

String<br />

ID of a file. Provides new<br />

re<strong>com</strong>mendations based on the context<br />

of this file ID.<br />

25.0<br />

198


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Re<strong>com</strong>mendations for a Specific Action and Key Prefix<br />

Example request URL with followed request parameter<br />

/chatter/users/me/re<strong>com</strong>mendations/follow/users?followed=005D0000001GLowIAB<br />

Response body for GET with followed request parameter<br />

Zero or one user Re<strong>com</strong>mendation response<br />

Response body for GET or HEAD without request parameters<br />

Zero or more Re<strong>com</strong>mendation responses<br />

Response body for DELETE<br />

204: Successful Delete<br />

User Re<strong>com</strong>mendations for a Specific Action and Key Prefix<br />

Returns the re<strong>com</strong>mendations of the specified action and key prefix for the logged-in user. The key prefix is the three-character<br />

prefix code in the object ID. Object IDs are prefixed with three-character codes that specify the type of the object. For example,<br />

User objects have a prefix of 005 and Group objects have a prefix of 0F9.<br />

Resource<br />

/chatter/users/me/re<strong>com</strong>mendations/action/idPrefix<br />

or<br />

/chatter/users/userId/re<strong>com</strong>mendations/action/idPrefix<br />

Note: userId must be the same as the logged-in user.<br />

• Valid values for action:<br />

◊<br />

◊<br />

◊<br />

follow<br />

join<br />

view<br />

• Valid values for idPrefix:<br />

◊ If action is follow, idPrefix is the key prefix for users (005), files (069), or records (such as 001 or 003).<br />

◊ If action is join, idPrefix is the key prefix for groups (0F9).<br />

◊ If action is view, idPrefix is the key prefix for users (005), files (069), groups (0F9), or records (such as 001<br />

or 003).<br />

Available since version<br />

26.0<br />

HTTP methods<br />

GET or HEAD<br />

199


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Re<strong>com</strong>mendations for a Specific Action and Object ID<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

maxResults<br />

followed<br />

viewed<br />

Type<br />

Integer<br />

String<br />

String<br />

Description<br />

Maximum number of re<strong>com</strong>mendation<br />

results; default is 10. Value must be<br />

greater than 0.<br />

ID of a user. Provides new<br />

re<strong>com</strong>mendations based on the context<br />

of this user ID.<br />

ID of a file. Provides new<br />

re<strong>com</strong>mendations based on the context<br />

of this file ID.<br />

Example request URL<br />

/chatter/users/me/re<strong>com</strong>mendations/view/001<br />

Response body for GET or HEAD without request parameters<br />

Zero or more account Re<strong>com</strong>mendation responses<br />

User Re<strong>com</strong>mendations for a Specific Action and Object ID<br />

Returns the re<strong>com</strong>mendation of the specified action and object ID for the logged-in user. Also used to delete a re<strong>com</strong>mendation.<br />

Resource<br />

/chatter/users/me/re<strong>com</strong>mendations/action/objectID<br />

or<br />

/chatter/users/userId/re<strong>com</strong>mendations/action/objectID<br />

Note: userId must be the same as the logged-in user.<br />

• Valid values for action:<br />

◊<br />

◊<br />

◊<br />

follow<br />

join<br />

view (Available in versions 25.0 and later.)<br />

• Valid values for object ID:<br />

◊<br />

◊<br />

◊<br />

If action is follow, object ID is a user ID, file ID, or record ID.<br />

If action is join, object ID is a group ID.<br />

If action is view, object ID is a user ID, file ID, group ID, or record ID.<br />

200


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Settings<br />

Available since version<br />

24.0<br />

HTTP methods<br />

GET, DELETE, or HEAD<br />

DELETE is used to remove a re<strong>com</strong>mendation and is only valid for the following resources:<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/follow/re<strong>com</strong>mendedUserId<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/follow/re<strong>com</strong>mendedFileId<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/follow/re<strong>com</strong>mendedRecordId<br />

• /chatter/users/me | userId/re<strong>com</strong>mendations/join/re<strong>com</strong>mendedGroupId<br />

Note: userId must be the same as the logged-in user.<br />

Request parameters for GET or HEAD<br />

Parameter Name<br />

maxResults<br />

followed<br />

Type<br />

Integer<br />

String<br />

Description<br />

Maximum number of re<strong>com</strong>mendation<br />

results; default is 10. Value must be<br />

greater than 0.<br />

ID of a user. Provides new<br />

re<strong>com</strong>mendations based on the context<br />

of this user ID.<br />

Response body for GET or HEAD without request parameters<br />

Zero or one Re<strong>com</strong>mendation response<br />

Response body for DELETE<br />

204: Successful Delete<br />

User Settings<br />

Information about the context user’s global <strong>Chatter</strong> settings.<br />

Resource<br />

or<br />

/chatter/users/me/settings<br />

/chatter/users/userId/settings<br />

Note: The userId must be the same as the logged-in user.<br />

201


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Settings<br />

Available since version<br />

27.0<br />

HTTP methods<br />

GET, HEAD, or PATCH<br />

Request body for PATCH<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

defaultGroupEmailFrequency<br />

Type<br />

String<br />

Description<br />

The default frequency with which a user<br />

receives email from a group when they<br />

join. Valid values are:<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

• Never<br />

Available<br />

Version<br />

27.0<br />

Request parameter for PATCH<br />

Parameter Name<br />

defaultGroupEmailFrequency<br />

Type<br />

String<br />

Description<br />

The default frequency with 27.0<br />

which a user receives email<br />

from a group when they join.<br />

This setting does not affect<br />

groups a user is already a<br />

member of. Valid values are:<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

• Never<br />

Available Since<br />

Response body for GET, HEAD, or PATCH<br />

User <strong>Chatter</strong> Settings<br />

Response body example for GET<br />

{"defaultGroupEmailFrequency": "Never"}<br />

202


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Status<br />

User Status<br />

Note: This resource is no longer available as of version 25.0. Instead, use any feed resource, with the feed-item, such<br />

as /chatter/feeds/news/me/feed-items.<br />

Returns the most recent user status feed item. Also used to update or delete user status. See Using POST, PATCH, or PUT<br />

for Input.<br />

Resource<br />

or<br />

/chatter/users/me/status<br />

/chatter/users/userId/status<br />

Available in versions<br />

23.0–24.0<br />

HTTP methods<br />

GET, DELETE, POST or HEAD<br />

Request body for POST<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

body<br />

Message Body Input<br />

Description of message<br />

body<br />

23.0–24.0<br />

Request parameter for POST<br />

Name<br />

text<br />

Type<br />

String Text to post<br />

Description<br />

Text of the item to be posted to the<br />

user's status<br />

Response body for GET or POST<br />

User Status<br />

203


<strong>Chatter</strong> <strong>API</strong> Resources<br />

User Status<br />

Example response body<br />

<br />

<br />

<br />

<br />

<br />

Will send you latest updates tonight<br />

Text<br />

<br />

<br />

Will send you latest updates tonight<br />

<br />

005D0000001GLbn<br />

/services/data/v27.0/chatter/users/005D0000001GLbn/status<br />

<br />

204


Chapter 5<br />

<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

To perform a POST, PATCH, or PUT request, pass query parameters or create a request body formatted in either XML or<br />

JSON.<br />

The following are the top-level request bodies, and can contain one or more other request bodies nested inside:<br />

• Attachment Input: Feed Poll<br />

• Comment<br />

• Dashboard Component Snapshot<br />

• Feed Favorite<br />

• Feed Item<br />

• Feed Poll<br />

• File Input<br />

• Following<br />

• Group <strong>Chatter</strong> Settings<br />

• Group Member<br />

• Group Membership Request Update<br />

• Photo<br />

• User <strong>Chatter</strong> Settings<br />

• User Message<br />

• User Message Recipient<br />

• User Message Recipient List<br />

• User Status<br />

• User Stream (Conversation)<br />

All request bodies have properties. If a request body is top-level, it has a root XML tag listed. To create an XML request body,<br />

nest the properties as XML tags inside the root XML tag.<br />

The following is an example of a <strong>com</strong>ment XML request body:<br />

<br />

Let's look for a new solution.<br />

<br />

To create a JSON request body, use the properties in JSON format. You don’t need to use the root XML tag.<br />

The following is the same <strong>com</strong>ment example used above, in JSON format:<br />

{<br />

"body" : "Let's look for a new solution."<br />

}<br />

205


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Attachment Input: Existing Content<br />

XML<br />

In XML request bodies, attachmentType is an attribute of the element.<br />

<br />

069...<br />

<br />

JSON<br />

{ "attachment":<br />

{<br />

"attachmentType":"ExistingContent",<br />

"contentDocumentId": "069D00000001FHF"<br />

}<br />

}<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value<br />

ExistingContent.<br />

27.0<br />

contentDocumentId<br />

String<br />

ID of the existing content<br />

23.0<br />

Attachment Input: Feed Poll<br />

XML<br />

Note that in XML, the choices for the poll are each wrapped in a element and attachmentType is an attribute<br />

of the element. For example:<br />

<br />

<br />

One<br />

Two<br />

<br />

<br />

JSON<br />

{ "attachment":<br />

{<br />

"attachmentType":"Poll",<br />

"pollChoices": [<br />

"Monday",<br />

"Tuesday"<br />

]<br />

}<br />

}<br />

206


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Poll.<br />

27.0<br />

pollChoices<br />

String []<br />

A list of choices used in the<br />

feed poll.<br />

26.0<br />

Attachment Input: Link<br />

XML<br />

The attachmentType property is an attribute of the element. For example:<br />

<br />

http://www.google.<strong>com</strong><br />

A search engine<br />

<br />

JSON<br />

{ "attachment":<br />

{<br />

"attachmentType":"Link",<br />

"url": "http://www.salesforce.<strong>com</strong>",<br />

"urlName": "<strong>Salesforce</strong>"<br />

}<br />

}<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

attachmentType<br />

String<br />

The attachment type. Must<br />

contain the value Link.<br />

27.0<br />

url<br />

String<br />

URL included in the<br />

attachment<br />

23.0<br />

urlName<br />

String<br />

Optional. Name of the URL.<br />

If not provided, a name is<br />

generated from the domain<br />

name of the URL<br />

23.0<br />

Attachment Input: New File Upload<br />

To upload a new file, provide the binary file in a multipart/form-data body part where name="feedItemFileUpload".<br />

See Uploading Binary Files.<br />

207


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

XML<br />

The attachmentType property is an attribute of the element. For example:<br />

<br />

TPS Report (with cover)<br />

TPS.txt<br />

<br />

JSON<br />

{ "attachment":<br />

{<br />

"attachmentType":"NewFile",<br />

"description":"TPS Report (with cover)",<br />

"title":"TPS.txt"<br />

}<br />

}<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

attachmentType<br />

String<br />

The attachment type. Must contain the<br />

value NewFile.<br />

27.0<br />

desc<br />

String<br />

Description of the file<br />

23.0–26.0<br />

Attention: This parameter<br />

should not be used as of version<br />

27.0. Use description<br />

instead.<br />

description<br />

String<br />

Optional. Description of the file.<br />

27.0<br />

title<br />

String<br />

Title of the file<br />

24.0<br />

Comment Input<br />

Root XML tag<br />

<br />

JSON<br />

The following example attaches an existing file to a <strong>com</strong>ment:<br />

{<br />

"attachment": {<br />

"attachmentType":"ExistingContent",<br />

"contentDocumentId":"069D00000001FHF"<br />

},<br />

"body" : {<br />

"messageSegments" : [<br />

{<br />

"text" : "FY14 Sales Projections",<br />

208


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

}<br />

}<br />

]<br />

}<br />

"type" : "Text"<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available<br />

Version<br />

attachment<br />

Depends on type.<br />

Optional. Values are:<br />

• Attachment Input: Existing Content<br />

• Attachment Input: New File Upload<br />

24.0<br />

Note: To upload a new file, you<br />

must include it in a<br />

multipart/form–data message.<br />

See Uploading Binary Files.<br />

body<br />

Message Body Input<br />

Description of message body<br />

23.0<br />

Dashboard Component Snapshot Input<br />

Root XML tag<br />

<br />

JSON<br />

{<br />

}<br />

"parentId" : "0F9D00000000I4O",<br />

"feedItemBody" : {<br />

"messageSegments" : [<br />

{<br />

"text" : "Sales Heat",<br />

"type" : "Text"<br />

}<br />

]<br />

}<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

parentId<br />

String<br />

A user, group, or dashboard Id to<br />

which you are posting the<br />

snapshot.<br />

25.0<br />

filterId1<br />

String<br />

Optional. A dashboard filter item<br />

Id.<br />

25.0<br />

209


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Name<br />

filterId2<br />

filterId3<br />

feedItemBody<br />

runningUserId<br />

Type<br />

String<br />

String<br />

Message Body<br />

Input<br />

String<br />

Description<br />

Optional. A second dashboard<br />

filter item Id.<br />

Optional. A third dashboard filter<br />

item Id.<br />

Contains the text that ac<strong>com</strong>panies<br />

the feed item associated with the<br />

dashboard <strong>com</strong>ponent snapshot.<br />

Optional. A user Id from which<br />

the view of the dashboard will be<br />

created, if other than the creator.<br />

Available Version<br />

25.0<br />

25.0<br />

25.0<br />

25.0<br />

Feed Favorite Input<br />

Root XML tag<br />

<br />

JSON<br />

{<br />

}<br />

"searchText" : "release"<br />

Properties for POST<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

searchText<br />

String<br />

Text of the feed search. This<br />

parameter can only be used<br />

with saved searches and not<br />

list views.<br />

24.0<br />

Properties for PATCH<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

updateLastViewDate<br />

Boolean<br />

Sets the last view date of the<br />

specified feed favorite to the<br />

current system time. Default<br />

value is false.<br />

24.0<br />

210


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Feed Item Input<br />

Root XML tag<br />

JSON<br />

<br />

The following example attaches a poll to a feed item:<br />

{ "attachment":<br />

{<br />

"attachmentType":"Poll",<br />

"pollChoices": [<br />

"Monday",<br />

"Tuesday"<br />

]<br />

},<br />

"body" : {<br />

"messageSegments" : [<br />

{<br />

"type" : "Text",<br />

"text" : "When should we meet for release planning?"<br />

}<br />

]<br />

}<br />

}<br />

Properties<br />

Name<br />

attachment<br />

Type<br />

Depends on type<br />

Description<br />

Optional. You can specify only one of these<br />

values in the attachment parameter. Values<br />

are:<br />

• Attachment Input: Existing Content<br />

(v23.0)<br />

• Attachment Input: Feed Poll (v26.0)<br />

• Attachment Input: Link (v23.0)<br />

• Attachment Input: New File Upload<br />

(v23.0)<br />

Note: To upload a new file,<br />

you must include it in a<br />

multipart/form–data message.<br />

See Uploading Binary Files.<br />

Available<br />

Version<br />

body<br />

isBookmarkedByCurrentUser<br />

Message Body Input<br />

Boolean<br />

Description of message body<br />

Optional. Specifies if the new feed item<br />

should be bookmarked for the user (true)<br />

or not (false). Default value is false.<br />

23.0<br />

24.0<br />

211


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Name<br />

originalFeedItemId<br />

Type<br />

String<br />

Description<br />

Optional. If this feed item is shared, this is<br />

the original feed item 18-character Id<br />

Note: This parameter takes<br />

precedence over all other<br />

parameters. For example, if you<br />

share a post and also try to upload<br />

a file, the generated feed-item only<br />

contains the shared post. You<br />

should only share a post or upload<br />

a file, not both in the same post.<br />

Available<br />

Version<br />

24.0<br />

visibility<br />

String<br />

Optional. Who can see the post. Valid<br />

values are:<br />

• InternalUsers<br />

• AllUsers<br />

26.0<br />

Note: Portal users in <strong>com</strong>munities<br />

still won’t see posts with<br />

AllUsers specified.<br />

Also see Record Feed Items for more<br />

information about visibility<br />

Feed Poll Input<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

myChoiceId<br />

Type<br />

String<br />

Description<br />

Id of an existing choice on 26.0<br />

the feed poll. Used to specify<br />

the Id of the poll choice that<br />

the current user is voting on.<br />

Available Version<br />

File Input<br />

Describes a new file input. To upload a file, provide the binary file in a multipart/form-data body part where<br />

name="fileData". See Uploading Binary Files.<br />

Root XML tag<br />

<br />

212


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

JSON<br />

{<br />

}<br />

"desc":"Employee Survey Results",<br />

"title":"emp_surv_results"<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

desc<br />

String<br />

Description of the file to be<br />

uploaded<br />

24.0<br />

title<br />

String<br />

Title of the file<br />

24.0<br />

Following Input<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

subjectId<br />

String<br />

The ID of what to follow, for<br />

example, a user ID, a record<br />

ID, a file ID, and so on.<br />

23.0<br />

Note: Use Group<br />

Member Input for<br />

adding members to<br />

groups.<br />

Group <strong>Chatter</strong> Settings Input<br />

Root XML tag<br />

<br />

Properties<br />

A user’s <strong>Chatter</strong> settings.<br />

213


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Name<br />

Type<br />

Description<br />

Available<br />

Version<br />

emailFrequency<br />

String<br />

The frequency with which a group<br />

member receives email from a group.<br />

Valid values are:<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

• Never<br />

27.0<br />

Group Member Input<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

userId<br />

String<br />

The user ID of the member<br />

to be added to the group<br />

23.0<br />

Group Membership Request Update<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

responseMessage<br />

String<br />

Use this property to provide a message to the<br />

user if their membership request is declined.<br />

The value of this property is used only when<br />

the value of the status property is<br />

Declined.<br />

27.0<br />

The maximum length is 756 characters.<br />

status<br />

String<br />

Valid values:<br />

• Accepted<br />

• Declined<br />

27.0<br />

214


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Message Body Input<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

messageSegments<br />

Segments[]<br />

Collection of message<br />

segments, based on type.<br />

Segments can be one of the<br />

following:<br />

• Message Segment Input:<br />

Hash Tag<br />

• Message Segment Input:<br />

Link<br />

• Message Segment Input:<br />

Mention<br />

• Message Segment Input:<br />

Text<br />

23.0<br />

Message Segment Input: Hash Tag<br />

Represents an inline hash tag. If a hash tag is provided as input without whitespace text before it, a space is inserted. If a hash<br />

tag is provided as input without whitespace text after it, a space is inserted.<br />

The use of this segment is optional because hash tags are also parsed out of Text segments.<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

tag<br />

String<br />

Text of the hash tag without<br />

the hash tag<br />

23.0<br />

type<br />

String<br />

Value is Hashtag<br />

23.0<br />

Message Segment Input: Link<br />

Represents an inline link to a URL. If a link is provided as input without whitespace text before it, a space is inserted. If a link<br />

is provided as input without whitespace text after it, a space is inserted.<br />

The use of this segment is optional because links are also parsed out of Text segments.<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

type<br />

String<br />

Value is Link<br />

23.0<br />

url<br />

URL<br />

URL to be used for the link<br />

23.0<br />

Message Segment Input: Mention<br />

Represents an inline mention of a user. You must provide a user ID. No spaces are added.<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

id<br />

String<br />

ID of the user to be mentioned<br />

23.0<br />

type<br />

String<br />

Value is Mention<br />

23.0<br />

215


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

Message Segment Input: Text<br />

Represents plain inline text. Text prefixed with a # and surrounded by space is converted into a hash tag segment. Text that<br />

looks like a link and is surrounded by space is converted into a link segment.<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

text<br />

String<br />

Plain text for this segment<br />

23.0<br />

type<br />

String<br />

Only value is Text<br />

23.0<br />

Photo Input<br />

Describes an existing photo input. To upload a new photo, provide the binary file in a multipart/form-data body part<br />

where name="fileUpload". See Uploading Binary Files.<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

fileId<br />

String<br />

18 character Id of an existing<br />

file. The key prefix must be<br />

069 and the file size must be<br />

less than 2 MB.<br />

25.0<br />

versionNumber<br />

Integer<br />

Version number of an<br />

existing file. If not provided,<br />

the latest version is used.<br />

25.0<br />

User <strong>Chatter</strong> Settings Input<br />

A user’s global <strong>Chatter</strong> settings.<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

defaultGroupEmailFrequency<br />

Type<br />

String<br />

Description<br />

The default frequency with which a user<br />

receives email from a group when they join.<br />

Valid values are:<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

• Never<br />

Available<br />

Version<br />

27.0<br />

216


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

User Message<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

body<br />

inReplyTo<br />

recipients<br />

Type<br />

String<br />

String<br />

User Message Recipient List<br />

Input<br />

Description<br />

Text of the message body<br />

ID of an existing message<br />

that identifies which<br />

conversation this message is<br />

part of<br />

List of users who are the<br />

intended message recipients,<br />

up to 9. Comma-separated<br />

list of user IDs.<br />

Available Version<br />

23.0<br />

23.0<br />

23.0<br />

Note: Either recipients or inReplyTo is required You must specify one or the other, not both.<br />

Example XML format:<br />

<br />

Text of the message<br />

<br />

userID<br />

userID<br />

<br />

messageID<br />

<br />

Example JSON format:<br />

{<br />

}<br />

"body": "Text of the message",<br />

"recipients": ["userID","userID"],<br />

"inReplyTo": "messageID"<br />

User Message Recipient Input<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

recipient<br />

String<br />

18-character Id of the user<br />

to receive the message<br />

23.0<br />

217


<strong>Chatter</strong> <strong>API</strong> Request Bodies<br />

User Message Recipient List Input<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

recipients<br />

User Message Recipient<br />

Input[]<br />

Collection of recipients to<br />

receive the message<br />

23.0<br />

User Status Input<br />

Note: Setting a user status is no longer available as of version 25.0. Post feed items to the feed instead, using Feed<br />

Item Input.<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

body<br />

Message Body Input<br />

Description of message body<br />

23.0–24.0<br />

User Stream (Conversation) Input<br />

Root XML tag<br />

<br />

Properties<br />

Name<br />

Type<br />

Description<br />

Available Version<br />

read<br />

Boolean<br />

Changes the conversation<br />

status to unread (false) or<br />

read (true).<br />

24.0<br />

218


Chapter 6<br />

<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

The <strong>Chatter</strong> <strong>API</strong> resources return an HTTP response code. They can also return a response body, in either JSON or XML.<br />

Response Bodies<br />

The following are the response bodies returned by successful execution of a resource request.<br />

Address<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

city<br />

String<br />

Name of the city<br />

23.0<br />

country<br />

String<br />

Name of the country<br />

23.0<br />

formattedAddress<br />

String<br />

Address formatted by locale.<br />

25.0<br />

state<br />

String<br />

Name of the state, province, or so on<br />

23.0<br />

street<br />

String<br />

Street number<br />

23.0<br />

zip<br />

String<br />

Zip or postal code<br />

23.0<br />

Batch Results<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

results<br />

Batch Result Item[]<br />

Collection of batch result items<br />

23.0<br />

Batch Result Item<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

result<br />

Various<br />

Dependent on the type of batch. Value<br />

could be one of the following:<br />

• Error Message (v23.0)<br />

• File for<br />

/chatter/files/batch/<br />

fileIds<br />

219


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

(v26.0)<br />

• Group Member for<br />

/chatter/group-memberships/batch/<br />

membershipIds<br />

(v27.0)<br />

• Group for<br />

/chatter/groups/batch/<br />

groupIds<br />

(v23.0)<br />

• Motif for<br />

/connect/motifs/batch/<br />

idOrPrefixList<br />

v27.0<br />

• User Summary for<br />

/chatter/users/batch/<br />

userIds<br />

(v23.0)<br />

statusCode<br />

Integer<br />

An HTTP status code indicating the status<br />

of this individual request in the batch.<br />

23.0<br />

<strong>Chatter</strong> Activity<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

<strong>com</strong>mentCount<br />

Integer<br />

Total number of <strong>com</strong>ments in the<br />

organization made by the user<br />

23.0<br />

<strong>com</strong>mentReceivedCount<br />

Integer<br />

Total number of <strong>com</strong>ments in the<br />

organization received by the user<br />

23.0<br />

likeReceivedCount<br />

Integer<br />

Total number of likes on posts and<br />

<strong>com</strong>ments in the organization received by<br />

the user<br />

23.0<br />

postCount<br />

Integer<br />

Total number of posts in the organization<br />

made by the user<br />

23.0<br />

220


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

<strong>Chatter</strong> Directory<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

feeds<br />

String<br />

Returns a URL to the general feeds<br />

resource for the organization<br />

24.0<br />

groups<br />

String<br />

Returns a URL to the general groups<br />

resource for the organization<br />

24.0<br />

organization<br />

String<br />

Note: This property is no longer<br />

available as of version 26.0. Use<br />

the organization property in<br />

the Connect Directory instead.<br />

24.0–26.0<br />

Returns a URL to the general connect<br />

organization resource<br />

users<br />

String<br />

Returns a URL to the general users<br />

resource for the organization<br />

24.0<br />

<strong>Chatter</strong> Influence<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

percentile<br />

String<br />

Percentile value for the user’s influence rank<br />

within the organization<br />

24.0<br />

rank<br />

Integer<br />

Number indicating the user’s influence rank,<br />

relative to all other users within the<br />

organization<br />

24.0<br />

ClientInfo<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

applicationName<br />

String<br />

Name of the Connected App used for<br />

authentication. For more information, see<br />

Understanding Connected Apps.<br />

23.0<br />

applicationUrl<br />

String<br />

Value from the Info URL field of the<br />

Connected App used for authentication<br />

23.0<br />

Comment<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

attachment<br />

Depends on type of <strong>com</strong>ment<br />

If the <strong>com</strong>ment does not contain an<br />

attachment or if the attachment, returns<br />

null. Otherwise, returns Feed Item<br />

Attachment: Content.<br />

24.0<br />

body<br />

Feed Body<br />

Message body <strong>com</strong>ment<br />

23.0<br />

221


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

clientInfo<br />

ClientInfo<br />

Information about the Connected App used<br />

to authenticate the connection<br />

23.0<br />

createdDate<br />

String<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

23.0<br />

feedItem<br />

Reference<br />

Information about the feed item for the<br />

<strong>com</strong>ment<br />

23.0<br />

id<br />

String<br />

18-character Id of the <strong>com</strong>ment<br />

23.0<br />

isDeletable<br />

Boolean<br />

Note: This property is no longer<br />

available as of version 25.0. Use the<br />

isDeleteRestricted property<br />

instead.<br />

23.0–24.0<br />

Specifies if the context user can delete the<br />

<strong>com</strong>ment<br />

isDeleteRestricted<br />

likes<br />

likesMessage<br />

myLike<br />

parent<br />

type<br />

Boolean<br />

Like Page<br />

Like Message Body<br />

Reference<br />

Parent<br />

String<br />

Returns true if a <strong>com</strong>ment cannot be deleted<br />

by the logged in user. If it returns false,<br />

possibly the logged in users can delete the<br />

<strong>com</strong>ment.<br />

Page of likes associated with the <strong>com</strong>ment<br />

A message body that describes who likes the<br />

<strong>com</strong>ment.<br />

If the logged-in user has liked the <strong>com</strong>ment,<br />

returns a reference to that like or returns null<br />

Information about the parent of the feed-item<br />

associated with this <strong>com</strong>ment<br />

Indicates the type of <strong>com</strong>ment. Valid values<br />

are:<br />

• ContentComment—the <strong>com</strong>ment<br />

contains an attachment<br />

• TextComment—the <strong>com</strong>ment contains<br />

only text<br />

25.0<br />

24.0<br />

27.0<br />

23.0<br />

23.0<br />

24.0<br />

url<br />

String<br />

URL to this <strong>com</strong>ment<br />

23.0<br />

user<br />

User Summary<br />

Information about the <strong>com</strong>ment author<br />

23.0<br />

Comment Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

<strong>com</strong>ments<br />

Comment[]<br />

Collection of <strong>com</strong>ments<br />

23.0<br />

222


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

currentPageUrl<br />

nextPageUrl<br />

total<br />

Type<br />

String<br />

String<br />

Integer<br />

Description<br />

URL to the first page of <strong>com</strong>ments, that is,<br />

the most recent <strong>com</strong>ments. The default is 25<br />

<strong>com</strong>ments per page.<br />

URL to the next page of <strong>com</strong>ments, that is,<br />

older <strong>com</strong>ments. The default is 25 <strong>com</strong>ments<br />

per page.<br />

Total number of <strong>com</strong>ments across all pages<br />

for the parent feed item<br />

Since Version<br />

23.0<br />

23.0<br />

23.0<br />

Community<br />

Note: Communities are available as a pilot program.<br />

Property<br />

description<br />

id<br />

invitationsEnabled<br />

name<br />

sendWel<strong>com</strong>eEmail<br />

status<br />

Type<br />

String<br />

String<br />

Boolean<br />

String<br />

Boolean<br />

String<br />

Description<br />

Community’s description<br />

18-character Id of the <strong>com</strong>munity<br />

Specifies if members of the <strong>com</strong>munity can<br />

invite other members to the <strong>com</strong>munity, true<br />

if they can, false otherwise.<br />

Community name<br />

Specifies if a wel<strong>com</strong>e email is automatically<br />

generated and sent to any new member. true<br />

if email is sent, false otherwise.<br />

Community’s status. Values are:<br />

• Active<br />

• Inactive<br />

• UnderConstruction<br />

Since<br />

Version<br />

26.0<br />

26.0<br />

26.0<br />

26.0<br />

26.0<br />

26.0<br />

urlPathPrefix<br />

String<br />

Community-specific URL prefix<br />

26.0<br />

url<br />

String<br />

Full URL to <strong>com</strong>munity<br />

26.0<br />

Community Page<br />

Note: Communities are available as a pilot program.<br />

Property<br />

<strong>com</strong>munities<br />

Type<br />

Community []<br />

Description<br />

List of <strong>com</strong>munities available to the current user<br />

Since<br />

Version<br />

26.0<br />

223


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since<br />

Version<br />

total<br />

Integer<br />

Total number of <strong>com</strong>munities<br />

26.0<br />

Connect Directory<br />

Property<br />

<strong>com</strong>munities<br />

Type<br />

Community []<br />

Description<br />

List of <strong>com</strong>munities in the current organization<br />

Note: Communities are available as a<br />

pilot program.<br />

Since<br />

Version<br />

26.0<br />

organization<br />

String<br />

URL to the <strong>Chatter</strong> organization<br />

25.0<br />

Conversation Detail<br />

Property<br />

id<br />

members<br />

messages<br />

read<br />

url<br />

Type<br />

String<br />

User Summary[]<br />

Message Collection<br />

Boolean<br />

String<br />

Description<br />

18-character Id of the conversation<br />

Collection of users participating in this<br />

conversation<br />

Messages in this conversation<br />

Does the context user have unread messages in<br />

this conversation?<br />

URL to the conversation detail page<br />

Since<br />

Version<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

Conversation Summary<br />

Property<br />

Type<br />

Description<br />

Since<br />

Version<br />

id<br />

String<br />

18-character Id of the conversation<br />

23.0<br />

latestMessage<br />

Message<br />

The most recent message in this conversation<br />

23.0<br />

members<br />

User Summary[]<br />

Collection of users participating in the<br />

conversation<br />

23.0<br />

read<br />

Boolean<br />

Does the context user have unread messages in<br />

this conversation?<br />

23.0<br />

url<br />

String<br />

URL to the conversation detail page<br />

23.0<br />

224


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Conversation Summary Collection<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

conversations<br />

Conversation Summary[]<br />

Collection of one or more conversations<br />

23.0<br />

currentPageUrl<br />

String<br />

URL to the first page of conversations, that<br />

is, the conversations with the most recent<br />

messages<br />

23.0<br />

nextPageUrl<br />

String<br />

URL to the next page of messages, that is,<br />

older conversations<br />

23.0<br />

Conversation Unread Count<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

hasMore<br />

Boolean<br />

true if the actual number of unread<br />

conversations is greater than 50, false<br />

otherwise<br />

23.0<br />

unreadCount<br />

Integer<br />

Number of unread conversations, that is,<br />

conversations that have unread messages. Is<br />

an exact value up to the maximum of 50, and<br />

is capped at 50 if the value is greater.<br />

23.0<br />

Error Message<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

errorCode<br />

String<br />

An error code with information about the error, for example,<br />

INSUFFICIENT_PRIVILEDGES.<br />

23.0<br />

message<br />

String<br />

Description of error<br />

23.0<br />

Error With Output<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

message<br />

String<br />

Description of the error<br />

27.0<br />

output<br />

Any response body<br />

The response body described in the requested<br />

resource. For example, if a successful request returns<br />

a Like response body but an error triggers the Error<br />

With Output response body, the value of the<br />

output property is a Like response body.<br />

27.0<br />

225


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Explanation Details<br />

Property<br />

data<br />

Type<br />

Various<br />

Description<br />

More information about the re<strong>com</strong>mendation. What is 24.0<br />

returned depends on the type.<br />

• UserFollowsSameUsers–people that both the user and<br />

re<strong>com</strong>mended person are following. See User Summary.<br />

• GroupMembersFollowed–people that the user is<br />

following and that are members of the re<strong>com</strong>mended<br />

group. See User Summary.<br />

• UserViewingSameRecords—records that the user and<br />

the re<strong>com</strong>mended person have recently viewed. See Record<br />

Summary.<br />

• RecordParentOfFollowed—records that the user is<br />

following and that are child records of the re<strong>com</strong>mended<br />

record. See Record Summary.<br />

Since Version<br />

summary<br />

String<br />

Explanation of re<strong>com</strong>mendation<br />

24.0<br />

type<br />

String<br />

Type of re<strong>com</strong>mendation explanation. Values are:<br />

• UserFollowsSameUsers<br />

• GroupMembersFollowed<br />

• UserViewingSameRecords<br />

• RecordParentOfFollowed<br />

24.0<br />

Explanation Summary<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

detailsUrl<br />

String<br />

URL for explanation details. If the<br />

re<strong>com</strong>mendation doesn’t have a detailed<br />

explanation, the string “null”.<br />

24.0<br />

summary<br />

String<br />

Explanation of re<strong>com</strong>mendation<br />

23.0<br />

type<br />

String<br />

Type of re<strong>com</strong>mendation explanation, such<br />

as UserFollowsSameUsers.<br />

24.0<br />

Favorite<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

<strong>com</strong>munity<br />

Reference<br />

Information about the <strong>com</strong>munity. Returns<br />

null if favorite exists in default <strong>com</strong>munity<br />

or <strong>com</strong>munities aren’t enabled.<br />

26.0<br />

Note: Communities are available as<br />

a pilot program.<br />

226


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

createdBy<br />

feedUrl<br />

id<br />

lastViewDate<br />

name<br />

searchText<br />

type<br />

Type<br />

User Summary<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

Information about the original creator of the<br />

favorite<br />

URL to the feed item for this favorite<br />

18-character Id of the favorite<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

Name of the favorite<br />

If the favorite is from a search, contains the<br />

search text, if not, an empty string<br />

An empty string or one of the following values:<br />

• listView<br />

• search<br />

Since Version<br />

24.0<br />

24.0<br />

24.0<br />

24.0<br />

24.0<br />

24.0<br />

24.0<br />

url<br />

String<br />

URL to this favorite<br />

24.0<br />

user<br />

User Summary<br />

Information about the user who saved this<br />

favorite<br />

24.0<br />

Favorites Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

favorites<br />

Favorite[]<br />

Collection of one or more favorites<br />

24.0<br />

total<br />

Integer<br />

Total number of favorites<br />

24.0<br />

Features<br />

Property<br />

Type<br />

chatter Boolean<br />

chatterActivity Boolean<br />

chatterGlobalInfluence Boolean<br />

chatterMessages Boolean<br />

chatterTopics Boolean<br />

dashboardComponentSnapshots Boolean<br />

feedPolling Boolean<br />

files<br />

Boolean<br />

filesOnComments Boolean<br />

trendingTopics Boolean<br />

Description<br />

Specifies whether <strong>Chatter</strong> is enabled for an organization or not.<br />

Specifies whether the user details include information about <strong>Chatter</strong><br />

activity<br />

Specifies whether the user details include global <strong>Chatter</strong> activity<br />

Specifies whether <strong>Chatter</strong> messages are enabled for the organization<br />

Reserved for the <strong>Chatter</strong> topics pilot<br />

Specifies whether the user can post dashboard <strong>com</strong>ponent snapshots<br />

Specifies whether the is-modified resource is enabled for the <strong>Chatter</strong><br />

<strong>API</strong><br />

Specifies whether files can act as resources for <strong>Chatter</strong> <strong>API</strong><br />

Specifies whether files can be attached to <strong>com</strong>ments<br />

Specifies whether trending topics are enabled<br />

Since Version<br />

27.0<br />

24.0<br />

24.0<br />

24.0<br />

26.0<br />

24.0<br />

24.0<br />

24.0<br />

24.0<br />

24.0<br />

227


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

viralInvitesAllowed<br />

Boolean<br />

Specifies whether existing <strong>Chatter</strong> users can invite people in their<br />

<strong>com</strong>pany to use <strong>Chatter</strong><br />

24.0<br />

Feed<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

feedItemsUrl<br />

String<br />

URL of feed items<br />

23.0<br />

isModifiedUrl<br />

String<br />

A News Feed Is-Modified resource with a since<br />

request parameter that contains an opaque token<br />

that describes when the feed was last modified.<br />

Returns null if feed is not a news feed.<br />

23.0<br />

Feed Body<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

messageSegments<br />

Segment[]<br />

Collection of message segments, based on type.<br />

Segments can be one or more of the following:<br />

• Message Segment: Entity Link<br />

• Message Segment: Field Change<br />

• Message Segment: Field Change Name<br />

• Message Segment: Field Change Value<br />

• Message Segment: Hashtag<br />

• Message Segment: Link<br />

• Message Segment: Mention<br />

• Message Segment: More Changes<br />

• Message Segment: Text<br />

23.0<br />

text<br />

String<br />

Unformatted text of the message. This can be an<br />

easy summary to use if you don’t want to process<br />

the message segments.<br />

23.0<br />

Feed Directory<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

favorites<br />

Favorite[]<br />

Collection of favorites that the logged-in user<br />

has saved.<br />

24.0<br />

feeds<br />

Feed Directory Item[]<br />

Collection of feed directory items that the<br />

logged-in user is allowed to view<br />

23.0<br />

228


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Feed Directory Item<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

feedItemsUrl<br />

String<br />

URL to the resource of the feed items for a specific<br />

feed. For example:<br />

23.0<br />

/services/data/v27.0/<br />

chatter/feeds/files/me/feed-items<br />

feedUrl<br />

String<br />

URL to the resource of a specific feed. For example:<br />

23.0<br />

/services/data/v27.0/<br />

chatter/feeds/files/me<br />

label<br />

String<br />

Name of the feed, such as, Groups, People, Company,<br />

and so on.<br />

23.0<br />

Feed Item<br />

The type property always returns all types, regardless of version. However, not all types are valid with all versions. Use the<br />

attachment property to verify the type of feed item. For example, for a type of PollPost, if the version is earlier than<br />

26.0, attachment is null. Use the text property to properly render any unknown feed item types.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

actor<br />

Depends on parent<br />

The entity that created the feed item. Values are:<br />

• Record Summary—if a record (V23.0)<br />

• User Summary—if a user (V23.0)<br />

Note: If the actor is a user, a User Summary<br />

response body is returned, not a Record<br />

Summary of type user.<br />

attachment<br />

body<br />

canShare<br />

Depends on type<br />

Feed Body<br />

Boolean<br />

Depends on the type value of the attachment. Values<br />

include:<br />

• Approval—Feed Item Attachment: Approval<br />

(v27.0)<br />

• BasicTemplate—Feed Item Attachment: Basic<br />

Template (v27.0)<br />

• Content—Feed Item Attachment: Content or null<br />

if the content is unavailable (v23.0)<br />

• Link—Feed Item Attachment: Link (v23.0)<br />

• Poll—Feed Item Attachment: Poll (v26.0)<br />

All other types return null.<br />

Information about the feed item<br />

true if feed item can be shared, false otherwise<br />

23.0<br />

27.0<br />

229


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

clientInfo<br />

ClientInfo<br />

Information about the Connected App used to<br />

authenticate the connection<br />

23.0<br />

<strong>com</strong>ments<br />

Comment Page<br />

Comments for this feed item<br />

23.0<br />

createdDate<br />

String<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

23.0<br />

currentUserLike<br />

Reference<br />

Note: This property is no longer available as<br />

of version 24.0. Use the myLike property<br />

instead.<br />

23.0–24.0<br />

A reference to a like object if applicable, nullotherwise.<br />

event<br />

id<br />

isBookmarkedByCurrentUser<br />

isDeleteRestricted<br />

isLikedByCurrentUser<br />

likes<br />

likesMessage<br />

myLike<br />

modifiedDate<br />

originalFeedItem<br />

originalFeedItemActor<br />

Boolean<br />

String<br />

Boolean<br />

Boolean<br />

Boolean<br />

Like Page<br />

Like Message Body<br />

Reference<br />

String<br />

Reference<br />

Depends on type<br />

true if feed item created due to an event change, false<br />

otherwise<br />

18-character Id of the feed item<br />

true if the current user has bookmarked this feed item,<br />

false otherwise.<br />

Returns true if a feed item cannot be deleted by the<br />

logged in user. If it returns false, possibly the logged<br />

in users can delete the feed item.<br />

true if the current user has liked this feed item, false<br />

otherwise<br />

Likes for this feed item<br />

A message body that describes who likes the feed item.<br />

If the logged-in user has liked the <strong>com</strong>ment, this<br />

property is a reference to the specific like, null otherwise<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

A reference to the original feed item if this feed item is<br />

a shared feed item, null otherwise.<br />

Value depends on type of original feed item. Values are:<br />

• Record Summary–if original feed item is a record<br />

• User Summary–if original feed item is a user<br />

• null if this feed item is not a shared feed item<br />

23.0<br />

23.0<br />

24.0<br />

25.0<br />

23.0<br />

23.0<br />

27.0<br />

23.0<br />

23.0<br />

24.0<br />

24.0<br />

parent<br />

Depends on type<br />

Value depends on type of parent. Values are:<br />

• File–if parent is a file<br />

• Group–if parent is a group<br />

• Record Summary–if parent is a record<br />

• User Summary–if parent is a user<br />

23.0<br />

230


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

Note: If the parent is a user, a User Summary<br />

response body is returned, not a Record<br />

Summary of type user. The same applies for<br />

both groups and files.<br />

photoUrl<br />

preamble<br />

type<br />

String<br />

Feed Item Preamble<br />

Message Body<br />

String<br />

URL of the photo associated with the feed item<br />

The preamble is the title of the post. This property<br />

contains renderable plain text for all the segments of the<br />

message, for example, “App Builders - Pam Jones”.<br />

Values are:<br />

• ActivityEvent<br />

• ApprovalPost<br />

• AttachArticleEvent<br />

• BasicTemplateFeedItem<br />

• ChatTranscriptPost<br />

• ContentPost<br />

• EmailMessageEvent<br />

• FacebookPost<br />

• LinkPost<br />

• PollPost<br />

• RypplePost<br />

• ReplyPost<br />

• TextPost<br />

• TrackedChange<br />

• TwitterPost<br />

• UserStatus<br />

23.0<br />

27.0<br />

23.0<br />

url<br />

String<br />

URL to this feed item<br />

23.0<br />

visibility<br />

String<br />

Who can see this feed item. Values are:<br />

• InternalUsers<br />

• AllUsers<br />

26.0<br />

Feed Item Attachment: Approval<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

The work item ID.<br />

27.0<br />

status<br />

String<br />

The status of the approval. Values are:<br />

• Approved<br />

• Fault<br />

• Held<br />

• NoResponse<br />

• Pending<br />

27.0<br />

231


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

• Reassigned<br />

• Rejected<br />

• Removed<br />

• Started<br />

Feed Item Attachment: Basic Template<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

description<br />

String<br />

An optional description with a 500 character limit.<br />

27.0<br />

icon<br />

Icon<br />

An optional icon.<br />

27.0<br />

linkUrl<br />

String<br />

An optional link URL to a detail page if available<br />

content can’t display inline.<br />

27.0<br />

subtype<br />

String<br />

The subtype associated with the basic template feed<br />

item. Value is:<br />

• CollaborationGroupCreated<br />

27.0<br />

title<br />

String<br />

An optional title to a detail page.<br />

27.0<br />

Feed Item Attachment: Content<br />

Property<br />

checkSum<br />

description<br />

downloadUrl<br />

fileExtension<br />

fileSize<br />

fileType<br />

hasImagePreview<br />

hasPdfPreview<br />

id<br />

isInMyFileSync<br />

mimeType<br />

renditionUrl<br />

Type<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Boolean<br />

Boolean<br />

String<br />

Boolean<br />

String<br />

String<br />

Description<br />

MD5 checksum for the file<br />

Description of the attachment<br />

URL to the content<br />

Extension of the file<br />

Size of the file in bytes. If size cannot be determined,<br />

returns unknown.<br />

Type of file<br />

true if the file has a preview image available, false<br />

otherwise<br />

true if the file has a PDF preview available, false<br />

otherwise<br />

18-character Id of the content<br />

Reserved for future use.<br />

MIME type content of the file.<br />

URL to the rendition resource for the file. Renditions<br />

are processed asynchronously and may not be available<br />

immediately after the file has been uploaded.<br />

Since version<br />

26.0<br />

23.0<br />

23.0<br />

26.0<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

26.0<br />

23.0<br />

26.0<br />

232


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since version<br />

title<br />

String<br />

Title of the file<br />

23.0<br />

versionId<br />

String<br />

Version Id of the file<br />

23.0<br />

Feed Item Attachment: Link<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

title<br />

String<br />

Description of the link<br />

23.0<br />

url<br />

String<br />

URL attached to the feed item (could be external)<br />

23.0<br />

Feed Item Attachment: Poll<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

choices<br />

Feed Poll Choice[]<br />

Collection of feed poll choices that make up the<br />

poll.<br />

26.0<br />

myChoiceId<br />

String<br />

18-character Id of the poll choice that the current<br />

user has voted for in this poll. Returns null if the<br />

current user hasn’t voted.<br />

26.0<br />

totalVoteCount<br />

Integer<br />

Total number of votes cast on the feed poll item.<br />

26.0<br />

Feed Item Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to the first page of feed items<br />

23.0<br />

isModifiedToken<br />

String<br />

An opaque polling token that<br />

describes when a news feed was last<br />

modified. Use this value as the<br />

since request parameter of the<br />

News Feed Is-Modified resource.<br />

27.0<br />

isModifiedUrl<br />

String<br />

A News Feed Is-Modified resource<br />

with a since request parameter<br />

that contains an opaque token that<br />

describes when the feed was last<br />

modified. Returns null if feed is<br />

not a news feed.<br />

23.0<br />

items<br />

Feed Item[]<br />

Collection of one or more feed<br />

items<br />

23.0<br />

nextPageUrl<br />

String<br />

URL to the next page of feed items<br />

23.0<br />

233


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Feed Item Preamble Message Body<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

messageSegments<br />

Segments[]<br />

Collection of message segments,<br />

based on type. Segments can be<br />

one or more of the following:<br />

• Message Segment: Entity Link<br />

• Message Segment: Text<br />

27.0<br />

text<br />

String<br />

The preamble is the title of the<br />

post. This property contains<br />

renderable plain text for all the<br />

segments of the message, for<br />

example, “App Builders - Pam<br />

Jones”.<br />

27.0<br />

Feed Modified Info<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

isModified<br />

Boolean<br />

true if a news feed and has been 23.0<br />

modified since the last time it was<br />

polled, false otherwise. Returns<br />

null if the feed is not a news feed.<br />

isModifiedToken<br />

String<br />

An opaque polling token that<br />

describes when a news feed was last<br />

modified. Use this value as the<br />

since request parameter of the<br />

News Feed Is-Modified resource.<br />

27.0<br />

nextPollUrl<br />

String<br />

A News Feed Is-Modified resource<br />

with a since request parameter<br />

that contains an opaque token that<br />

describes when the feed was last<br />

modified. Returns null if feed is<br />

not a news feed. Make a request<br />

to this resource after making a<br />

request to the isModifiedUrl<br />

resource in the Feed or Feed Item<br />

Page response bodies.<br />

23.0<br />

Feed Poll Choice<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

18-character Id of the poll choice<br />

26.0<br />

position<br />

Integer<br />

The location in the poll where this poll choice<br />

exists. The first poll choice starts at 1.<br />

26.0<br />

text<br />

String<br />

Label text associated with the poll choice<br />

26.0<br />

234


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

voteCount<br />

Integer<br />

Total number of votes for this poll choice<br />

26.0<br />

voteCountRatio<br />

Double<br />

The ratio of total number of votes for this<br />

poll choice to all votes cast in the poll.<br />

Multiply the ratio by 100 to get the<br />

percentage of votes cast for this poll choice.<br />

26.0<br />

File<br />

For all rendition properties, note the following: Renditions are processed asynchronously and may not be available immediately<br />

after the file has been uploaded.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

checkSum<br />

String<br />

MD5 checksum for the file<br />

26.0<br />

contentSize<br />

Integer<br />

Size of the file in bytes<br />

24.0<br />

contentUrl<br />

String<br />

If the file is a link, returns the URL, otherwise the<br />

string “null”<br />

24.0<br />

description<br />

String<br />

Description of the file<br />

24.0<br />

downloadUrl<br />

String<br />

URL to the file<br />

26.0<br />

fileExtension<br />

String<br />

Extension of the file<br />

26.0<br />

fileType<br />

String<br />

Type of file, such as PDF, PowerPoint, and so on<br />

24.0<br />

flashRenditionStatus<br />

String<br />

Specifies if a flash preview version of the file has<br />

been rendered<br />

24.0<br />

id<br />

String<br />

18-character Id of the file<br />

24.0<br />

isInMyFileSync<br />

Boolean<br />

Reserved for future use.<br />

26.0<br />

mimeType<br />

String<br />

File’s MIME type<br />

26.0<br />

modifiedDate<br />

String<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

24.0<br />

motif<br />

Motif<br />

Small, medium, and large icons indicating that the<br />

object is a file:<br />

27.0<br />

"motif": {<br />

"largeIconUrl":<br />

"/img/content/content64.png",<br />

"mediumIconUrl":<br />

"/img/content/content32.png",<br />

"smallIconUrl":<br />

"/img/icon/files16.png"<br />

}<br />

The icon is not a preview of the file.<br />

mySubscription<br />

Reference<br />

If the logged in user is following this file, this<br />

contains information about the subscription,<br />

otherwise returns null.<br />

23.0<br />

235


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

origin<br />

String<br />

Specifies the file source. Valid values are:<br />

• <strong>Chatter</strong>—file came from <strong>Chatter</strong><br />

• Content—file came from content<br />

• FileField—file came from a record or other<br />

form<br />

24.0<br />

owner<br />

User Summary<br />

Owner of the file<br />

24.0<br />

name<br />

String<br />

Name of the file<br />

24.0<br />

pdfRenditionStatus<br />

String<br />

Specifies if a PDF preview version of the file has<br />

been rendered<br />

24.0<br />

renditionUrl<br />

String<br />

URL to the rendition resource for the file.<br />

Renditions are processed asynchronously and may<br />

not be available immediately after the file has been<br />

uploaded.<br />

26.0<br />

thumb120By90RenditionStatus<br />

String<br />

Specifies if a 120x90–pixel–sized preview image of<br />

the file has been rendered.<br />

24.0<br />

thumb240By180RenditionStatus<br />

String<br />

Specifies if a 240x180–pixel–sized preview image of<br />

the file has been rendered.<br />

24.0<br />

thumb720By480RenditionStatus<br />

String<br />

Specifies if a 720x480–pixel–sized preview image of<br />

the file has been rendered.<br />

24.0<br />

title<br />

String<br />

Title of the file<br />

24.0<br />

type<br />

String<br />

ContentDocument<br />

24.0<br />

url<br />

String<br />

URL for the file<br />

24.0<br />

versionNumber<br />

String<br />

Version number of the file<br />

24.0<br />

File Details<br />

Includes all of the File response body with the additional item:<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

pageCount<br />

Integer<br />

Number of pages for documents 24.0<br />

that support flash renditions, or<br />

the number of slides in a<br />

presentation. Returns 0 if the flash<br />

rendition fails, or if it isn’t<br />

supported for the file type.<br />

File Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL for the first page of files<br />

24.0<br />

236


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

files<br />

File[]<br />

Collection of one or more files<br />

24.0<br />

nextPageUrl<br />

String<br />

URL for the next page of files<br />

24.0<br />

previousPageUrl<br />

String<br />

URL for the previous page of files<br />

24.0<br />

File Shares Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL for the first page of file shares<br />

24.0<br />

shares<br />

Shares[]<br />

Collection of one or more file shares<br />

24.0<br />

nextPageUrl<br />

String<br />

URL for the next page of file shares<br />

24.0<br />

previousPageUrl<br />

String<br />

URL for the previous page of file shares<br />

24.0<br />

Flat Feed<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL for the first page of items<br />

25.0–26.0<br />

items<br />

Flat Feed Item[]<br />

Collection of one or more flat feed items<br />

25.0–26.0<br />

nextPageUrl<br />

String<br />

URL for the next page of items<br />

25.0–26.0<br />

Flat Feed Item<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

item<br />

Depends on type<br />

The flat feed item, depending on the value of<br />

type. Valid values are:<br />

• If type is Comment—Comment<br />

• If type is FeedItem—Feed Item<br />

25.0–26.0<br />

type<br />

String<br />

The type of item. Valid values are:<br />

• Comment<br />

• FeedItem<br />

25.0–26.0<br />

Follower Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to the current page<br />

23.0<br />

followers<br />

Subscription[]<br />

Collection of one or more followers or<br />

subscriptions<br />

23.0<br />

237


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

mySubscription<br />

Reference<br />

Note: This field is no longer<br />

available as of version 24.0.<br />

23.0–24.0<br />

If the logged-in user is following this user,<br />

this contains information about the<br />

subscription, else returns null<br />

nextPageUrl<br />

String<br />

URL to the next page<br />

23.0<br />

previousPageUrl<br />

String<br />

URL to the previous page<br />

23.0<br />

total<br />

Integer<br />

Total number of followers<br />

23.0<br />

Following Counts<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

people<br />

Integer<br />

Number of people user is following<br />

23.0<br />

records<br />

Integer<br />

Number of records user is following<br />

23.0<br />

total<br />

Integer<br />

Total number of items user is following<br />

23.0<br />

Following Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to the current page<br />

23.0<br />

following<br />

Subscription[]<br />

Collection of one or more subscriptions<br />

23.0<br />

nextPageUrl<br />

String<br />

URL of the next page<br />

23.0<br />

previousPageUrl<br />

String<br />

URL of the previous page<br />

23.0<br />

total<br />

Integer<br />

Total number of records being followed<br />

23.0<br />

Group<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

canHave<strong>Chatter</strong>Guests<br />

Boolean<br />

true if this group allows <strong>Chatter</strong> customers,<br />

false otherwise<br />

23.0<br />

<strong>com</strong>munity<br />

Reference<br />

Information about the <strong>com</strong>munity. Returns null<br />

if group exists in the default <strong>com</strong>munity or<br />

<strong>com</strong>munities aren’t enabled.<br />

26.0<br />

description<br />

String<br />

Text-only description of the group<br />

23.0<br />

fileCount<br />

Integer<br />

Number of files posted to this group.<br />

24.0<br />

id<br />

String<br />

18-character Id of the group<br />

23.0<br />

238


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

lastFeedItemPostDate<br />

memberCount<br />

motif<br />

Type<br />

String<br />

Integer<br />

Motif<br />

Description<br />

Date of the most recent feed item posted to the<br />

group.<br />

Total number of group members<br />

Small, medium, and large icons indicating that the<br />

object is a group:<br />

"motif": {<br />

"largeIconUrl":<br />

"/img/icon/groups64.png",<br />

"mediumIconUrl":<br />

"/img/icon/groups32.png",<br />

"smallIconUrl":<br />

"/img/icon/groups16.png"<br />

}<br />

The icon is not the group photo.<br />

Since Version<br />

24.0<br />

23.0<br />

27.0<br />

myRole<br />

String<br />

Values are:<br />

• GroupOwner<br />

• GroupManager<br />

• NotAMember<br />

• NotAMemberPrivateRequested<br />

• StandardMember<br />

23.0<br />

mySubscription<br />

Reference<br />

If the logged-in user is a member of this group,<br />

this contains information about that subscription,<br />

or returns null otherwise.<br />

23.0<br />

name<br />

String<br />

Name of the group<br />

23.0<br />

owner<br />

User Summary<br />

Information about the owner of the group.<br />

24.0<br />

photo<br />

Photo<br />

Information about the group photo<br />

23.0<br />

type<br />

String<br />

CollaborationGroup.<br />

23.0<br />

url<br />

String<br />

Relative URL string to the group<br />

23.0<br />

visibility<br />

String<br />

Values are:<br />

• PrivateAccess<br />

• PublicAccess<br />

23.0<br />

Group <strong>Chatter</strong> Settings<br />

A user’s <strong>Chatter</strong> settings for a specific group.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

emailFrequency<br />

String<br />

The frequency with which a group member receives email<br />

from a group. One of the following values:<br />

• EachPost<br />

• DailyDigest<br />

27.0<br />

239


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

• WeeklyDigest<br />

• Never<br />

• UseDefault<br />

The value UseDefault uses the user’s default global<br />

setting defined in User <strong>Chatter</strong> Settings.<br />

Group Member<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

18-character Id of the group membership.<br />

23.0<br />

role<br />

String<br />

Values are:<br />

• GroupOwner<br />

• GroupManager<br />

• NotAMember<br />

• NotAMemberPrivateRequested<br />

• StandardMember<br />

23.0<br />

url<br />

String<br />

URL to this membership<br />

23.0<br />

user<br />

User Summary<br />

Information about the user who is subscribed to this<br />

group<br />

23.0<br />

Group Member Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to this page of members<br />

23.0<br />

members<br />

Group Member[]<br />

Collection of group members<br />

23.0<br />

myMembership<br />

Reference<br />

If the logged-in user is a member of this group,<br />

returns information about that membership, or<br />

returns null otherwise<br />

23.0<br />

nextPageUrl<br />

String<br />

URL to the next page of members<br />

23.0<br />

previousPageUrl<br />

String<br />

URL to the previous page of members<br />

23.0<br />

totalMemberCount<br />

Integer<br />

Total number of group members<br />

23.0<br />

Group Membership Request<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

createdDate<br />

String<br />

An ISO formatted date string specifying the date<br />

of the membership request.<br />

27.0<br />

id<br />

String<br />

ID for the group membership request object<br />

27.0<br />

240


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

groupRequest<br />

lastUpdateDate<br />

responseMessage<br />

Type<br />

Reference<br />

String<br />

String<br />

Description<br />

Information about the group the user is requesting<br />

to join.<br />

An ISO formatted date string specifying the last<br />

time the request was updated.<br />

A message to display to the user if their membership<br />

request is declined. The value of this property is<br />

used only when the value of the status property<br />

is Declined.<br />

The maximum length is 756 characters.<br />

Since Version<br />

27.0<br />

27.0<br />

27.0<br />

status<br />

String<br />

The status of the request to join a private group.<br />

Values are:<br />

• Accepted<br />

• Declined<br />

• Pending<br />

27.0<br />

url<br />

String<br />

URL to this group membership request object<br />

27.0<br />

user<br />

User Summary<br />

Information about the user requesting membership<br />

in a group.<br />

27.0<br />

Group Membership Request Collection<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

requests<br />

Group Membership<br />

Request<br />

Information about all requests to join a private<br />

group.<br />

27.0<br />

total<br />

Integer<br />

The total number of requests to join a private group.<br />

27.0<br />

Group Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to this page of groups<br />

23.0<br />

groups<br />

Group[]<br />

Collection of groups<br />

23.0<br />

nextPageUrl<br />

String<br />

URL to the next page of groups<br />

23.0<br />

previousPageUrl<br />

String<br />

URL to the previous page of groups<br />

23.0<br />

Icon<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

height<br />

Integer<br />

The height of the icon, in pixels.<br />

27.0<br />

width<br />

Integer<br />

The width of the icon, in pixels.<br />

27.0<br />

241


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

url<br />

String<br />

The URL of the icon. This URL is available to<br />

unauthenticated users. The URL doesn’t expire.<br />

27.0<br />

Influence Thresholds<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

name<br />

String<br />

Description of this influencer category. For example:<br />

Active Influencer<br />

24.0<br />

threshold<br />

Double<br />

Number expressed as a raw percentile that defines the<br />

bottom threshold for this influencer category. For<br />

example: 0.25 defines the cutoff for the Active<br />

Influencer category, which means it includes users<br />

with an influence rank equal to or greater than the 25th<br />

percentile (25%) and less than the next highest category<br />

threshold.<br />

24.0<br />

Library<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

18-character Id of the library<br />

24.0<br />

name<br />

String<br />

Name of the library<br />

24.0<br />

type<br />

String<br />

Type of library, for example, ContentWorkspace<br />

24.0<br />

url<br />

String<br />

URL to this library<br />

24.0<br />

Like<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

18-character Id of the like on either a <strong>com</strong>ment or a feed<br />

item<br />

23.0<br />

likedItem<br />

Reference<br />

A reference to the liked <strong>com</strong>ment or feed item.<br />

27.0<br />

url<br />

String<br />

URL to this like<br />

23.0<br />

user<br />

User Summary<br />

Information about the user who liked this <strong>com</strong>ment or feed<br />

item<br />

23.0<br />

Like Message Body<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

messageSegments<br />

Segments[]<br />

Collection of message segments, based on type. Segments can<br />

be one or more of the following:<br />

• Message Segment: Entity Link<br />

27.0<br />

242


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

• Message Segment: Resource Link<br />

• Message Segment: Text<br />

text<br />

String<br />

Text summary of the users who like the feed item or <strong>com</strong>ment.<br />

For example, “You like this.” or “Renee Moreau, Gordon<br />

Johnson, and Pam Jones like this.”<br />

27.0<br />

Like Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to the current page of likes<br />

23.0<br />

likes<br />

Like[]<br />

Collection of likes<br />

23.0<br />

myLike<br />

Reference<br />

Note: This field is no longer available as<br />

of version 24.0.<br />

23.0–24.0<br />

Either returns a reference to the specific like or<br />

returns null<br />

nextPageUrl<br />

String<br />

URL to the next page of likes<br />

23.0<br />

previousPageUrl<br />

String<br />

URL to the previous page of likes<br />

23.0<br />

total<br />

Integer<br />

Total number of likes for the item<br />

23.0<br />

Message<br />

Property<br />

body<br />

conversationId<br />

conversationUrl<br />

id<br />

recipients<br />

Type<br />

Feed Body<br />

String<br />

String<br />

String<br />

User Summary[]<br />

Description<br />

Text of this message<br />

18-character Id of the conversation<br />

this message is part of<br />

URL to the conversation this message<br />

is part of<br />

18-character Id of the message<br />

Collection of one or more message<br />

recipients<br />

Note: The collection of<br />

recipients is empty for the<br />

following resources because<br />

the conversation participants<br />

are already identified in the<br />

conversation’s members<br />

property in Conversation<br />

Since Version<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

243


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

Detail and Conversation<br />

Summary.<br />

• /chatter/users/me/<br />

conversations<br />

• /chatter/users/me/<br />

conversations/<br />

conversationId<br />

sentDate<br />

String<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

23.0<br />

sender<br />

User Summary<br />

Information about the user who sent<br />

this message<br />

23.0<br />

url<br />

String<br />

URL to this message<br />

23.0<br />

Message Collection<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to the first page of messages, that is, the most recent<br />

messages<br />

23.0<br />

messages<br />

Message[]<br />

Collection of one or more messages<br />

23.0<br />

nextPageUrl<br />

String<br />

URL to the next page of messages, that is, older messages<br />

23.0<br />

Message Segment: Entity Link<br />

Represents an inline link to a URL. The URL is an object, such as a record or a group.<br />

Available in versions 25.0 and later.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

motif<br />

Motif<br />

A set of small, medium, and large icons that correspond to the<br />

entity type.<br />

27.0<br />

reference<br />

Reference<br />

Information about the link<br />

25.0<br />

text<br />

String<br />

Plain text output for this segment<br />

25.0<br />

type<br />

String<br />

EntityLink<br />

25.0<br />

244


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Message Segment: Field Change<br />

Represents an inline field change, for example, "First Name from Bob to Joe". This segment can consist of multiple<br />

segments, for example:<br />

[<br />

]<br />

Text("Owner from "),<br />

FieldChangeValue("Bob Smith"),<br />

Text(" to "),<br />

FieldChangeValue("Dave Jones")<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

segments<br />

Segments[]<br />

Collection of message segments, based on type. Segments<br />

can be one or more of the following:<br />

• Message Segment: Entity Link<br />

• Message Segment: Field Change<br />

• Message Segment: Field Change Name<br />

• Message Segment: Field Change Value<br />

• Message Segment: Hashtag<br />

• Message Segment: Link<br />

• Message Segment: Mention<br />

• Message Segment: More Changes<br />

• Message Segment: Text<br />

23.0<br />

text<br />

String<br />

Formatted text of the change. For example:<br />

23.0<br />

"City from San Francisco to<br />

New Orleans"<br />

type<br />

String<br />

Value is FieldChange<br />

23.0<br />

Message Segment: Field Change Name<br />

Represents an inline name of a field change, like “Name” or “Description.” Making this a separate segment makes it possible<br />

to give special user interface treatments to field names, for example, making a name field bold.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

text<br />

String<br />

Formatted text of the change. Possible values include:<br />

• the old name of the field<br />

• the new name of the field<br />

23.0<br />

type<br />

String<br />

Value is FieldChangeName<br />

23.0<br />

Message Segment: Field Change Value<br />

Represents an inline value of a field change, like "1" or "Bob Smith.” Making this a separate segment makes it possible to add<br />

special coding, for example, to wrap values in anchor tags.<br />

245


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

text<br />

String<br />

Formatted text of the change. Possible values include:<br />

• the words a blank value<br />

23.0<br />

Note: This text is also localized.<br />

• the old value of the field<br />

• the new value of the field<br />

type<br />

String<br />

Value is FieldChangeValue<br />

23.0<br />

url<br />

String<br />

URL value if the field change is to a URL field (such as a<br />

web address)<br />

23.0<br />

Message Segment: Hashtag<br />

Represents an inline hashtag.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

tag<br />

String<br />

Text of the hashtag without the hash symbol (#)<br />

23.0<br />

text<br />

String<br />

Text of the hashtag with the hash symbol (#)<br />

23.0<br />

type<br />

String<br />

Value is Hashtag<br />

23.0<br />

url<br />

String<br />

URL search for the tag in this format:<br />

23.0<br />

/feed-items?q=tag<br />

Message Segment: Link<br />

Represents an inline link to a URL<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

text<br />

String<br />

Formatted text of the feed item of this segment<br />

23.0<br />

type<br />

String<br />

Value is Link<br />

23.0<br />

url<br />

String<br />

URL value of the link<br />

23.0<br />

Message Segment: Mention<br />

Represents an inline @mention.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

accessible<br />

Boolean<br />

Specifies whether the mentioned user would be able to see<br />

mention when it was posted: true if the mentioned user<br />

could see the post, false otherwise<br />

23.0<br />

246


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

name<br />

text<br />

type<br />

user<br />

Type<br />

String<br />

String<br />

String<br />

User Summary<br />

Description<br />

Name of the user mentioned<br />

Formatted text of the feed item of this segment<br />

Value is Mention<br />

Information about the mentioned user, null if the logged-in<br />

user doesn’t have access.<br />

Since Version<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

Message Segment: More Changes<br />

In feed items with a large number of tracked changes, the message is formatted as: "changed A, B, and made 3 more changes."<br />

The more changes segment contains the "3 more changes."<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

moreChangesCount<br />

Integer<br />

Number of other changes<br />

23.0<br />

text<br />

String<br />

Formatted text of the number of changes. For example: "2<br />

other changes"<br />

23.0<br />

Note: This value is localized.<br />

type<br />

String<br />

Value is MoreChanges<br />

23.0<br />

Message Segment: Resource Link<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

text<br />

String<br />

Formatted text of this segment<br />

23.0<br />

type<br />

String<br />

Value is "ResourceLink"<br />

23.0<br />

url<br />

String<br />

URL value of the resource link<br />

27.0<br />

Message Segment: Text<br />

Represents plain inline text.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

text<br />

String<br />

Formatted text associated with the item. Possible values<br />

include:<br />

• formatted text of a <strong>com</strong>ment<br />

• the name of the field that has been changed with the<br />

word from<br />

23.0<br />

type<br />

String<br />

Value is Text<br />

23.0<br />

247


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Motif<br />

Each property in the motif response body contains a URL to a small, medium, or large icon that indicates the <strong>Database</strong>.<strong>com</strong><br />

record type. Common record types in <strong>Chatter</strong> are files, users, and groups, but all record types have a set of motif icons. Custom<br />

object records use their tab style icon. All icons are available to unauthenticated users so that, for example, you can display the<br />

motif icons in an email.<br />

Note: The motif images are icons, not user uploaded images or photos. For example, every user has the same set of<br />

motif icons.<br />

Custom object records use their tab style icon, for example, the following custom object uses the “boat” tab style:<br />

"motif": {<br />

"largeIconUrl": "/img/icon/custom51_100/boat64.png",<br />

"mediumIconUrl": "/img/icon/custom51_100/boat32.png",<br />

"smallIconUrl": "/img/icon/custom51_100/boat16.png"<br />

},<br />

Users use the following icons:<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

Groups use the following icons:<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

Files use the following icons:<br />

"motif": {<br />

"largeIconUrl": "/img/content/content64.png",<br />

"mediumIconUrl": "/img/content/content32.png",<br />

"smallIconUrl": "/img/icon/files16.png"<br />

},<br />

Note: To view the icons in the previous examples, preface the URL with https://instance_name. For example,<br />

https://instance_name/img/icon/profile64.png.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

largeIconUrl<br />

String<br />

A large icon indicating the record type.<br />

27.0<br />

mediumIconUrl<br />

String<br />

A medium icon indicating the record type.<br />

27.0<br />

smallIconUrl<br />

String<br />

A small icon indicating the record type.<br />

27.0<br />

248


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Organization<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

accessTimeout<br />

Integer<br />

Amount of time after which the system prompts users who<br />

have been inactive to log out or continue working<br />

24.0<br />

features<br />

Features<br />

Information about features available in the organization<br />

24.0<br />

name<br />

String<br />

Organization name<br />

26.0<br />

orgId<br />

String<br />

18-character Id for the organization<br />

24.0<br />

userSettings<br />

User Settings<br />

Information about the organization permissions for the<br />

user<br />

24.0<br />

Organization Summary<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

name<br />

String<br />

Organization name<br />

26.0<br />

orgId<br />

String<br />

18-character Id for the organization<br />

24.0<br />

Parent<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

18-character Id of the parent<br />

23.0<br />

url<br />

String<br />

URL of the parent<br />

23.0<br />

Phone Number<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

number<br />

String<br />

Phone number<br />

23.0–26.0<br />

Important: This parameter is not supported after<br />

version 26.0. Use phoneNumber instead.<br />

phoneNumber<br />

String<br />

Phone number<br />

27.0<br />

type<br />

String<br />

Values are:<br />

• Fax<br />

• Mobile<br />

• Work<br />

23.0<br />

249


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Photo<br />

Property<br />

fullEmailPhotoUrl<br />

largePhotoUrl<br />

photoVersionId<br />

smallPhotoUrl<br />

standardEmailPhotoUrl<br />

url<br />

Type<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

A temporary URL to the large profile picture that expires<br />

after 30 days. This URL is available to unauthenticated users.<br />

URL to the large profile picture. The default width is 200<br />

pixels, while the length is scaled so the original image<br />

proportions are maintained.<br />

18-character Id to that version of the photo.<br />

URL to the small profile picture. The default size is 64x64<br />

pixels.<br />

A temporary URL to the small profile picture that expires<br />

after 30 days. This URL is available to unauthenticated users.<br />

URL to a resource that returns a Photo response body: for<br />

example,<br />

/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo.<br />

Since<br />

Version<br />

27.0<br />

23.0<br />

24.0<br />

23.0<br />

27.0<br />

27.0<br />

Re<strong>com</strong>mendation<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

action<br />

String<br />

The re<strong>com</strong>mended action. Values are:<br />

• follow (V23.0)<br />

• join (V23.0)<br />

• view (V25.0)<br />

actOnUrl<br />

String<br />

URL that can be used with an HTTP method<br />

POST request to follow a re<strong>com</strong>mended user, file,<br />

or record, or join a re<strong>com</strong>mended group. For<br />

example:<br />

23.0<br />

/users/me/following/<br />

?subjectId=001D000000Iyu2p<br />

explanation<br />

Explanation<br />

Summary<br />

The re<strong>com</strong>mendation explanation<br />

23.0<br />

object<br />

Various<br />

The object with which the receiver is re<strong>com</strong>mended<br />

to take action. Possible objects are:<br />

• File (V24.0)<br />

• Group (V23.0)<br />

• Record Summary (V23.0)<br />

• User Summary (V23.0)<br />

type<br />

String<br />

No longer available as of version 24.0<br />

23.0–24.0<br />

250


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Record Summary<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

18-character Id of the record<br />

23.0<br />

motif<br />

Motif<br />

Small, medium, and large icons<br />

indicating the tab style of the record.<br />

There are many tab styles. The following<br />

URLs are for the “boat” tab style:<br />

27.0<br />

"motif": {<br />

"largeIconUrl":<br />

"/img/icon/custom51_100/boat64.png",<br />

"mediumIconUrl":<br />

"/img/icon/custom51_100/boat32.png",<br />

"smallIconUrl":<br />

"/img/icon/custom51_100/boat16.png"<br />

}<br />

mySubscription<br />

Reference<br />

If the logged in user is following this<br />

record, this contains information about<br />

the subscription, otherwise returns null.<br />

24.0<br />

name<br />

String<br />

Formatted display name<br />

23.0<br />

type<br />

String<br />

Type of record, such as CustomObject,<br />

ContentDocument, and so on<br />

23.0<br />

url<br />

String<br />

Relative URL to this record<br />

23.0<br />

Reference<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

id<br />

String<br />

18-character Id of the object being referenced<br />

23.0<br />

url<br />

String<br />

URL to the resource endpoint<br />

23.0<br />

Shares<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

entity<br />

Depends on<br />

sharing<br />

Returns information about the user, record, or group the file<br />

is shared with. Value is one of the following:<br />

• Group<br />

• Record Summary<br />

• User Summary<br />

• Library<br />

24.0<br />

251


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

sharingType<br />

Type<br />

String<br />

Description<br />

The permission level of sharing. Values are:<br />

24.0<br />

• C—collaborator<br />

• I—sharing permission is determined by location. This<br />

generally occurs when the sharing permission is not set<br />

on the file, but on the library instead. This value is also<br />

used when the logged-in user is the same as owner of the<br />

file.<br />

• N—no access<br />

• V—viewer<br />

Since Version<br />

Subscription<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

<strong>com</strong>munity<br />

Reference<br />

Information about the <strong>com</strong>munity. Returns null if subscription<br />

exists in default <strong>com</strong>munity or <strong>com</strong>munities aren’t enabled.<br />

26.0<br />

Note: Communities are available as a pilot program.<br />

id<br />

String<br />

18-character Id of the subscription<br />

23.0<br />

subject<br />

Depends<br />

Information about the parent, that is, the thing or person being<br />

followed. Valid values are:<br />

• Group<br />

• Record Summary<br />

• User Summary<br />

23.0<br />

subscriber<br />

Depends<br />

Information about the subscriber, that is, the person following<br />

this item. Valid values are:<br />

• Group<br />

• Record Summary<br />

• User Summary<br />

23.0<br />

url<br />

String<br />

Relative URL to this specific subscription<br />

23.0<br />

Subscription Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

Returns the current page of subscriptions<br />

23.0<br />

nextPageUrl<br />

String<br />

Returns the next page of subscriptions. If there is no next page,<br />

returns the string “null”<br />

23.0<br />

mySubscription<br />

Reference<br />

Returns information about the subscription, or null the<br />

logged-in user is not subscribed.<br />

23.0<br />

252


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

previousPageUrl<br />

String<br />

Returns the previous page of subscriptions. If there is no<br />

previous page, returns the string “null”<br />

23.0<br />

subscriptions<br />

Subscription[]<br />

Collection of subscriptions<br />

23.0<br />

total<br />

Integer<br />

Total number of subscriptions<br />

23.0<br />

Topics<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

name<br />

String<br />

Name of the topic<br />

24.0<br />

User <strong>Chatter</strong> Settings<br />

A user’s global <strong>Chatter</strong> settings.<br />

Property<br />

Type<br />

Description<br />

Available Since<br />

defaultGroupEmailFrequency<br />

String<br />

The default frequency with which a user receives email from<br />

a group when they join it. Values are:<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

• Never<br />

27.0<br />

User Detail<br />

See Is User Summary or User Detail Returned? for information about when this response body is returned.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

aboutMe<br />

String<br />

Text from user's profile<br />

23.0<br />

address<br />

Address<br />

Address<br />

23.0<br />

chatterActivity<br />

<strong>Chatter</strong> Activity<br />

<strong>Chatter</strong> activity statistics<br />

23.0<br />

chatterInfluence<br />

<strong>Chatter</strong> Influence<br />

User’s influence rank<br />

23.0<br />

<strong>com</strong>panyName<br />

String<br />

Company name<br />

23.0<br />

currentStatus<br />

User Status<br />

Note: This property is no longer available<br />

as of version 25.0.<br />

23.0–25.0<br />

User's current status<br />

email<br />

String<br />

User's email address<br />

23.0<br />

firstName<br />

String<br />

User's first name<br />

23.0<br />

followersCount<br />

Integer<br />

Number of users following this user<br />

23.0<br />

253


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

followingCounts<br />

Following Counts<br />

Information about items the user is following<br />

23.0<br />

groupCount<br />

Integer<br />

Number of groups user is following<br />

23.0<br />

id<br />

String<br />

18-character Id of the user<br />

23.0<br />

isActive<br />

Boolean<br />

true if user is active, false otherwise<br />

23.0<br />

is<strong>Chatter</strong>Guest<br />

Boolean<br />

Note: This property is no longer available<br />

as of version 26.0. Use the userType<br />

property instead.<br />

23.0–25.0<br />

true if user is a <strong>Chatter</strong> customer, false otherwise<br />

lastName<br />

String<br />

User's last name<br />

23.0<br />

managerId<br />

String<br />

18-character Id of the user’s manager<br />

23.0<br />

managerName<br />

String<br />

Locale-based concatenation of manager's first and<br />

last names<br />

23.0<br />

motif<br />

Motif<br />

Small, medium, and large icons indicating that the<br />

object is a user:<br />

27.0<br />

"motif": {<br />

"largeIconUrl":<br />

"/img/icon/profile64.png",<br />

"mediumIconUrl":<br />

"/img/icon/profile32.png",<br />

"smallIconUrl":<br />

"/img/icon/profile16.png"<br />

}<br />

The motif icon is not the user’s profile picture.<br />

mySubscription<br />

Reference<br />

If the logged-in user is following this user, this<br />

contains information about the subscription, else<br />

returns null<br />

23.0<br />

name<br />

String<br />

Locale-based concatenation of user's first and last<br />

names<br />

23.0<br />

phoneNumbers<br />

Phone Number[]<br />

Collection of user's phone numbers<br />

23.0<br />

photo<br />

Photo<br />

Information about the user's photos<br />

23.0<br />

title<br />

String<br />

Title of the user<br />

23.0<br />

type<br />

String<br />

User<br />

23.0<br />

url<br />

String<br />

URL to the user's profile<br />

23.0<br />

username<br />

String<br />

User name of the user, such as<br />

Admin@my<strong>com</strong>pany.<strong>com</strong>.<br />

24.0<br />

userType<br />

String<br />

Type of user. Values are:<br />

• <strong>Chatter</strong>Guest—User is a <strong>Chatter</strong> customer in<br />

an external group<br />

• Guest—Unauthenticated users<br />

26.0<br />

254


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

• Internal—User is a standard organization<br />

member<br />

• Portal—User is a Customer Portal User, a<br />

<strong>com</strong>munities user, and so on.<br />

• System—User is <strong>Chatter</strong> Expert or a system<br />

user<br />

User Group Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to the current page<br />

23.0<br />

groups<br />

Group[]<br />

Collection of groups for the logged-in user<br />

23.0<br />

nextPageUrl<br />

String<br />

URL to the next page, if there is no next page,<br />

returns the string “null”<br />

23.0<br />

previousPageUrl<br />

String<br />

URL to the previous page, if there is no previous<br />

page, returns the string “null”<br />

23.0<br />

User Page<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

currentPageUrl<br />

String<br />

URL to the current page<br />

23.0<br />

nextPageUrl<br />

String<br />

URL to the next page, if there is no next page,<br />

returns the string “null”<br />

23.0<br />

previousPageUrl<br />

String<br />

URL to the previous page, if there is no previous<br />

page, returns the string “null”<br />

23.0<br />

users<br />

User Detail[]<br />

Collection of user detail information.<br />

24.0<br />

User Settings<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

approvalPosts<br />

Boolean<br />

User can approve workflows from <strong>Chatter</strong> posts.<br />

27.0<br />

canFollow<br />

Boolean<br />

The logged-in user is allowed to follow things.<br />

24.0<br />

canModifyAllData<br />

Boolean<br />

User has “Modify all Data” permission<br />

24.0<br />

canOwnGroups<br />

Boolean<br />

User can own groups<br />

24.0<br />

canViewAllData<br />

Boolean<br />

User has “View all Data” permission<br />

24.0<br />

canViewAllGroups<br />

Boolean<br />

User has “View all Groups” permission<br />

24.0<br />

canViewAllUsers<br />

Boolean<br />

User has “View all Users” permission<br />

24.0<br />

canViewFullUserProfile<br />

Boolean<br />

User can see of other user’s <strong>Chatter</strong> profiles<br />

24.0<br />

255


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

canViewPublicFiles<br />

Boolean<br />

User can see all files marked as public<br />

24.0<br />

externalUser<br />

Boolean<br />

User is a <strong>Chatter</strong> customer<br />

24.0<br />

hasAccessToInternalOrg<br />

Boolean<br />

User is a member of the internal organization<br />

26.0<br />

hasFileSync<br />

Boolean<br />

Reserved for future use<br />

26.0<br />

userId<br />

String<br />

18-character Id of the user<br />

24.0<br />

userLocale<br />

String<br />

Locale of user<br />

24.0<br />

User Status<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

body<br />

Feed Body[]<br />

Body of the post<br />

23.0–25.0<br />

parentId<br />

String<br />

18-character Id<br />

23.0–25.0<br />

url<br />

String<br />

URL to this user status post<br />

23.0–25.0<br />

User Summary<br />

See Is User Summary or User Detail Returned? for information about when this response body is returned.<br />

Property<br />

Type<br />

Description<br />

Since Version<br />

<strong>com</strong>panyName<br />

String<br />

Name of the <strong>com</strong>pany<br />

23.0<br />

firstName<br />

String<br />

User's first name<br />

23.0<br />

id<br />

String<br />

18-character Id<br />

23.0<br />

isActive<br />

Boolean<br />

true if user is active, false otherwise.<br />

25.0<br />

is<strong>Chatter</strong>Guest<br />

Boolean<br />

Note: This property is no longer available as<br />

of version 26.0. Use the userType property<br />

instead.<br />

23.0–26.0<br />

true if user is a <strong>Chatter</strong> customer, false otherwise<br />

lastName<br />

String<br />

User's last name<br />

23.0<br />

motif<br />

Motif<br />

Small, medium, and large icons indicating that the object<br />

is a user:<br />

27.0<br />

"motif": {<br />

"largeIconUrl":<br />

"/img/icon/profile64.png",<br />

"mediumIconUrl":<br />

"/img/icon/profile32.png",<br />

"smallIconUrl":<br />

"/img/icon/profile16.png"<br />

},<br />

The motif icon is not the user’s profile photo.<br />

256


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Property<br />

mySubscription<br />

name<br />

photo<br />

title<br />

type<br />

url<br />

userType<br />

Type<br />

Reference<br />

String<br />

Photo<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

If the logged-in user is following this user, this contains<br />

information about the subscription, else returns null<br />

Locale-based concatenation of first and last names<br />

Information about the user's photos<br />

Title of the user<br />

User<br />

URL to the user's profile<br />

Since Version<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

23.0<br />

Type of user. Valid values are:<br />

26.0<br />

• <strong>Chatter</strong>Guest—User is a <strong>Chatter</strong> customer in an<br />

external group<br />

• Guest—Unauthenticated users<br />

• Internal—User is a standard organization member<br />

• Portal—User is a Customer Portal User, a<br />

<strong>com</strong>munities user, and so on.<br />

• System—User is <strong>Chatter</strong> Expert or a system user<br />

Is User Summary or User Detail Returned?<br />

Whether a User Summary or a User Detail response body is returned depends on the resource that called it, as well as other<br />

variables. The following table describes when which response body is returned.<br />

Resource<br />

Returns user information and is not either<br />

/users and /users/userId (for<br />

example, Batch Results returns a collection<br />

of User Summary response bodies.)<br />

/users and /users/userId<br />

/users<br />

/users and /users/userId<br />

/users/userId<br />

/users/userId<br />

Version<br />

All<br />

All<br />

All<br />

25.0 or earlier<br />

All<br />

All<br />

User Type<br />

All<br />

Internal user<br />

Not internal user<br />

Not internal user<br />

Not internal user and userId<br />

is not the current user<br />

Not internal user and userId<br />

is the current user<br />

Response Body<br />

User Summary<br />

User Detail<br />

User Summary<br />

User Summary<br />

User Summary<br />

User Detail<br />

See Also:<br />

<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Filters<br />

257


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Filters<br />

Response Body Filters<br />

To filter the content of a response body, use the exclude or include query string parameter in a GET request. For example,<br />

you may be creating a mobile application and want to keep response bodies as small as possible.<br />

Exclude<br />

To exclude specific properties from a response body, use the exclude query string parameter.<br />

The value for the exclude query is a list of properties separated by bars (|). You must URL encode the bars as %7C. You<br />

must include a forward slash before each property name.<br />

The following request excludes both the aboutMe and address properties from a response body:<br />

/chatter/users/me?exclude=/aboutMe%7C/address<br />

The following table lists rules for using the exclude query parameter, as well as additional examples.<br />

Description<br />

Original Output<br />

Exclude Value<br />

Filtered Output<br />

Include a forward<br />

slash (/) before<br />

property names or the<br />

{<br />

"bar" : "bar value",<br />

"baz" : "baz value"<br />

}<br />

exclude=bar<br />

400 error with error code<br />

INVALID_FILTER_VALUE<br />

258


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Filters<br />

Description<br />

Original Output<br />

Exclude Value<br />

Filtered Output<br />

request returns an<br />

error.<br />

Filter properties by<br />

name.<br />

{<br />

"bar" : "bar value",<br />

"baz" : "baz value"<br />

}<br />

exclude=/bar<br />

{<br />

"baz" : "baz<br />

value"<br />

}<br />

Top-level properties<br />

cannot be filtered.<br />

Note that this query<br />

string doesn’t return<br />

an error.<br />

<br />

bar value<br />

baz value<br />

<br />

exclude=/foo<br />

<br />

bar value<br />

<br />

baz value<br />

<br />

<br />

Use a bar (|) delimiter<br />

to filter multiple<br />

properties. URL<br />

encode the delimiter<br />

as %7C.<br />

{<br />

"foo" : "foo value",<br />

"bar" : "bar value",<br />

"baz" : "baz value"<br />

}<br />

exclude=/foo%7C/bar<br />

{<br />

"baz" : "baz<br />

value"<br />

}<br />

Filtering a response<br />

body filters everything<br />

in the response body.<br />

<br />

bar value<br />

baz value<br />

<br />

sub 1<br />

<br />

<br />

exclude=/someObject<br />

<br />

bar value<br />

<br />

baz value<br />

<br />

<br />

To filter a property<br />

nested in a response<br />

body, include the<br />

parent response body<br />

name as a filter<br />

segment.<br />

<br />

bar value<br />

baz value<br />

<br />

sub value<br />

<br />

<br />

exclude=/someObject/sub<br />

<br />

bar value<br />

<br />

baz value<br />

<br />

<br />

<br />

<br />

Identify an item in a<br />

list by its property<br />

name. This example<br />

uses XML.<br />

<br />

bar valu<br />

baz value<br />

<br />

<br />

1<br />

<br />

<br />

2<br />

<br />

<br />

3<br />

exclude=/someList/item/id<br />

<br />

bar value<br />

<br />

baz value<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

259


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Filters<br />

Description<br />

Original Output<br />

Exclude Value<br />

Filtered Output<br />

<br />

<br />

<br />

Identify an item in a<br />

list by its property<br />

name. This example<br />

uses JSON.<br />

{<br />

"bar" : "bar value",<br />

"baz" : "baz value",<br />

"someList" : [<br />

{<br />

"id" : "1"<br />

},<br />

{<br />

"id" : "2"<br />

} ,<br />

{<br />

"id" : "3"<br />

}<br />

]<br />

}<br />

exclude=/someList/item/id<br />

{<br />

"bar" : "bar value",<br />

"baz" : "baz value",<br />

"someList" : [<br />

{},<br />

{},<br />

{}<br />

]<br />

}<br />

Include<br />

To limit the response body to specific properties, use the include query string parameter.<br />

The value for the include query string parameter is a list of properties separated by bars (|). You must URL encode the bars<br />

as %7C. Include a forward slash before every property name.<br />

The following request includes only the aboutMe property and the address property in a response body:<br />

/chatter/users/me?include=/aboutMe%7C/address<br />

The following table lists rules for using the include query parameter.<br />

Description<br />

Include a forward<br />

slash (/) before<br />

property names or the<br />

Original Output<br />

{<br />

"bar" : "bar value",<br />

"baz" : "baz value"<br />

}<br />

Include Value<br />

include=bar<br />

Filtered Output<br />

400 error with error code<br />

INVALID_FILTER_VALUE<br />

260


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Filters<br />

Description<br />

Original Output<br />

Include Value<br />

Filtered Output<br />

request returns an<br />

error.<br />

Filter properties by<br />

name.<br />

{<br />

"bar" : "bar value",<br />

"baz" : "baz value"<br />

}<br />

include=/bar<br />

{<br />

"bar" : "bar<br />

value",<br />

}<br />

Top-level properties<br />

are ignored. Note<br />

there is no error when<br />

you try this.<br />

<br />

bar value<br />

baz value<br />

<br />

include=/foo<br />

<br />

bar value<br />

<br />

baz value<br />

<br />

<br />

Use a bar (|) delimiter<br />

to filter multiple<br />

properties. URL<br />

encode the delimiter<br />

as %7C.<br />

{<br />

"foo" : "foo value",<br />

"bar" : "bar value",<br />

"baz" : "baz value"<br />

}<br />

include=/foo%7C/bar<br />

{<br />

"foo" : "foo<br />

value",<br />

"bar" : "bar<br />

value",<br />

}<br />

Filtering a response<br />

body filters everything<br />

below it.<br />

<br />

bar value<br />

baz value<br />

<br />

sub 1<br />

<br />

<br />

include=/someObject<br />

<br />

<br />

sub 1<br />

<br />

<br />

<br />

To filter a property<br />

nested in a response<br />

body, include the<br />

parent response body<br />

name as a filter<br />

segment.<br />

<br />

bar value<br />

baz value<br />

<br />

sub value<br />

<br />

<br />

include=/someObject/sub<br />

<br />

<br />

sub 1<br />

<br />

<br />

<br />

Identify an item in a<br />

list by its property<br />

name. This example<br />

uses XML.<br />

<br />

bar valu<br />

baz value<br />

<br />

<br />

1<br />

<br />

<br />

2<br />

<br />

<br />

3<br />

include=/someList/item/id<br />

<br />

<br />

<br />

1<br />

<br />

<br />

2<br />

<br />

<br />

3<br />

<br />

<br />

261


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Encoding<br />

Description<br />

Original Output<br />

Include Value<br />

Filtered Output<br />

<br />

<br />

<br />

<br />

Identify an item in a<br />

list by its property<br />

name. This example<br />

uses JSON.<br />

{<br />

"bar" : "bar value",<br />

"baz" : "baz value",<br />

"someList" : [<br />

{<br />

"id" : "1"<br />

},<br />

{<br />

"id" : "2"<br />

} ,<br />

{<br />

"id" : "3"<br />

}<br />

]<br />

}<br />

include=/someList/item/id<br />

{<br />

"someList" : [<br />

{<br />

"id" : "1"<br />

},<br />

{<br />

"id" : "2"<br />

} ,<br />

{<br />

"id" : "3"<br />

}<br />

]<br />

}<br />

See Also:<br />

<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Bodies<br />

Response Body Encoding<br />

Response Body Encoding<br />

<strong>Chatter</strong> <strong>API</strong> serves user-submitted content that is often not filtered at input and may <strong>com</strong>e from many different sources<br />

including third-party mobile and web applications. Therefore, developers creating applications that consume <strong>Chatter</strong> <strong>API</strong><br />

output must take care to properly process the output for the context in which they use the data. Failing to do so may expose<br />

their application and their users to Cross Site Scripting (XSS) exploits and other problems that may result in data loss,<br />

application failure and exposure of confidential <strong>com</strong>pany information.<br />

<strong>Chatter</strong> <strong>API</strong> strings are minimally HTML entity encoded by default, which is suitable in most cases for display between<br />

HTML tags, but not necessarily in other HTML contexts.<br />

<strong>Chatter</strong> <strong>API</strong> output may be used in many contexts. Developers should not assume that the default entity encoding is appropriate<br />

for all contexts. In particular, using <strong>Chatter</strong> <strong>API</strong> output inside HTML attribute values, inside URLs, with javascript, inside<br />

script tags and inside CSS all require different encoding and whitelisting. See the Open Web Application Security Project<br />

for information on how to handle <strong>API</strong> output in different contexts.<br />

<strong>Chatter</strong> <strong>API</strong> response returns are encoded on output. We escape the following characters in all strings:<br />

Character<br />

<<br />

Escaped as<br />

&lt;<br />

262


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Status Codes and Error Responses<br />

Character<br />

><br />

"<br />

'<br />

\<br />

&<br />

Escaped as<br />

&gt;<br />

&quot;<br />

&#39;<br />

&#92;<br />

&amp;<br />

For non-HTML contexts, such as native mobile applications, <strong>Chatter</strong> <strong>API</strong> clients may request raw (unencoded) output by<br />

setting the X-<strong>Chatter</strong>-Entity-Encoding HTTP header in your request to false.<br />

<strong>Chatter</strong> <strong>API</strong> does special encoding of any URL values included in response payloads. The main part of the URL is URL-encoded<br />

as per RFC2396, and the query string is HTML-form encoded. This encoding cannot be turned off.<br />

See Also:<br />

<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Filters<br />

Status Codes and Error Responses<br />

Status Codes and Error Responses<br />

Either when an errors occur, or a response is successful, the response header contains an HTTP code, and the response body<br />

usually contains the HTTP response code, the message ac<strong>com</strong>panying that error, and if appropriate, the field or object where<br />

the error occurred.<br />

HTTP Response Code<br />

200<br />

201<br />

204<br />

400<br />

401<br />

403<br />

404<br />

409<br />

500<br />

Description<br />

Success with GET or HEAD request<br />

Success with POST request<br />

Success with DELETE<br />

The request could not be understood, usually because of an invalid ID, such as a userId,<br />

feedItemId, or groupId being incorrect.<br />

The session ID or OAuth token used has expired or is invalid. The response body contains the<br />

message and errorCode.<br />

The request has been refused. Verify that the context user has the appropriate permissions to<br />

access the requested data, or that the context user is not an external user.<br />

Either the specified resource was not found, or the resource has been deleted.<br />

A conflict has occurred. For example, an attempt was made to update a request to join a group,<br />

but that request had already been approved or rejected.<br />

An error has occurred within Force.<strong>com</strong>, so the request could not be <strong>com</strong>pleted. Contact<br />

salesforce.<strong>com</strong> Customer Support.<br />

263


<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Status Codes and Error Responses<br />

HTTP Response Code<br />

503<br />

Description<br />

Too many requests in an hour.<br />

Examples<br />

The following are examples of what is returned for errors.<br />

• Incorrect ID:<br />

Using a non-existent ID in a request using JSON or XML (request_body.json or request_body.xml)<br />

{<br />

}<br />

"fields" : [ "Id" ],<br />

"message" : "User ID: id value of incorrect type: 001900K0001pPuOAAU",<br />

"errorCode" : "MALFORMED_ID"<br />

• Resource does not exist:<br />

Requesting a resource that does not exist, for example, you try to create a record using a misspelled object name<br />

{<br />

}<br />

"message" : "The requested resource does not exist",<br />

"errorCode" : "NOT_FOUND"<br />

See Also:<br />

<strong>Chatter</strong> <strong>API</strong> Resource Returns<br />

Response Body Encoding<br />

264


CONNECT IN APEX<br />

Chapter 7<br />

Getting Started with Connect in Apex<br />

In this chapter ...<br />

• When Should You Use Apex?<br />

• Understanding Connect in Apex<br />

• Primary Differences Between <strong>Chatter</strong><br />

<strong>REST</strong> <strong>API</strong> and Connect in Apex<br />

• Testing Connect in Apex<br />

• Map Relating <strong>Chatter</strong> <strong>API</strong> Resources<br />

to Apex Methods<br />

Note: Connect in Apex is currently available as a Developer Preview<br />

in all Developer Editions. For information on enabling Connect in Apex<br />

in other editions, contact salesforce.<strong>com</strong>.<br />

In addition to using <strong>Chatter</strong> <strong>API</strong> as a <strong>REST</strong> <strong>API</strong>, you can also access the <strong>Chatter</strong><br />

<strong>API</strong> resources using Force.<strong>com</strong> Apex Code, <strong>Database</strong>.<strong>com</strong>’s premier programming<br />

language.<br />

Apex is a strongly typed, object-oriented programming language that allows<br />

developers to execute flow and transaction control statements on <strong>Database</strong>.<strong>com</strong><br />

in conjunction with calls to the Force.<strong>com</strong> <strong>API</strong>. Using syntax that looks like Java<br />

and acts like database stored procedures, Apex enables developers to add business<br />

logic to most system events. Apex code can be initiated by Web service requests<br />

and from triggers on objects.<br />

This chapter contains the following:<br />

• Understanding when to use Apex as opposed to <strong>REST</strong>.<br />

• The key characteristics of Connect in Apex.<br />

• The Connect in Apex reference material.<br />

For more information about Apex, see the Force.<strong>com</strong> Apex Code <strong>Developer's</strong> <strong>Guide</strong>.<br />

265


Getting Started with Connect in Apex<br />

When Should You Use Apex?<br />

When Should You Use Apex?<br />

<strong>Chatter</strong> <strong>API</strong> as a <strong>REST</strong> <strong>API</strong> is generally used by third-party vendors or ISVs who want to create apps that integrate <strong>Chatter</strong><br />

data and third-party sites, or applications.<br />

Use Connect in Apex when you’re developing native applications in Apex and Visualforce. Connect in Apex makes it easy to<br />

post feed items with mentions, update user or group photos, or make social Visualforce pages.<br />

See Also:<br />

Getting Started with Connect in Apex<br />

Understanding Connect in Apex<br />

In Apex, it is possible to access some <strong>Chatter</strong> data using SOQL queries and objects. Connect in Apex exposes <strong>Chatter</strong> data<br />

in a much simpler way. For example, instead of having to do many calls to access and assemble a feed, using Connect in Apex<br />

you can do it with a single method call.<br />

In <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>, <strong>Chatter</strong> data is exposed as resources addressed by URLs, which are arranged in a hierarchy, such as:<br />

/chatter/groups/<br />

/chatter/groups/groupId<br />

/chatter/groups/groupId/members<br />

And<br />

/chatter/users/<br />

/chatter/users/userId<br />

/chatter/users/userId/followers<br />

In Connect in Apex, <strong>Chatter</strong> data is exposed as objects in the ConnectApi namespace. These objects are passed in and<br />

retrieved from calls to static methods found in the following classes:<br />

Class Name<br />

<strong>Chatter</strong><br />

<strong>Chatter</strong>Favorites<br />

<strong>Chatter</strong>Feeds<br />

<strong>Chatter</strong>Groups<br />

Description<br />

Use this class to access information about followers and<br />

subscriptions for records.<br />

Use this class to add, get, update, and delete <strong>Chatter</strong> favorites.<br />

Use this class to access and modify feeds and feed data. This<br />

includes accessing, adding, and deleting feed items, as well as<br />

likes, <strong>com</strong>ments, and bookmarks. You can also use this class<br />

to search feed items.<br />

Use this class to access information about groups, such as the<br />

group’s members, photo, and the groups the specified user is<br />

following. Also use this class to add members to a group,<br />

remove members, and change the group photo.<br />

266


Getting Started with Connect in Apex<br />

Primary Differences Between <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> and Connect<br />

in Apex<br />

Class Name<br />

<strong>Chatter</strong>Users<br />

Description<br />

Use this class to access information about the user, such as<br />

who is following the user, the user’s subscriptions, files, and<br />

groups.<br />

Note: At this time, not all of the <strong>Chatter</strong> <strong>API</strong> resources are available in Connect in Apex, for example, private<br />

messaging, files, re<strong>com</strong>mendations, and topics are not available.<br />

Call static methods in these classes to retrieve <strong>Chatter</strong> data. For example, performing a GET against the following <strong>Chatter</strong><br />

<strong>REST</strong> <strong>API</strong> URL:<br />

/chatter/groups/groupId<br />

is equivalent to making the following Connect in Apex method call:<br />

ConnectApi.<strong>Chatter</strong>Groups.getGroup(<strong>com</strong>munityId, groupId);<br />

You can also update <strong>Chatter</strong> data using Connect in Apex. This sort of method is the equivalent of a <strong>REST</strong> POST, PATCH,<br />

or PUT. For example, the following adds a <strong>com</strong>ment to the specified feed item:<br />

ConnectApi.<strong>Chatter</strong>Feeds.postComment(null, '0D5B0000000KBeg', 'Text of <strong>com</strong>ment');<br />

As with a <strong>REST</strong> DELETE, if you call one of the Connect in Apex delete methods, if the item has already been deleted, you<br />

won’t receive an exception.<br />

When an organization tries to install a package that contains Connect in Apex code, it must have the correct permissions for<br />

the package to install without error. For example, Connect in Apex is available only in editions where Apex is available. In<br />

addition, <strong>Chatter</strong> must be enabled.<br />

See Also:<br />

Getting Started with Connect in Apex<br />

Primary Differences Between <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> and Connect in Apex<br />

Request bodies and parameters versus input classes<br />

In <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>, you can specify either request parameters or a request body with the request, to add additional<br />

information.<br />

In Connect in Apex, methods take either simple or <strong>com</strong>plex types. Simples types are primitive Apex data types that<br />

correspond to <strong>Chatter</strong> <strong>API</strong> request parameters. Complex types are ConnectApi object data types that correspond to<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> request bodies. Connect in Apex <strong>com</strong>plex types are called input objects.<br />

Response bodies versus response objects<br />

In <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>, a successful request can return either an XML or JSON response body.<br />

267


Getting Started with Connect in Apex<br />

Primary Differences Between <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> and Connect<br />

in Apex<br />

In Connect in Apex, successful execution of a method can return an output object from the ConnectApi namespace.<br />

ConnectApi output objects can be made up of other output objects. For example, ActorWithId contains simple<br />

properties such as id and url, and also a sub-object, reference.<br />

CommunityId Parameters<br />

Note: Communities are available as a pilot program.<br />

All Connect in Apex methods include <strong>com</strong>munityId as the first parameter. Use null for this parameter.<br />

If you specify null, URLs returned in the output use one of these formats:<br />

/chatter/resource<br />

/connect/resource<br />

Transactional model<br />

Apex follows a different model than <strong>REST</strong>. Using <strong>REST</strong>, when a request is successful, changes to the database are<br />

applied immediately.<br />

Apex uses a transactional model. All requests are delimited by the trigger, class method, Web Service, or anonymous<br />

block that executes the Apex code. If the entire request <strong>com</strong>pletes successfully, all changes are <strong>com</strong>mitted to the database.<br />

If the request does not <strong>com</strong>plete successfully, all database changes are rolled back.<br />

Governor Limits<br />

Every Connect in Apex write operation costs 1 DML statement against the Apex governor limits.<br />

Rate Limits<br />

Connect in Apex method calls are subject to rate limiting. Connect in Apex rate limits match <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> rate<br />

limits. Both have a per user, per namespace, per hour rate limit. Managed packages (which use namespaces) have their<br />

own limits that are separate from the limits for code that doesn’t use a namespace.<br />

When you exceed the rate limit, a ConnectApi.RateLimitException is thrown. Your Apex must catch and handle<br />

this exception.<br />

A call to the Apex Test.startTest method starts a new rate limit. A call to the Test.stopTest method sets your<br />

rate limit to the value it was before you called Test.startTest.<br />

Serialization and deserialization<br />

JSON serialization of ConnectApi output objects produces JSON with the same structure as JSON returned from<strong>Chatter</strong><br />

<strong>API</strong>. JSON deserialization of ConnectApi input objects uses the same format as JSON deserialization in <strong>Chatter</strong> <strong>API</strong>.<br />

Connect in Apex supports serialization and deserialization in the following Apex contexts:<br />

• JSON and JSONParser classes—serialize Connect in Apex outputs to JSON and deserialize Connect in Apex inputs<br />

from JSON.<br />

• Apex <strong>REST</strong> with @RestResource—serialize Connect in Apex outputs to JSON as return values and deserialize<br />

Connect in Apex inputs from JSON as parameters.<br />

• JavaScript Remoting with @RemoteAction—serialize Connect in Apex outputs to JSON as return values and<br />

deserialize Connect in Apex inputs from JSON as parameters.<br />

268


Getting Started with Connect in Apex<br />

Primary Differences Between <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> and Connect<br />

in Apex<br />

Connect in Apex follows these rules for serialization and deserialization:<br />

• Only output objects can be serialized.<br />

• Only top-level input objects can be deserialized. Currently, the only top-level objects that can be deserialized are<br />

FeedItemInput and CommentInput.<br />

• Enum values and exceptions cannot be serialized or deserialized.<br />

System mode vs. context user<br />

Unless otherwise specified, Apex runs in system mode, and the permissions, field-level security, and sharing rules of the<br />

current user are not taken into account.<br />

However, Connect in Apex code does not run in system mode. Like <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>, Connect in Apex methods<br />

run under the context of the current user. What the current user has access to is what the code has access to.<br />

When a user is specified with a method, frequently the subjectId must be the same as the context user. You can use<br />

the string me to specify the context user instead of an Id.<br />

User Summary vs. User Detail Outputs<br />

Some methods typed to return ConnectApi.UserSummary objects may instead return instances of<br />

ConnectApi.UserDetail. What gets returned depends on whether the context user is an internal user or not. You<br />

can use the instanceof keyword to check the class at runtime. The following table describes which object type is<br />

returned in various contexts:<br />

Method<br />

Returns user information and is not either<br />

getUser or getUsers (for example,<br />

searchUsers returns a collection of<br />

UserSummary objects.)<br />

getUser or getUsers<br />

getUsers<br />

getUser<br />

getUser<br />

User<br />

Any<br />

Internal user<br />

Not internal user<br />

Not internal user and userId is<br />

not the current user<br />

Not internal user and userId is<br />

the current user<br />

Object Type<br />

UserSummary<br />

UserDetail<br />

UserSummary<br />

UserSummary<br />

UserDetail<br />

Versioning<br />

Versioning for Connect in Apex follows these rules:<br />

• A Connect in Apex method call executes in the context of the version of the class that contains the method call. The<br />

use of version is analogous to the /vXX.X section of a <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL.<br />

• If a Connect in Apex method returns an output object, that object exposes a getBuildVersion method. This<br />

method returns the version under which the method that created the output object was invoked.<br />

• When interacting with input objects, Apex can access only properties supported by the version of the enclosing Apex<br />

class.<br />

269


Getting Started with Connect in Apex<br />

Primary Differences Between <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> and Connect<br />

in Apex<br />

• Input objects passed to a Connect in Apex method may contain only non-null properties that are supported by the<br />

version of the Apex class executing the method. If the input object contains version-inappropriate properties, an<br />

exception is thrown.<br />

• The toString method only returns properties that are supported in the version of the code interacting with the<br />

object. For output objects, the returned properties must also be supported in the build version.<br />

• Apex <strong>REST</strong>, JSON.serialize, and @RemoteAction serialization match <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> serialization, which<br />

includes only version-appropriate properties.<br />

• Apex <strong>REST</strong>, JSON.deserialize, and @RemoteAction deserialization match <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> deserialization,<br />

which rejects properties that are version-inappropriate.<br />

Equality<br />

Casting<br />

Equality checking for Connect in Apex follows these rules:<br />

Input objects—properties are <strong>com</strong>pared.<br />

Output objects—properties and build versions are <strong>com</strong>pared. For example, if two objects have the same properties with<br />

the same values but have different build versions, the objects are not equal. To get the build version, call<br />

getBuildVersion.<br />

It may be useful to downcast some Connect in Apex output objects to a more specific type.<br />

This technique is especially useful for message segments and feed item attachments. Message segments are typed as<br />

ConnectApi.MessageSegment. Feed item attachments are typed as ConnectApi.FeedItemAttachment.<br />

At runtime you can use instanceof to check the concrete types of these objects and then safely proceed with the<br />

corresponding downcast. The following example downcasts a ConnectApi.MessageSegment to a<br />

ConnectApi.MentionSegment:<br />

(segment instanceof ConnectApi.MentionSegment) {<br />

ConnectApi.MentionSegment = (ConnectApi.MentionSegment)segment;<br />

}<br />

Limitations Using Connect in Apex<br />

The following are limitations when using Connect in Apex:<br />

• with sharing and without sharing keyword—These keywords are ignored by Connect in Apex code. Instead, all<br />

security, field level sharing, and visibility is controlled by the context user. For example, if a context user is a member of a<br />

private group, Connect in Apex code can post to that group. If the context user is not a member of a private group, the<br />

code can’t see the feed items for that group and cannot post to the group.<br />

• Testing—Connect in Apex method calls generally require access to real organization data, and fail if used in test methods<br />

not marked @IsTest(SeeAllData=true). Some Connect in Apex methods, such as getFeedItemsFromFeed,<br />

getFeedItemsFromFilterFeed, and searchFeedItemsInFeed are not permitted to access organization data in<br />

tests and must be used in conjunction with test methods that register values to be returned from these methods when<br />

executed within test code.<br />

• Some Connect in Apex operations are asynchronous, that is, they don’t occur immediately. For example, if your code adds<br />

a feed item for a user, it is not immediately available in the news feed. Another example: when you add a photo, it is not<br />

available immediately. For testing, this means that if you add a photo, you can’t retrieve it immediately.<br />

• In Apex <strong>REST</strong>, XML serialization and deserialization of Connect in Apex objects is not supported.<br />

270


Getting Started with Connect in Apex<br />

Testing Connect in Apex<br />

• Some Connect in Apex objects, such as FeedItem and other objects that overlap with sObject names, cannot currently<br />

be used as attributes in Visualforce <strong>com</strong>ponents. A possible workaround is to pass around other objects that wrap the<br />

Connect in Apex objects.<br />

• The log entries for Connect in Apex objects are currently empty. To get a serialization of version-appropriate properties<br />

that can be used for logging, call toString on objects.<br />

• Connect in Apex objects cannot be used in Apex SOAP Web services indicated with the keyword webservice.<br />

See Also:<br />

Getting Started with Connect in Apex<br />

Testing Connect in Apex<br />

Connect in Apex method calls generally require access to real organization data, and fail if used in test value registration<br />

methods not marked @IsTest(SeeAllData=true). Some Connect in Apex methods, such as getFeedItemsFromFeed,<br />

getFeedItemsFromFilterFeed, and searchFeedItemsInFeed are not permitted to access organization data in tests<br />

and must be used in conjunction with special methods that register outputs to be returned in a test context.<br />

Using Connect in Apex test methods is similar to testing Web services in Apex. First, build the data you expect the associated<br />

get method to return. Then call the associated test method to register the data with a specific parameter <strong>com</strong>bination. When<br />

you run the get method associated with the test method, a value that was registered with the test method is returned.<br />

The following shows which methods are associated with which test methods.<br />

Get Method<br />

getFeedItemsFromFeed<br />

getFeedItemsFromFilterFeed<br />

searchFeedItemsInFeed<br />

Associated Test Method<br />

setTestGetFeedItemsFromFeed<br />

setTestGetFeedItemsFromFilterFeed<br />

setTestSearchFeedItemsInFeed<br />

Important: In a test, invoke these test methods only for parameter <strong>com</strong>binations that you have registered return<br />

values with in test method calls. If a given parameter <strong>com</strong>bination does not have a return value registered, you receive<br />

an assertion.<br />

The following example shows a test that constructs an ConnectApi.FeedItemPage and registers it to be returned when<br />

getFeedItemsFromFeed is called with a particular <strong>com</strong>bination of parameters.<br />

global class TestController {<br />

global static Integer getNewsFeedCount() {<br />

ConnectApi.FeedItemPage items = ConnectApi.<strong>Chatter</strong>Feeds.getFeedItemsFromFeed(null,<br />

}<br />

ConnectApi.FeedType.News, 'me');<br />

return items.items.size();<br />

@IsTest<br />

global static void doTest() {<br />

// Build a simple feed item<br />

ConnectApi.FeedItemPage testPage = new ConnectApi.FeedItemPage();<br />

List testItemList = new List();<br />

271


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

}<br />

}<br />

testItemList.add(new ConnectApi.FeedItem());<br />

testItemList.add(new ConnectApi.FeedItem());<br />

testPage.items = testItemList;<br />

// Set the test data<br />

ConnectApi.<strong>Chatter</strong>Feeds.setTestGetFeedItemsFromFeed(null,<br />

ConnectApi.FeedType.News, 'me', testPage);<br />

// The method returns the test page, which we know has two items in it<br />

System.assertEquals(getNewsFeedCount(), 2);<br />

In tests, you are allowed to use no-argument constructors for any non-abstract output classes, and to set the properties on<br />

these objects. This is useful for both testing your own code, and for making values to pass to these test methods.<br />

See Also:<br />

Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

The following maps Connect in Apex methods to the equivalent <strong>Chatter</strong> <strong>API</strong> resource and HTTP method.<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

/chatter/records/recordId/followers<br />

HTTP method: GET<br />

/chatter/subscriptions/subscriptionId<br />

HTTP method: DELETE<br />

/chatter/subscriptions/subscriptionId<br />

HTTP method: GET<br />

/chatter/feeds/favorites/me | userId<br />

HTTP method: GET<br />

/chatter/feeds/favorites/me | userId<br />

HTTP method: POST<br />

/chatter/feeds/favorites/me |<br />

userId/favoriteId<br />

HTTP method: DELETE<br />

Apex Methods<br />

<strong>Chatter</strong>.getFollowers( String <strong>com</strong>munityId,<br />

String recordId )<br />

<strong>Chatter</strong>.getFollowers( String <strong>com</strong>munityId,<br />

String recordId, Integer pageParam, Integer<br />

pageSize )<br />

<strong>Chatter</strong>.deleteSubscription(String <strong>com</strong>munityId,<br />

String subscriptionId )<br />

<strong>Chatter</strong>.getSubscription( String <strong>com</strong>munityId,<br />

String subscriptionId )<br />

<strong>Chatter</strong>Favorites.getFavorites( String<br />

<strong>com</strong>munityId, String subjectId )<br />

<strong>Chatter</strong>Favorites.addFavorite( String<br />

<strong>com</strong>munityId, String subjectId, String<br />

searchText )<br />

<strong>Chatter</strong>Favorites.deleteFavorite(String<br />

<strong>com</strong>munityId, String subjectId, String<br />

favoriteId )<br />

272


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

/chatter/feeds/favorites/me |<br />

userId/favoriteId<br />

HTTP method: GET<br />

/chatter/feeds/favorites/me |<br />

userId/favoriteId<br />

HTTP method: PATCH<br />

/chatter/feeds/favorites/me |<br />

userId/favoriteId/feed-items<br />

HTTP method: GET<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId/<br />

HTTP method: DELETE<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId<br />

HTTP method: GET<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId/likes<br />

HTTP method: GET<br />

/chatter/<strong>com</strong>ments/<strong>com</strong>mentId/likes<br />

HTTP method: POST<br />

Apex Methods<br />

<strong>Chatter</strong>Favorites.getFavorite( String<br />

<strong>com</strong>munityId, String subjectId, String<br />

favoriteId )<br />

<strong>Chatter</strong>Favorites.updateFavorite( String<br />

<strong>com</strong>munityId, String subjectId, String<br />

favoriteId, Boolean updateLastViewDate )<br />

<strong>Chatter</strong>Favorites.getFeedItems( String<br />

<strong>com</strong>munityId, String subjectId, String<br />

favoriteId )<br />

<strong>Chatter</strong>Favorites.getFeedItems( String<br />

<strong>com</strong>munityId, String subjectId, String<br />

favoriteId, String pageParam, Integer<br />

pageSize, FeedSortOrder sortParam )<br />

<strong>Chatter</strong>Feeds.deleteComment(String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId )<br />

<strong>Chatter</strong>Feeds.getComment( String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId)<br />

<strong>Chatter</strong>Feeds.getLikesForComment( String<br />

<strong>com</strong>munityId, String <strong>com</strong>mentId )<br />

<strong>Chatter</strong>Feeds.getLikesForComment( String<br />

<strong>com</strong>munityId, String <strong>com</strong>mentId, Integer<br />

pageParam, Integer pageSize )<br />

<strong>Chatter</strong>Feeds.likeComment( String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId )<br />

/chatter/feeds/feedType<br />

HTTP method: GET<br />

Where feedType can be any type of feed, such as Bookmarks,<br />

News, Records, and so on.<br />

/chatter/feeds/feedType/me | userid/<br />

HTTP method: GET<br />

Where feedType can be any type of feed, such as Bookmarks,<br />

News, Records, and so on.<br />

<strong>Chatter</strong>Feeds.getFeed( String <strong>com</strong>munityId,<br />

ConnectApi.FeedType feedType )<br />

<strong>Chatter</strong>Feeds.getFeed( String <strong>com</strong>munityId,<br />

ConnectApi.FeedType feedType<br />

ConnectApi.SortOrder sortParam)<br />

<strong>Chatter</strong>Feeds.getFeed( String <strong>com</strong>munityId,<br />

ConnectApi.FeedType feedType, String subjectId<br />

)<br />

<strong>Chatter</strong>Feeds.getFeed( String <strong>com</strong>munityId,<br />

ConnectApi.FeedType feedType, String<br />

subjectId, ConnectApi.SortOrder sortParam)<br />

273


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

Apex Methods<br />

/chatter/feeds/feedType/feed-items<br />

HTTP method: GET<br />

Where feedType can be any type of feed, such as Bookmarks,<br />

News, Records, and so on.<br />

/chatter/feeds/feedType/feed-items<br />

HTTP method: GET<br />

Where feedType can be any type of feed, such as Bookmarks,<br />

News, Records, and so on.<br />

/chatter/feeds/feedType/feed-items/subjectId<br />

HTTP method: GET<br />

Where feedType can be any type of feed, such as Bookmarks,<br />

News, Records, and so on.<br />

<strong>Chatter</strong>Feeds.getFeedItemsFromFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType )<br />

<strong>Chatter</strong>Feeds.getFeedItemsFromFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String pageParam, Integer pageSize,<br />

ConnectApi.FeedSortOrder sortParam )<br />

<strong>Chatter</strong>Feeds.searchFeedItemsInFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String q)<br />

<strong>Chatter</strong>Feeds.searchFeedItemsInFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String subjectId, String q)<br />

<strong>Chatter</strong>Feeds.searchFeedItemsInFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String pageParam, Integer pageSize,<br />

ConnectApi.FeedSortOrder sortParam, String q)<br />

<strong>Chatter</strong>Feeds.searchFeedItemsInFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String subjectId, String pageParam, Integer<br />

pageSize, ConnectApi.FeedSortOrder sortParam,<br />

String q)<br />

<strong>Chatter</strong>Feeds.getFeedItemsFromFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String subjectId )<br />

<strong>Chatter</strong>Feeds.getFeedItemsFromFeed( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String subjectId, String pageParam, Integer<br />

pageSize, ConnectApi.FeedSortOrder sortParam<br />

)<br />

/chatter/feeds/filter/subjectId/keyPrefix<br />

HTTP method GET<br />

<strong>Chatter</strong>Feeds.getFilterFeed ( String<br />

<strong>com</strong>munityId, IDsubjectId, string keyPrefix)<br />

<strong>Chatter</strong>Feeds.getFilterFeed ( String<br />

<strong>com</strong>munityId, IDsubjectId, string keyPrefix,<br />

ConnectApi.FeedSortOrder sortParam )<br />

/chatter/feeds/filter/subjectId/keyPrefix/feed-items<br />

HTTP method GET<br />

<strong>Chatter</strong>Feeds.getFeedItemsFromFilterFeed (<br />

String <strong>com</strong>munityId, IDsubjectId, string<br />

keyPrefix)<br />

<strong>Chatter</strong>Feeds.getFeedItemsFromFilterFeed (<br />

String <strong>com</strong>munityId, IDsubjectId, string<br />

keyPrefix, String pageParam, Integer pageSize,<br />

ConnectApi.FeedSortOrder sortParam )<br />

274


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

/chatter/feed-items/feedItemId/poll<br />

HTTP method GET and PATCH<br />

Apex Methods<br />

<strong>Chatter</strong>Feeds.getFeedPoll( String <strong>com</strong>munityId,<br />

IDfeedItemId )<br />

<strong>Chatter</strong>Feeds.voteOnFeedPoll( String<br />

<strong>com</strong>munityId, IDfeedItemId, String myChoiceId)<br />

/chatter/feeds/feedType/me | userid/feed-items<br />

HTTP method: POST<br />

Where feedType can be any type of feed, such as Bookmarks,<br />

News, Records, and so on.<br />

<strong>Chatter</strong>Feeds.shareFeedItem( String<br />

<strong>com</strong>munityId, ConnectApi.FeedType feedType,<br />

String subjectId, String originalFeedItemId )<br />

<strong>Chatter</strong>Feeds.postFeedItem( String <strong>com</strong>munityId,<br />

ConnectApi.FeedType feedType, String<br />

subjectId, String text)<br />

<strong>Chatter</strong>Feeds.postFeedItem( String <strong>com</strong>munityId,<br />

ConnectApi.FeedType feedType,String subjectId,<br />

ConnectApi.FeedItemInput feedItem,<br />

ConnectApi.BinaryInput feedItemFileUpload )<br />

/chatter/feed-items<br />

HTTP method: GET<br />

/chatter/feed-items/feedItemId<br />

HTTP method: PATCH<br />

/chatter/feed-items/feedItemId/<strong>com</strong>ments<br />

HTTP method: GET<br />

/chatter/feed-items/feedItemId/<strong>com</strong>ments<br />

HTTP method: POST<br />

/chatter/feed-items/feedItemId/likes<br />

HTTP method: GET<br />

/chatter/feed-items/feedItemId/likes<br />

HTTP method: POST<br />

<strong>Chatter</strong>Feeds.searchFeedItems( String<br />

<strong>com</strong>munityId, String q )<br />

<strong>Chatter</strong>Feeds.searchFeedItems( String<br />

<strong>com</strong>munityId, String q, String pageParam,<br />

Integer pageSize )<br />

<strong>Chatter</strong>Feeds.updateBookmark( String<br />

<strong>com</strong>munityId, String feedItemId, Boolean<br />

isBookmarkedByCurrentUser )<br />

<strong>Chatter</strong>Feeds.getCommentsForFeedItem( String<br />

<strong>com</strong>munityId, String feedItemId )<br />

<strong>Chatter</strong>Feeds.getCommentsForFeedItem( String<br />

<strong>com</strong>munityId, String feedItemId, String<br />

pageParam, Integer pageSize )<br />

<strong>Chatter</strong>Feeds.postComment( String <strong>com</strong>munityId,<br />

String feedItemId, String text )<br />

<strong>Chatter</strong>Feeds.postComment( String <strong>com</strong>munityId,<br />

String feedItemId, ConnectApi.CommentInput<br />

<strong>com</strong>ment, ConnectApi.BinaryInput<br />

feedItemFileUpload )<br />

<strong>Chatter</strong>Feeds.getLikesForFeedItem( String<br />

<strong>com</strong>munityId, String feedItemId )<br />

<strong>Chatter</strong>Feeds.getLikesForFeedItem( String<br />

<strong>com</strong>munityId, String feedItemId, Integer<br />

pageParam, Integer pageSize )<br />

<strong>Chatter</strong>Feeds.likeFeedItem( String <strong>com</strong>munityId,<br />

String feedItemId )<br />

275


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

/chatter/feed-items/feedItemId<br />

HTTP method: DELETE<br />

/chatter/feeds/news/me | userId/is-modified<br />

HTTP method: GET<br />

/chatter/likes/likeId<br />

HTTP method: DELETE<br />

/chatter/likes/likeId<br />

HTTP method: GET<br />

/chatter/group-membership-requests/requestId<br />

HTTP method: GET<br />

/chatter/groups/groupId/members/requests<br />

HTTP method: GET<br />

/chatter/groups/groupId/members/requests<br />

HTTP method: PATCH<br />

/chatter/groups/groupId/my-settings<br />

HTTP method: GET<br />

/chatter/groups/groupId/my-settings<br />

HTTP method: PATCH<br />

/chatter/groups<br />

HTTP method: GET<br />

Apex Methods<br />

<strong>Chatter</strong>Feeds.deleteFeedItem( String<br />

<strong>com</strong>munityId, String feedItemId )<br />

<strong>Chatter</strong>Feeds.isModified( String <strong>com</strong>munityId,<br />

Enum FeedType feedType, String subjectId,<br />

String since)<br />

<strong>Chatter</strong>Feeds.deleteLike (String <strong>com</strong>munityId,<br />

String likeId )<br />

<strong>Chatter</strong>Feeds.getLike (String <strong>com</strong>munityId,<br />

String likeId)<br />

<strong>Chatter</strong>Groups.getMembershipRequest (String<br />

<strong>com</strong>munityId, String groupId)<br />

<strong>Chatter</strong>Groups.getMembershipRequests (String<br />

<strong>com</strong>munityId, String groupId)<br />

<strong>Chatter</strong>Groups.getMembershipRequests (String<br />

<strong>com</strong>munityId, String groupId,<br />

ConnectApi.GroupMembershipRequestStatus<br />

status)<br />

<strong>Chatter</strong>Groups.requestMembershipRequest<br />

(String <strong>com</strong>munityId, String groupId)<br />

<strong>Chatter</strong>Groups.getMy<strong>Chatter</strong>Settings (String<br />

<strong>com</strong>munityId, String groupId)<br />

<strong>Chatter</strong>Groups.updateMy<strong>Chatter</strong>Settings (String<br />

<strong>com</strong>munityId, String groupId,<br />

ConnectApi.GroupEmailFrequency emailFrequency)<br />

<strong>Chatter</strong>Groups.getGroups( String <strong>com</strong>munityId)<br />

<strong>Chatter</strong>Groups.getGroups( String <strong>com</strong>munityId,<br />

Integer pageParam, Integer pageSize )<br />

<strong>Chatter</strong>Groups.searchGroups( String<br />

<strong>com</strong>munityId, String q )<br />

<strong>Chatter</strong>Groups.searchGroups( String<br />

<strong>com</strong>munityId, String q, Integer pageParam,<br />

Integer pageSize )<br />

/chatter/groups/groupId<br />

HTTP method: GET<br />

<strong>Chatter</strong>Groups.getGroup( String <strong>com</strong>munityId,<br />

String groupId )<br />

276


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

/chatter/groups/groupId/members<br />

HTTP method: GET<br />

/chatter/groups/groupId/members<br />

HTTP method: POST<br />

/chatter/groups/groupId/photo<br />

HTTP method: DELETE<br />

/chatter/groups/groupId/photo<br />

HTTP method: GET<br />

/chatter/groups/groupId/photo<br />

HTTP method: POST<br />

Apex Methods<br />

<strong>Chatter</strong>Groups.getMembers( String <strong>com</strong>munityId,<br />

String groupId )<br />

<strong>Chatter</strong>Groups.getMembers( String <strong>com</strong>munityId,<br />

String groupId, Integer pageParam, Integer<br />

pageSize )<br />

<strong>Chatter</strong>Groups.addMember( String <strong>com</strong>munityId,<br />

String groupId, String userId )<br />

<strong>Chatter</strong>Groups.deletePhoto( String <strong>com</strong>munityId,<br />

String groupId )<br />

<strong>Chatter</strong>Groups.getPhoto(String <strong>com</strong>munityId,<br />

String groupId )<br />

<strong>Chatter</strong>Groups.setPhoto( String <strong>com</strong>munityId,<br />

String groupId, String fileId, Integer<br />

versionNumber )<br />

<strong>Chatter</strong>Groups.setPhoto( String <strong>com</strong>munityId,<br />

String groupId, ConnectApi.BinaryInput<br />

fileUpload )<br />

/chatter/group-memberships/membershipId<br />

HTTP method: DELETE<br />

/chatter/group-memberships/membershipId<br />

HTTP method: GET<br />

/chatter/users<br />

HTTP method: GET<br />

<strong>Chatter</strong>Groups.deleteMember(String <strong>com</strong>munityId,<br />

String membershipId )<br />

<strong>Chatter</strong>Groups.getMember( String <strong>com</strong>munityId,<br />

String membershipId )<br />

<strong>Chatter</strong>Users.getUsers( String <strong>com</strong>munityId)<br />

<strong>Chatter</strong>Users.getUsers( String <strong>com</strong>munityId,<br />

Integer pageParam, Integer pageSize )<br />

<strong>Chatter</strong>Users.searchUsers( String <strong>com</strong>munityId,<br />

String q )<br />

<strong>Chatter</strong>Users.searchUsers( String <strong>com</strong>munityId,<br />

String q, Integer pageParam, Integer pageSize<br />

)<br />

/chatter/users/me | userId<br />

HTTP method: GET<br />

/chatter/users/me | userId/followers<br />

HTTP method: GET<br />

<strong>Chatter</strong>Users.getUser(String <strong>com</strong>munityId,<br />

String userId )<br />

<strong>Chatter</strong>Users.getFollowers(String <strong>com</strong>munityId,<br />

String userId )<br />

<strong>Chatter</strong>Users.getFollowers( String <strong>com</strong>munityId,<br />

String userId, Integer pageParam, Integer<br />

pageSize )<br />

277


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

/chatter/users/me | userId/following<br />

HTTP method: GET<br />

Apex Methods<br />

<strong>Chatter</strong>Users.getFollowings( String<br />

<strong>com</strong>munityId, String userId )<br />

<strong>Chatter</strong>Users.getFollowings( String<br />

<strong>com</strong>munityId, String userId Integer pageParam)<br />

<strong>Chatter</strong>Users.getFollowings( String<br />

<strong>com</strong>munityId, String userId, Integer pageParam,<br />

Integer pageSize)<br />

<strong>Chatter</strong>Users.getFollowings( String<br />

<strong>com</strong>munityId, String userId, String filterType<br />

)<br />

<strong>Chatter</strong>Users.getFollowings( String<br />

<strong>com</strong>munityId, String userId, String filterType,<br />

Integer pageParam)<br />

<strong>Chatter</strong>Users.getFollowings( String<br />

<strong>com</strong>munityId, String userId, String filterType,<br />

Integer pageParam, Integer pageSize)<br />

/chatter/users/me | userId/following<br />

HTTP method: POST<br />

/chatter/users/me | userId/groups<br />

HTTP method: GET<br />

/chatter/users/me | userId/photo<br />

HTTP method: DELETE<br />

/chatter/users/me | userId/photo<br />

HTTP method: GET<br />

/chatter/users/me | userId/photo<br />

HTTP method: POST<br />

<strong>Chatter</strong>Users.follow( String <strong>com</strong>munityId,<br />

String userId, String subjectId )<br />

<strong>Chatter</strong>Users.getGroups( String <strong>com</strong>munityId,<br />

String userId )<br />

<strong>Chatter</strong>Users.getGroups( String <strong>com</strong>munityId,<br />

String userId, Integer pageParam, Integer<br />

pageSize )<br />

<strong>Chatter</strong>Users.deletePhoto(String <strong>com</strong>munityId,<br />

String userId )<br />

<strong>Chatter</strong>Users.getPhoto( String <strong>com</strong>munityId,<br />

String userId )<br />

<strong>Chatter</strong>Users.setPhoto( String <strong>com</strong>munityId,<br />

String userId, String fileId, Integer<br />

versionNumber )<br />

<strong>Chatter</strong>Users.setPhoto( String <strong>com</strong>munityId,<br />

String userId, ConnectApi.BinaryInput<br />

fileUpload )<br />

/chatter/users/me | userId/settings<br />

HTTP method: GET<br />

/chatter/users/me | userId/settings<br />

HTTP method: PATCH<br />

<strong>Chatter</strong>Users.get<strong>Chatter</strong>Settings( String<br />

<strong>com</strong>munityId, String userId)<br />

<strong>Chatter</strong>Users.update<strong>Chatter</strong>Settings( String<br />

<strong>com</strong>munityId, String userId,<br />

ConnectApi.GroupEmailFrequency<br />

defaultGroupEmailFrequency )<br />

278


Getting Started with Connect in Apex<br />

Map Relating <strong>Chatter</strong> <strong>API</strong> Resources to Apex Methods<br />

<strong>Chatter</strong> <strong>API</strong> Resources<br />

/connect/motifs/idOrPrefix<br />

HTTP method: GET<br />

Apex Methods<br />

Records.getMotif( String <strong>com</strong>munityId, String<br />

idOrPrefix)<br />

See Also:<br />

Getting Started with Connect in Apex<br />

279


Chapter 8<br />

Connect in Apex <strong>API</strong> Reference<br />

In this chapter ...<br />

In <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong>, you send requests to resources, and get a response in<br />

return. In Connect in Apex, the operations exposed by <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

• <strong>Chatter</strong> Class resources are made available through static methods in classes. Input and output<br />

• <strong>Chatter</strong>Favorites Class data is provided in objects. All Connect in Apex classes are found in the<br />

• <strong>Chatter</strong>Feeds Class<br />

ConnectApi namespace.<br />

• <strong>Chatter</strong>Groups Class<br />

• <strong>Chatter</strong>Users Class<br />

• Records Class<br />

• Input Classes<br />

• Output Classes<br />

• Enums<br />

• Exceptions<br />

280


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong> Class<br />

<strong>Chatter</strong> Class<br />

Use this class to access information about followers and subscriptions for records.<br />

Static Methods<br />

Note: Communities are available as a pilot program.<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

deleteSubscription<br />

String <strong>com</strong>munityId,<br />

String subscriptionId<br />

void<br />

Deletes the specified subscription. Use<br />

this to unfollow something, such as a<br />

record, a user, or a file. Use the<br />

<strong>Chatter</strong>Groups Class to leave a group.<br />

Use null for <strong>com</strong>munityId.<br />

getSubscription<br />

String <strong>com</strong>munityId,<br />

String subscriptionId<br />

Subscription<br />

Returns information about the<br />

specified subscription. Use null for<br />

<strong>com</strong>munityId.<br />

getFollowers<br />

String <strong>com</strong>munityId,<br />

String recordId<br />

FollowerPage<br />

Returns the first page of followers for<br />

the specified record in the specified<br />

<strong>com</strong>munity. The page contains the<br />

default number of items. Use either a<br />

record Id or the keyword me.<br />

getFollowers<br />

String <strong>com</strong>munityId,<br />

String recordId,<br />

Integer pageParam,<br />

Integer pageSize<br />

FollowerPage<br />

Returns the specified page of followers<br />

for the specified record.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• recordId—Specify the record you<br />

want information about, or use the<br />

keyword me.<br />

• pageParam—Specifies the number<br />

of the page you want returned.<br />

Starts at 0. If you pass in null or<br />

0, the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 1000. If you pass<br />

null, the default size is 25.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

281


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Favorites Class<br />

<strong>Chatter</strong>Favorites Class<br />

Use this class to add, get, update, and delete <strong>Chatter</strong> favorites. <strong>Chatter</strong> favorites give you easy access to list views, feed searches,<br />

and topics.<br />

Static Methods<br />

Note: Communities are available as a pilot program.<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

addFavorite<br />

String <strong>com</strong>munityId,<br />

String subjectId,<br />

String searchText<br />

FeedFavorite<br />

Adds a favorite for the specified<br />

user in the specified <strong>com</strong>munity.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• subjectId—Specify a user<br />

ID. subjectId must be the<br />

same as the context user. You<br />

can use the string me to specify<br />

the context user instead of an<br />

Id.<br />

• searchText—Specify the text<br />

of the search to be saved as a<br />

favorite. This method can only<br />

create a saved search favorite,<br />

not a list view favorite.<br />

deleteFavorite<br />

String <strong>com</strong>munityId,<br />

String subjectId,<br />

String favoriteId<br />

void<br />

Deletes the specified favorite.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id. Use null<br />

for <strong>com</strong>munityId.<br />

getFavorite<br />

String <strong>com</strong>munityId,<br />

String subjectId,<br />

String favoriteId<br />

FeedFavorite<br />

Returns a description of the<br />

favorite.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• subjectId—Specify a user<br />

ID. subjectId must be the<br />

same as the context user. You<br />

can use the string me to specify<br />

the context user instead of an<br />

Id.<br />

• favoriteId—Specify the<br />

favorite ID.<br />

282


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Favorites Class<br />

Name<br />

getFavorites<br />

getFeedItems<br />

getFeedItems<br />

Parameters<br />

String <strong>com</strong>munityId,<br />

String subjectId,<br />

String <strong>com</strong>munityId,<br />

String subjectId,<br />

String favoriteId<br />

Returns<br />

FeedFavorites<br />

FeedItemPage<br />

Description<br />

Returns a list of all favorites for<br />

the specified user in the specified<br />

<strong>com</strong>munity. subjectId must be<br />

the same as the context user. You<br />

can use the string me to specify the<br />

context user instead of an Id.<br />

Returns the first page of feed items<br />

for the specific favorite in the<br />

specified <strong>com</strong>munity. The page<br />

contains the default number of<br />

items.subjectId must be the<br />

same as the context user. You can<br />

use the string me to specify the<br />

context user instead of an Id.<br />

String <strong>com</strong>munityId,<br />

String subjectId,<br />

FeedItemPage<br />

Returns the specified page of feed<br />

items for the specified favorite, in<br />

the specified <strong>com</strong>munity in the<br />

String favoriteId,<br />

specified order.<br />

String pageParam,<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

Integer pageSize, • subjectId—Specify a user<br />

FeedSortOrder<br />

ID. subjectId must be the<br />

enumsortParam<br />

same as the context user. You<br />

can use the string me to specify<br />

the context user instead of an<br />

Id.<br />

• favoriteId—Specify the<br />

favorite ID.<br />

• pageParam—Specifies the<br />

page token to be used to view<br />

the page. Page tokens are<br />

returned as part of the response<br />

class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass<br />

in null the first page is<br />

returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1 and<br />

100. If you pass in null, the<br />

default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either<br />

by created date in ascending<br />

283


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

order, or by last modified date,<br />

also in ascending order. If you<br />

pass in null, the default<br />

CreatedDateDesc is used.<br />

updateFavorite<br />

String <strong>com</strong>munityId,<br />

String subjectId,<br />

String favoriteId,<br />

Boolean<br />

updateLastViewDate<br />

FeedFavorite<br />

If you specify true for<br />

updateLastViewDate, this<br />

method updates the last view date<br />

of the specified favorite to the<br />

current system time. Use null for<br />

<strong>com</strong>munityId.subjectId must<br />

be the same as the context user.<br />

You can use the string me to<br />

specify the context user instead of<br />

an Id.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Use this class to access and modify feeds and feed data. This includes accessing, adding, and deleting feed items, as well as<br />

likes, <strong>com</strong>ments, and bookmarks. You can also use this class to search feed items.<br />

The <strong>com</strong>position of a feed may change between releases. Your code should always be prepared to handle unknown subclasses<br />

in both MessageSegment and FeedItemAttachment objects.<br />

Static Methods<br />

Note: Communities are available as a pilot program.<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

deleteComment<br />

String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId<br />

void<br />

Deletes the specified <strong>com</strong>ment. Use<br />

null for <strong>com</strong>munityId.<br />

deleteFeedItem<br />

String <strong>com</strong>munityId,<br />

String feedItemId<br />

void<br />

Deletes the specified feed item. Use<br />

null for <strong>com</strong>munityId.<br />

deleteLike<br />

String <strong>com</strong>munityId,<br />

String likeId<br />

void<br />

Deletes the specified like. This can<br />

be a like on either a <strong>com</strong>ment or a<br />

feed item. Use null for<br />

<strong>com</strong>munityId.<br />

284


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

getComment<br />

String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId<br />

Comment<br />

Returns the specified <strong>com</strong>ment. Use<br />

null for <strong>com</strong>munityId.<br />

getCommentsForFeedItem<br />

String <strong>com</strong>munityId,<br />

String feedItemId<br />

CommentPage<br />

Returns the first page of <strong>com</strong>ments<br />

for the specified feed item. The page<br />

contains the default number of items.<br />

Use null for <strong>com</strong>munityId.<br />

getCommentsForFeedItem<br />

String <strong>com</strong>munityId,<br />

String feedItemId,<br />

String pageParam,<br />

Integer pageSize<br />

CommentPage<br />

Returns the specified page of<br />

<strong>com</strong>ments for the specified feed item.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedItemId—Specify the Id of<br />

a feed item.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

getFeed<br />

getFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType<br />

Feed<br />

Returns information about the feed<br />

for the specified feed type. Use null<br />

for <strong>com</strong>munityId. The only valid<br />

value for feedType for this method<br />

is Company.<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

Feed<br />

Returns the feed for the specified feed<br />

type in the specified order.<br />

• <strong>com</strong>munityId—Use null for<br />

FeedSortOrder enum<br />

<strong>com</strong>munityId.<br />

sortParam • feedType—The only valid value<br />

for feedType for this method is<br />

Company.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

285


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

getFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId<br />

Feed<br />

Returns the feed for the specified feed<br />

type for the specified user.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• Valid values for feedType are:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

getFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

Feed<br />

Returns the feed for the specified feed<br />

type for the specified user, in the<br />

specified order.<br />

String subjectId,<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

FeedSortOrder enum<br />

sortParam • feedType—<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

286


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

getFeedItem<br />

String <strong>com</strong>munityId,<br />

String feedItemId<br />

FeedItem<br />

Returns a rich description of the<br />

specified feed item. Use null for<br />

<strong>com</strong>munityId.<br />

getFeedItemsFromFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType<br />

FeedItemPage<br />

Returns the first page of feed items<br />

for the specified feed type. When<br />

invoked during a test with the<br />

matching<br />

setTestGetFeedItemsFromFeed<br />

method, returns the feed item page<br />

passed in with that method. You<br />

must use the test method with the<br />

exact same parameters, or you receive<br />

an assert.The page contains the<br />

default number of items. The only<br />

valid value for feedType for this<br />

method is Company. Use null for<br />

<strong>com</strong>munityId.<br />

getFeedItemsFromFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String pageParam,<br />

Integer pageSize,<br />

FeedSortOrder enum<br />

sortParam<br />

FeedItemPage<br />

Returns the feed items for the<br />

specified page for the specified feed<br />

type, in the specified order. When<br />

invoked during a test with the<br />

matching<br />

setTestGetFeedItemsFromFeed<br />

method, returns the feed item page<br />

passed in with that method. You<br />

must use the test method with the<br />

exact same parameters, or you receive<br />

an assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—The only valid value<br />

for feedType for this method is<br />

Company.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

287


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

getFeedItemsFromFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId<br />

FeedItemPage<br />

Returns the first page of feed items<br />

for the specified feed type, for the<br />

specified user. When invoked during<br />

a test with the matching<br />

setTestGetFeedItemsFromFeed<br />

method, returns the feed item page<br />

passed in with that method. You<br />

must use the test method with the<br />

exact same parameters, or you receive<br />

an assert.The page contains the<br />

default number of items.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• Valid values for feedType are:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

getFeedItemsFromFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId,<br />

String pageParam,<br />

Integer pageSize,<br />

FeedSortOrder enum<br />

sortParam<br />

FeedItemPage<br />

Returns the feed items on the<br />

specified page for the specified user,<br />

for the specified feed type in the<br />

specified order. When invoked during<br />

a test with the matching<br />

setTestGetFeedItemsFromFeed<br />

method, returns the feed item page<br />

passed in with that method. You<br />

must use the test method with the<br />

288


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

exact same parameters, or you receive<br />

an assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

getFeedItemsFromFilterFeed<br />

String <strong>com</strong>munityId,<br />

String subjectId<br />

String keyPrefix<br />

FeedItemPage<br />

Returns the first page of feed items<br />

for the specified user and the<br />

specified key prefix. When invoked<br />

during a test with the matching<br />

setTestGetFeedItemsFromFilterFeed<br />

method, returns the feed item page<br />

that was passed in with that method,<br />

289


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

filtered by the key prefix: only the<br />

feed items associated with the<br />

specified type are returned. You must<br />

use the test method with the exact<br />

same parameters, or you receive an<br />

exception. The page contains the<br />

default number of items.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• keyPrefix—Specify the key<br />

prefix of the type of record you<br />

want. A key prefix is the<br />

three-character prefix code in the<br />

object ID. Object IDs are prefixed<br />

with three-character codes that<br />

specify the type of the object. For<br />

example, User objects have a<br />

prefix of 005 and Group objects<br />

have a prefix of 0F9.<br />

getFeedItemsFromFilterFeed<br />

String <strong>com</strong>munityId,<br />

String subjectId<br />

String keyPrefix<br />

String pageParam,<br />

Integer pageSize,<br />

FeedSortOrder enum<br />

sortParam<br />

FeedItemPage<br />

Returns the specified page of feed<br />

items for the specified user and the<br />

specified key prefix, in the specified<br />

order. When invoked during a test<br />

with the matching<br />

setTestGetFeedItemsFromFilterFeed<br />

method, returns the feed item page<br />

that was passed in with that method,<br />

filtered by the key prefix: only the<br />

feed items associated with the<br />

specified type are returned. You must<br />

use the test method with the exact<br />

same parameters, or you receive an<br />

exception.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• keyPrefix—Specify the key<br />

prefix of the type of record you<br />

want. A key prefix is the<br />

three-character prefix code in the<br />

290


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

object ID. Object IDs are prefixed<br />

with three-character codes that<br />

specify the type of the object. For<br />

example, User objects have a<br />

prefix of 005 and Group objects<br />

have a prefix of 0F9.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

getFeedPoll<br />

String <strong>com</strong>munityId,<br />

String feedItemId<br />

FeedPoll<br />

Returns the poll associated with the<br />

specified feed item. Use null for<br />

<strong>com</strong>munityId.<br />

getFilterFeed<br />

String <strong>com</strong>munityId,<br />

String subjectId<br />

String keyPrefix<br />

Feed<br />

Returns the first page of a feed for<br />

the specified user and the given key<br />

prefix.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• keyPrefix—Specify the key<br />

prefix of the type of record you<br />

want. A key prefix is the<br />

three-character prefix code in the<br />

object ID. Object IDs are prefixed<br />

with three-character codes that<br />

specify the type of the object. For<br />

example, User objects have a<br />

291


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

prefix of 005 and Group objects<br />

have a prefix of 0F9.<br />

getFilterFeed<br />

String <strong>com</strong>munityId, Feed<br />

Returns the first page of a feed in the<br />

specified order for the specified user<br />

String subjectId<br />

and the given key prefix.<br />

String keyPrefix<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

FeedSortOrder enum<br />

sortParam • subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• keyPrefix—Specify the key<br />

prefix of the type of record you<br />

want. A key prefix is the<br />

three-character prefix code in the<br />

object ID. Object IDs are prefixed<br />

with three-character codes that<br />

specify the type of the object. For<br />

example, User objects have a<br />

prefix of 005 and Group objects<br />

have a prefix of 0F9.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

getLike<br />

String <strong>com</strong>munityId,<br />

String likeId<br />

<strong>Chatter</strong>Like<br />

Returns the specified like. Use null<br />

for <strong>com</strong>munityId.<br />

getLikesForComment<br />

String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId<br />

<strong>Chatter</strong>LikePage<br />

Returns the first page of likes for the<br />

specified <strong>com</strong>ment. Use null for<br />

<strong>com</strong>munityId. The page contains<br />

the default number of items.<br />

getLikesForComment<br />

String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId,<br />

Integer pageParam,<br />

Integer pageSize<br />

<strong>Chatter</strong>LikePage<br />

Returns the specified page of likes for<br />

the specified <strong>com</strong>ment.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• <strong>com</strong>mentId—Specify the<br />

<strong>com</strong>ment Id.<br />

292


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• pageParam—Specifies the<br />

number of the page you want<br />

returned. Starts at 0. If you pass<br />

in null or 0, the first page is<br />

returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

getLikesForFeedItem<br />

String <strong>com</strong>munityId,<br />

String feedItemId<br />

<strong>Chatter</strong>LikePage<br />

Returns the first page of likes for the<br />

specified feed item. Use null for<br />

<strong>com</strong>munityId. The page contains<br />

the default number of items.<br />

getLikesForFeedItem<br />

String <strong>com</strong>munityId,<br />

String feedItemId,<br />

Integer pageParam,<br />

Integer pageSize<br />

<strong>Chatter</strong>LikePage<br />

Returns the specified page of likes for<br />

the specified feed item.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedItemId—Specify the Id for<br />

the feed item<br />

• pageParam—Specifies the<br />

number of the page you want<br />

returned. Starts at 0. If you pass<br />

in null or 0, the first page is<br />

returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

isModified<br />

String <strong>com</strong>munityId,<br />

FeedType Enum feedType,<br />

String subjectId,<br />

String since<br />

FeedModifiedInfo<br />

Class<br />

Returns information about whether<br />

a feed has been updated or changed.<br />

Use this method to poll a feed for<br />

updates.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed. The only supported type is<br />

News<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• since—an opaque token<br />

containing information about the<br />

last modified date of the feed.<br />

Retrieve this token from<br />

293


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

Feed.isModifiedToken or<br />

FeedItemPage.isModifiedToken.<br />

likeComment<br />

String <strong>com</strong>munityId,<br />

String <strong>com</strong>mentId<br />

<strong>Chatter</strong>Like<br />

Adds a like to the specified <strong>com</strong>ment<br />

for the context user. If the user has<br />

already liked this <strong>com</strong>ment, this is a<br />

non-operation and returns the<br />

existing like. Use null for<br />

<strong>com</strong>munityId.<br />

likeFeedItem<br />

String <strong>com</strong>munityId,<br />

String feedItemId<br />

<strong>Chatter</strong>Like<br />

Adds a like to the specified feed item<br />

for the context user. If the user has<br />

already liked this feed item, this is a<br />

non-operation and returns the<br />

existing like. Use null for<br />

<strong>com</strong>munityId.<br />

postComment<br />

String <strong>com</strong>munityId,<br />

String feedItemId,<br />

String text<br />

Comment<br />

Adds the specified text as a <strong>com</strong>ment<br />

to the specified feed item, for the<br />

context user. Use null for<br />

<strong>com</strong>munityId. If hashtags or links<br />

are detected in text, they are<br />

included in the <strong>com</strong>ment as hashtag<br />

and link segments. Mentions are not<br />

detected in text and are not<br />

separated out of the text.<br />

postComment<br />

String <strong>com</strong>munityId,<br />

String feedItemId,<br />

CommentInput <strong>com</strong>ment,<br />

BinaryInput<br />

feedItemFileUpload<br />

Comment<br />

Adds a <strong>com</strong>ment to the specified feed<br />

item from the context user. Use null<br />

for <strong>com</strong>munityId. Use<br />

CommentInput to include richly<br />

formatted <strong>com</strong>ment text, such as<br />

@mentions. If<br />

feedItemFileUpload is non-null,<br />

it specifies a file attachment for the<br />

<strong>com</strong>ment.<br />

In CommentInput, you can only use<br />

either ContentAttachmentInput<br />

or NewFileAttachmentInput.<br />

Use ContentAttachmentInput<br />

to specify existing content as the<br />

attachment so you can’t also supply a<br />

file in feedItemFileUpload. If you<br />

use NewFileAttachmentInput,<br />

you must supply the binary file in<br />

feedItemFileUpload.<br />

postFeedItem<br />

String <strong>com</strong>munityId,<br />

FeedType Enum feedType,<br />

String subjectId,<br />

FeedItem<br />

Adds a feed item to the specified feed<br />

from the context user.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

294


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

String text • feedType—One of the<br />

following:<br />

◊<br />

◊<br />

◊<br />

News<br />

Record<br />

UserProfile<br />

Use Record to post to a group.<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• text—the text of the <strong>com</strong>ment.<br />

Mentions and hashtags are<br />

removed.<br />

postFeedItem<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId,<br />

FeedItemInput feedItem,<br />

BinaryInput<br />

feedItemFileUpload<br />

FeedItem<br />

Adds a feed item to the specified feed<br />

from the context user. Use null for<br />

<strong>com</strong>munityId. Use<br />

FeedItemInput to include richly<br />

formatted text, such as @mentions.<br />

If feedItemFileUpload is<br />

non-null, it specifies a file attachment<br />

for the feed item.<br />

In FeedItemInput, if you<br />

useContentAttachmentInput to<br />

specify existing content as the<br />

attachment, you can’t also supply a<br />

file in feedItemFileUpload. If you<br />

use NewFileAttachmentInput,<br />

you must supply the binary file in<br />

feedItemFileUpload.<br />

shareFeedItem<br />

String <strong>com</strong>munityId,<br />

FeedType Enum feedType,<br />

String subjectId,<br />

FeedItem<br />

Share the originalFeedItemId to<br />

the feed specified by the feedType,<br />

subjectId and <strong>com</strong>munityId. Use<br />

null for <strong>com</strong>munityId.<br />

String<br />

originalFeedItemId<br />

searchFeedItems<br />

String <strong>com</strong>munityId,<br />

String q<br />

FeedItemPage<br />

Returns the first page of all the<br />

feed-items that match the specified<br />

search criteria. The page contains the<br />

default number of items.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

295


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

searchFeedItems<br />

String <strong>com</strong>munityId,<br />

String q,<br />

String pageParam,<br />

Integer pageSize<br />

FeedItemPage<br />

Returns a list of all the feed-items<br />

viewable by the context user that<br />

match the specified search criteria.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

searchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String q<br />

FeedItemPage Class<br />

Searches the feed items for a specified<br />

feed type.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Company<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

296


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

searchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId,<br />

String q<br />

FeedItemPage Class<br />

Searches the feed items for a specified<br />

feed type and context user.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Company<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

searchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String pageParam,<br />

Integer pageSize,<br />

FeedSortOrder enum<br />

sortParam,<br />

FeedItemPage Class<br />

Searches the feed items for a specified<br />

feed type and returns a specified page<br />

and page size in a specified sort order.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

String q ◊ Bookmarks<br />

◊ Company<br />

◊ Files<br />

297


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

searchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

FeedItemPage Class Searches the feed items for a specified<br />

feed type and context user, and<br />

returns a specified page and page size<br />

String subjectId,<br />

in a specified sort order.<br />

String pageParam,<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

Integer pageSize, • feedType—Specifies the type of<br />

FeedSortOrder enum<br />

feed, such as a feed made up of<br />

sortParam,<br />

bookmarks, groups, or records:<br />

String q ◊ Bookmarks<br />

◊ Company<br />

◊ Files<br />

298


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

setTestGetFeedItemsFromFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType<br />

FeedItemPage result<br />

void<br />

Registers a test feed item page to be<br />

returned when<br />

getFeedItemsFromFeed is called<br />

with matching parameters during a<br />

test. You must use the get feed<br />

method with the exact same<br />

parameters, or you receive an assert.<br />

299


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—The only valid value<br />

for feedType for this method is<br />

Company.<br />

• result—Specify the test feed<br />

item page.<br />

setTestGetFeedItemsFromFeed String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

void<br />

Registers a test feed item page to be<br />

returned when<br />

getFeedItemsFromFeed is called<br />

String pageParam,<br />

with matching parameters during a<br />

Integer pageSize,<br />

test. You must use the get feed<br />

method with the exact same<br />

FeedSortOrder enum<br />

parameters, or you receive an assert.<br />

sortParam • <strong>com</strong>munityId—Use null for<br />

FeedItemPage result<br />

<strong>com</strong>munityId.<br />

• feedType—The only valid value<br />

for feedType for this method is<br />

Company.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

• result—Specify the test feed<br />

item page.<br />

setTestGetFeedItemsFromFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId,<br />

void<br />

Registers a test feed item page to be<br />

returned when<br />

getFeedItemsFromFeed is called<br />

with matching parameters during a<br />

test. You must use the get feed<br />

300


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

FeedItemPage result<br />

method with the exact same<br />

parameters, or you receive an assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• result—Specify the test feed<br />

item page.<br />

setTestGetFeedItemsFromFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId<br />

String pageParam,<br />

Integer pageSize,<br />

FeedSortOrder enum<br />

sortParam<br />

FeedItemPage result<br />

void<br />

Registers a test feed item page to be<br />

returned when<br />

getFeedItemsFromFeed is called<br />

with matching parameters during a<br />

test. You must use the get feed<br />

method with the exact same<br />

parameters, or you receive an assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

301


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

• result—Specify the test feed<br />

item page.<br />

setTestGetFeedItemsFromFilterFeed<br />

String <strong>com</strong>munityId,<br />

String subjectId<br />

String keyPrefix<br />

FeedItemPage result<br />

void<br />

Creates a feed item page used for<br />

testing. After you create the page, use<br />

the matching<br />

getFeedItemsFromFilterFeed<br />

method to access the test page and<br />

run your tests. You must use the get<br />

feed filter method with the exact<br />

same parameters, or you receive an<br />

assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• keyPrefix—Specify the key<br />

prefix of the type of record you<br />

want. A key prefix is the<br />

three-character prefix code in the<br />

object ID. Object IDs are prefixed<br />

with three-character codes that<br />

specify the type of the object. For<br />

example, User objects have a<br />

302


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

prefix of 005 and Group objects<br />

have a prefix of 0F9.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

• result—Specify the test feed<br />

item page.<br />

setTestGetFeedItemsFromFilterFeed String <strong>com</strong>munityId,<br />

String subjectId<br />

String keyPrefix<br />

String pageParam,<br />

Integer pageSize,<br />

FeedSortOrder enum<br />

sortParam<br />

FeedItemPage result<br />

void<br />

Creates a feed item page used for<br />

testing. After you create the page, use<br />

the matching<br />

getFeedItemsFromFilterFeed<br />

method to access the test page and<br />

run your tests. You must use the get<br />

feed filter method with the exact<br />

same parameters, or you receive an<br />

assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• keyPrefix—Specify the key<br />

prefix of the type of record you<br />

want. A key prefix is the<br />

three-character prefix code in the<br />

object ID. Object IDs are prefixed<br />

with three-character codes that<br />

specify the type of the object. For<br />

example, User objects have a<br />

prefix of 005 and Group objects<br />

have a prefix of 0F9.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

303


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

• result—Specify the test feed<br />

item page.<br />

setTestSearchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String q,<br />

FeedItemPage Class result<br />

void<br />

Creates a feed item page to use for<br />

testing. After you create the page, use<br />

the matching<br />

searchFeedItemsInFeed method<br />

to access the test page and run your<br />

tests. You must use the method with<br />

the same parameters or you receive<br />

an assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Company<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

304


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• result—Specify the test feed<br />

item page.<br />

setTestSearchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId,<br />

String q,<br />

FeedItemPage Class result<br />

void<br />

Creates a feed item page to use for<br />

testing. After you create the page, use<br />

the matching<br />

searchFeedItemsInFeed method<br />

to access the test page and run your<br />

tests. You must use the method with<br />

the same parameters or you receive<br />

an assert.Searches the feed items in<br />

a specified feed type for the context<br />

user.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Company<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

• result—Specify the test feed<br />

item page.<br />

setTestSearchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String pageParam,<br />

Integer pageSize,<br />

void<br />

Creates a feed item page to use for<br />

testing. After you create the page, use<br />

the matching<br />

searchFeedItemsInFeed method<br />

to access the test page and run your<br />

305


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

FeedSortOrder sortParam,<br />

tests. You must use the method with<br />

String q,<br />

the same parameters or you receive<br />

an assert.<br />

FeedItemPage Class result • <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Company<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

null, the default<br />

CreatedDateDesc is used.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

• result—Specify the test feed<br />

item page.<br />

306


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Feeds Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

setTestSearchFeedItemsInFeed<br />

String <strong>com</strong>munityId,<br />

FeedType enum feedType,<br />

String subjectId,<br />

String pageParam,<br />

Integer pageSize,<br />

FeedSortOrder sortParam,<br />

String q,<br />

FeedItemPage Class result<br />

void<br />

Creates a feed item page to use for<br />

testing. After you create the page, use<br />

the matching<br />

searchFeedItemsInFeed method<br />

to access the test page and run your<br />

tests. You must use the method with<br />

the same parameters or you receive<br />

an assert.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedType—Specifies the type of<br />

feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

Bookmarks<br />

Company<br />

Files<br />

Groups<br />

News<br />

People<br />

Record<br />

To<br />

UserProfile<br />

• subjectId—Specify a user ID.<br />

subjectId must be the same as<br />

the context user. You can use the<br />

string me to specify the context<br />

user instead of an Id.<br />

• pageParam—Specifies the page<br />

token to be used to view the page.<br />

Page tokens are returned as part<br />

of the response class, for example,<br />

currentPageToken or<br />

nextPageToken. If you pass in<br />

null the first page is returned.<br />

• pageSize—Specifies the number<br />

of items per page. Valid values are<br />

between 1 and 100. If you pass in<br />

null, the default size is 25.<br />

• sortParam—Values are:<br />

◊<br />

◊<br />

CreatedDateDesc<br />

LastModifiedDateDesc<br />

Sorts the returned feed either by<br />

created date in ascending order,<br />

or by last modified date, also in<br />

ascending order. If you pass in<br />

307


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Groups Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

null, the default<br />

CreatedDateDesc is used.<br />

• q—Required and cannot be<br />

null. Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards. For<br />

more information about<br />

wildcards, see Using Wildcards.<br />

• result—Specify the test feed<br />

item page.<br />

updateBookmark<br />

voteOnFeedPoll<br />

String <strong>com</strong>munityId,<br />

String feedItemId,<br />

Boolean<br />

isBookmarkedByCurrentUser<br />

String <strong>com</strong>munityId,<br />

String feedItemId,<br />

String myChoiceId<br />

FeedItem<br />

FeedPoll<br />

Updates the specified feed item. Use<br />

null for <strong>com</strong>munityId. Specifying<br />

true for<br />

isBookmarkedByCurrentUser<br />

adds the feed item to the list of<br />

bookmarks for the current user.<br />

Specify false to remove a<br />

bookmark.<br />

Used to vote or to change your vote<br />

on an existing feed poll.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• feedItemId—Specify the feed<br />

item that is associated with the<br />

poll<br />

• myChoiceId—Specify the Id of<br />

the item in the poll to vote for.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Groups Class<br />

Use this class to access information about groups, such as the group’s members, photo, and the groups the specified user is<br />

following. Also use this class to add members to a group, remove members, and change the group photo.<br />

Static Methods<br />

Note: Communities are available as a pilot program.<br />

308


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Groups Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

addMember<br />

String <strong>com</strong>munityId,<br />

String groupId,<br />

String userId<br />

GroupMember<br />

Adds the specified user to the<br />

specified group in the specified<br />

<strong>com</strong>munity. This method is only<br />

successful when the context user<br />

is allowed to manage the group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

• userId—The ID for a user.<br />

deleteMember<br />

String <strong>com</strong>munityId,<br />

String membershipId<br />

void<br />

Deletes the specified membership.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• membershipId—The ID for<br />

a membership.<br />

deletePhoto<br />

String <strong>com</strong>munityId,<br />

String groupId<br />

void<br />

Deletes the photo of the specified<br />

group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

getGroup<br />

String <strong>com</strong>munityId,<br />

String groupId<br />

<strong>Chatter</strong>Group<br />

Returns information about the<br />

specified group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

getGroupMembershipRequest<br />

getGroupMembershipRequests<br />

String <strong>com</strong>munityId,<br />

String requestId<br />

String <strong>com</strong>munityId,<br />

String groupId<br />

GroupMembershipRequest<br />

GroupMembershipRequests<br />

Returns information about the<br />

specified request to join a private<br />

group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• requestId—The ID of a<br />

request to join a private group.<br />

Returns information about every<br />

request to join the specified<br />

private group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID of a<br />

group.<br />

309


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Groups Class<br />

Name<br />

getGroupMembershipRequests<br />

Parameters<br />

String <strong>com</strong>munityId,<br />

String groupId,<br />

Enum<br />

GroupMembershipRequestStatus<br />

status<br />

Returns<br />

Description<br />

GroupMembershipRequests Returns information about every<br />

request to join the specified<br />

private group that has a specified<br />

status.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID of a<br />

group.<br />

• The status of a request to join<br />

a private group.<br />

◊<br />

◊<br />

◊<br />

Accepted<br />

Declined<br />

Pending<br />

getGroups<br />

String <strong>com</strong>munityId<br />

<strong>Chatter</strong>GroupPage<br />

Returns the first page of all the<br />

groups. The page contains the<br />

default number of items.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

getGroups<br />

String <strong>com</strong>munityId,<br />

Integer pageParam,<br />

Integer pageSize<br />

<strong>Chatter</strong>GroupPage<br />

Returns the specified page of<br />

information about all groups.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• pageParam——The number<br />

of the page you want returned.<br />

Starts at 0. If you pass null<br />

or 0, the first page is returned.<br />

• pageSize—The number of<br />

items per page. Valid values<br />

are between 1 and 100. If you<br />

pass null, the default size is<br />

25.<br />

getMember<br />

String <strong>com</strong>munityId,<br />

String membershipId<br />

GroupMember<br />

Returns information about the<br />

specified group member.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• membershipId—The ID for<br />

a membership.<br />

getMembers<br />

String <strong>com</strong>munityId,<br />

String groupId<br />

GroupMemberPage<br />

Returns the first page of<br />

information about all members of<br />

the specified group. The page<br />

contains the default number of<br />

items.<br />

310


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Groups Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

getMembers<br />

String <strong>com</strong>munityId,<br />

String groupId,<br />

Integer pageParam,<br />

Integer pageSize<br />

GroupMemberPage<br />

Returns the specified page of<br />

information about all members of<br />

the specified group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

• pageParam——The number<br />

of the page you want returned.<br />

Starts at 0. If you pass null<br />

or 0, the first page is returned.<br />

• pageSize—The number of<br />

items per page. Valid values<br />

are between 1 and 100. If you<br />

pass null, the default size is<br />

25.<br />

getMy<strong>Chatter</strong>Settings<br />

String <strong>com</strong>munityId,<br />

String groupId<br />

Group<strong>Chatter</strong>Settings<br />

Returns the context user’s <strong>Chatter</strong><br />

settings for the specified group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

getPhoto<br />

String <strong>com</strong>munityId,<br />

String groupId<br />

Photo<br />

Returns information about the<br />

photo for the specified group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

requestGroupMembership<br />

String <strong>com</strong>munityId,<br />

String groupId<br />

GroupMembershipRequest Requests membership in a private<br />

group for the context user.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID of a<br />

private group.<br />

searchGroups<br />

String <strong>com</strong>munityId,<br />

String q<br />

<strong>Chatter</strong>GroupPage<br />

Returns the first page of groups<br />

that match the specified search<br />

criteria. The page contains the<br />

default number of items.<br />

311


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Groups Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• q—Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards.<br />

For more information about<br />

wildcards, see Using<br />

Wildcards. Can be specified<br />

as null.<br />

searchGroups<br />

String <strong>com</strong>munityId,<br />

String q,<br />

Integer pageParam,<br />

Integer pageSize<br />

<strong>Chatter</strong>GroupPage<br />

Returns the specified page of<br />

groups that match the specified<br />

search criteria.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• q—Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards.<br />

For more information about<br />

wildcards, see Using<br />

Wildcards. Can be specified<br />

as null.<br />

• pageParam—Specifies the<br />

number of the page you want<br />

returned. Starts at 0. If you<br />

pass in null or 0, the first<br />

page is returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1 and<br />

100. If you pass in null, the<br />

default size is 25.<br />

setPhoto<br />

String <strong>com</strong>munityId,<br />

String groupId,<br />

String fileId,<br />

Integer versionNumber<br />

Photo<br />

Sets the group photo to be the<br />

specified, already uploaded file.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

• fileId—ID of a file already<br />

uploaded. The file must be an<br />

image smaller than 2 MB.<br />

• versionNumber—Version<br />

number of the existing file.<br />

Specify either an existing<br />

version number or, to get the<br />

latest version, specify null.<br />

312


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Groups Class<br />

Name<br />

setPhoto<br />

Parameters<br />

Returns<br />

Description<br />

String <strong>com</strong>munityId,<br />

String groupId,<br />

Photo<br />

Sets the provided blob to be the<br />

photo for the specified group. .<br />

• <strong>com</strong>munityId—Use null<br />

ABinaryInput Class<br />

for <strong>com</strong>munityId.<br />

fileUpload • groupId—The ID for a<br />

group.<br />

• fileUpload—An image to<br />

use as the group photo. The<br />

content type must be usable<br />

as an image.<br />

updateMy<strong>Chatter</strong>Settings<br />

String <strong>com</strong>munityId,<br />

String groupId,<br />

Enum emailFrequency<br />

Group<strong>Chatter</strong>Settings<br />

Updates the context user’s <strong>Chatter</strong><br />

settings for the specified group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• groupId—The ID for a<br />

group.<br />

• emailFrequency—Specifies<br />

the frequency with which a<br />

user receives email from a<br />

group.<br />

◊<br />

◊<br />

◊<br />

◊<br />

◊<br />

EachPost<br />

DailyDigest<br />

WeeklyDigest<br />

Never<br />

UseDefault<br />

The value UseDefault uses<br />

the value set in a call to<br />

<strong>Chatter</strong>Users.update<strong>Chatter</strong>Settings.<br />

updateRequestStatus<br />

String <strong>com</strong>munityId,<br />

String requestId,<br />

Enum status<br />

GroupMembershipRequest Updates a request to join a private<br />

group.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• requestId—The ID for a<br />

request to join a private group.<br />

• status—The status of the<br />

request:<br />

◊<br />

◊<br />

Accepted<br />

Declined<br />

313


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

The Pending value of the<br />

enum is not valid in this<br />

method.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Use this class to access information about the user, such as who is following the user, the user’s subscriptions, files, and groups.<br />

Static Methods<br />

Note: Communities are available as a pilot program.<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

deletePhoto<br />

String <strong>com</strong>munityId,<br />

String userId<br />

void<br />

Deletes the specified user’s<br />

photo. Use either the Id for a<br />

user or the keyword me. Use<br />

null for <strong>com</strong>munityId.<br />

follow<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

String subjectId<br />

Subscription<br />

Adds the specified userId as<br />

a follower to the specified<br />

subjectId. Use either the Id<br />

for a user or the keyword me.<br />

Use null for <strong>com</strong>munityId.<br />

get<strong>Chatter</strong>Settings<br />

String <strong>com</strong>munityId,<br />

String userId<br />

User<strong>Chatter</strong>Settings<br />

Returns information about the<br />

default <strong>Chatter</strong> settings for the<br />

specified user.<br />

Use null for <strong>com</strong>munityId.<br />

Use either the Id for a user or<br />

the keyword me.<br />

getFollowers<br />

String <strong>com</strong>munityId,<br />

String userId<br />

FollowerPage<br />

Returns the first page of<br />

followers for the specified user<br />

Id. Use null for<br />

<strong>com</strong>munityId. The page<br />

contains the default number<br />

of items.<br />

314


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

getFollowers<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

Integer pageParam,<br />

Integer pageSize<br />

FollowerPage<br />

Returns the specified page of<br />

followers for the specified user<br />

Id.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see. Use either the<br />

Id for a user or the<br />

keyword me.<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1<br />

and 100. If you pass in<br />

null, the default size is<br />

25.<br />

getFollowings<br />

String <strong>com</strong>munityId,<br />

String userId<br />

FollowingPage<br />

Returns the first page of<br />

information about the<br />

followers of the specified user.<br />

Use null for <strong>com</strong>munityId.<br />

Use either the Id for a user or<br />

the keyword me. The page<br />

contains the default number<br />

of items. This is different than<br />

getFollowers, which<br />

returns the users that follow<br />

the specified user.<br />

getFollowings<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

Integer pageParam<br />

FollowingPage<br />

Returns the specified page of<br />

information about the<br />

followers of the specified user.<br />

The page contains the default<br />

number of items. This is<br />

different than<br />

getFollowers, which<br />

returns the users that follow<br />

the specified user.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see. Use either the<br />

Id for a user or the<br />

keyword me.<br />

315


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

getFollowings<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

Integer pageParam,<br />

Integer pageSize<br />

FollowingPage<br />

Returns the specific page of<br />

information about the<br />

followers of the specified user.<br />

This is different than<br />

getFollowers, which<br />

returns the users that follow<br />

the specified user.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see. Use either the<br />

Id for a user or the<br />

keyword me.<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1<br />

and 1000. If you pass<br />

null, the default size is<br />

25.<br />

getFollowings<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

String filterType<br />

FollowingPage<br />

Returns the first page of<br />

information about the<br />

specified types of followers of<br />

the specified user. The page<br />

contains the default number<br />

of items. This is different than<br />

getFollowers, which<br />

returns the users that follow<br />

the specified user.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see. Use either the<br />

Id for a user or the<br />

keyword me.<br />

316


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• filterType—Specifies<br />

the key prefix to filter the<br />

type of objects returned.<br />

The key prefix is the<br />

three-character prefix code<br />

in the object ID. Object<br />

IDs are prefixed with<br />

three-character codes that<br />

specify the type of the<br />

object. For example, User<br />

objects have a prefix of 005<br />

and Group objects have a<br />

prefix of 0F9.<br />

getFollowings<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

String filterType,<br />

Integer pageParam<br />

FollowingPage<br />

Returns the specified page of<br />

information about the<br />

specified types of followers of<br />

the specified user. The page<br />

contains the default number<br />

of items. This is different than<br />

getFollowers, which<br />

returns the users that follow<br />

the specified user.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see<br />

• filterType—Specifies<br />

the key prefix to filter the<br />

type of objects returned.<br />

The key prefix is the<br />

three-character prefix code<br />

in the object ID. Object<br />

IDs are prefixed with<br />

three-character codes that<br />

specify the type of the<br />

object. For example, User<br />

objects have a prefix of 005<br />

and Group objects have a<br />

prefix of 0F9.<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

317


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

getFollowings<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

String filterType,<br />

Integer pageParam,<br />

Integer pageSize<br />

FollowingPage<br />

Returns the specified page of<br />

information about the<br />

specified types of followers of<br />

the specified user. This is<br />

different than<br />

getFollowers, which<br />

returns the users that follow<br />

the specified user.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see. Use either the<br />

Id for a user or the<br />

keyword me.<br />

• filterType—Specifies<br />

the key prefix to filter the<br />

type of objects returned.<br />

The key prefix is the<br />

three-character prefix code<br />

in the object ID. Object<br />

IDs are prefixed with<br />

three-character codes that<br />

specify the type of the<br />

object. For example, User<br />

objects have a prefix of 005<br />

and Group objects have a<br />

prefix of 0F9.<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1<br />

and 1000. If you pass<br />

null, the default size is<br />

25.<br />

getGroups<br />

String <strong>com</strong>munityId,<br />

String userId<br />

UserGroupPage<br />

Returns the first page of<br />

groups the specified user is a<br />

member of. Use null for<br />

<strong>com</strong>munityId. Use either the<br />

Id for a user or the keyword<br />

me. The page contains the<br />

default number of items.<br />

318


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

getGroups<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

Integer pageParam,<br />

Integer pageSize<br />

UserGroupPage<br />

Returns the specified page of<br />

groups the specified user is a<br />

member of.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see. Use either the<br />

Id for a user or the<br />

keyword me.<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1<br />

and 100. If you pass in<br />

null, the default size is<br />

25.<br />

getPhoto<br />

String <strong>com</strong>munityId,<br />

String userId<br />

Photo<br />

Returns information about the<br />

specified user’s photo. Use<br />

null for <strong>com</strong>munityId. Use<br />

either the Id for a user or the<br />

keyword me.<br />

getUser<br />

String <strong>com</strong>munityId,<br />

String userId<br />

UserSummary<br />

Returns information about the<br />

specified user. Use null for<br />

<strong>com</strong>munityId. Use either the<br />

Id for a user or the keyword<br />

me. If the context user is not<br />

a <strong>Chatter</strong> customer, the<br />

returned object can be<br />

downcast to a UserDetail<br />

object.<br />

getUsers<br />

String <strong>com</strong>munityId<br />

UserPage<br />

Returns the first page of users.<br />

The page contains the default<br />

number of items. Use null<br />

for <strong>com</strong>munityId. If the<br />

context user is a <strong>Chatter</strong><br />

customer, the UserPage<br />

UserSummary objects can be<br />

downcast to UserDetail<br />

objects.<br />

getUsers<br />

String <strong>com</strong>munityId,<br />

Integer pageParam,<br />

UserPage<br />

Returns the specified page of<br />

users. Use null for<br />

<strong>com</strong>munityId. If the context<br />

319


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

Integer pageSize<br />

user is a <strong>Chatter</strong> customer, the<br />

UserPage UserSummary<br />

objects can be downcast to<br />

UserDetail objects.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Specify the user<br />

Id whose followers you<br />

want to see. Use either the<br />

Id for a user or the<br />

keyword me.<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1<br />

and 100. If you pass in<br />

null, the default size is<br />

25.<br />

searchUsers<br />

String <strong>com</strong>munityId,<br />

String q<br />

UserPage<br />

Returns the first page of users<br />

that match the specified search<br />

criteria. Use null for<br />

<strong>com</strong>munityId. The page<br />

contains the default number<br />

of items. If the context user is<br />

a <strong>Chatter</strong> customer, the<br />

UserPage UserSummary<br />

objects can be downcast to<br />

UserDetail objects.<br />

q—Specifies the string to<br />

search. The search string must<br />

contain at least two characters,<br />

not including any wildcards.<br />

For more information about<br />

wildcards, see Using<br />

Wildcards. Can be specified<br />

as null.<br />

searchUsers<br />

String <strong>com</strong>munityId,<br />

String q,<br />

Integer pageParam,<br />

Integer pageSize<br />

UserPage<br />

Returns the specified page of<br />

users that match the specified<br />

search criteria. If the context<br />

user is a <strong>Chatter</strong> customer, the<br />

UserPage UserSummary<br />

objects can be downcast to<br />

UserDetail objects.<br />

320


Connect in Apex <strong>API</strong> Reference<br />

<strong>Chatter</strong>Users Class<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• q—Specifies the string to<br />

search. The search string<br />

must contain at least two<br />

characters, not including<br />

any wildcards. For more<br />

information about<br />

wildcards, see Using<br />

Wildcards. Can be<br />

specified as null.<br />

• pageParam—Specifies the<br />

number of the page you<br />

want returned. Starts at 0.<br />

If you pass in null or 0,<br />

the first page is returned.<br />

• pageSize—Specifies the<br />

number of items per page.<br />

Valid values are between 1<br />

and 100. If you pass in<br />

null, the default size is<br />

25.<br />

setPhoto<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

String fileId,<br />

Integer versionNumber<br />

Photo<br />

Sets the user photo to be the<br />

specified, already uploaded<br />

file.<br />

• <strong>com</strong>munityId—Use null<br />

for <strong>com</strong>munityId.<br />

• userId—Use either the<br />

Id for a user or the<br />

keyword me.<br />

• fileId—ID of a file<br />

already uploaded. The file<br />

must be an image, and be<br />

smaller than 2 MB.<br />

• versionNumber—Version<br />

number of the existing file.<br />

Specify either an existing<br />

version number, or null<br />

to get the latest version.<br />

setPhoto<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

BinaryInput Class<br />

fileUpload<br />

Photo<br />

Sets the provided blob to be<br />

the photo for the specified<br />

user. The content type must<br />

be usable as an image. Use<br />

null for <strong>com</strong>munityId. Use<br />

either the Id for a user or the<br />

keyword me.<br />

321


Connect in Apex <strong>API</strong> Reference<br />

Records Class<br />

Name<br />

update<strong>Chatter</strong>Settings<br />

Parameters<br />

String <strong>com</strong>munityId,<br />

String userId,<br />

Enum GroupEmailFrequency<br />

defaultGroupEmailFrequency<br />

Returns<br />

User<strong>Chatter</strong>Settings<br />

Description<br />

Updates the default <strong>Chatter</strong><br />

settings for the specified user.<br />

Don’t pass the value<br />

UseDefault for the<br />

defaultGroupEmailFrequency<br />

parameter because this method<br />

sets the default value.<br />

Use null for <strong>com</strong>munityId.<br />

Use either the Id for a user or<br />

the keyword me.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

Records Class<br />

Use this class to access information about records in your organization.<br />

Static Methods<br />

Name<br />

Parameters<br />

Returns<br />

Description<br />

getMotif<br />

String <strong>com</strong>munityId,<br />

String idOrPrefix<br />

Motif<br />

Returns a Motif object that contains<br />

the URLs for a set of small, medium,<br />

and large motif icons. Each<br />

<strong>Database</strong>.<strong>com</strong> record type has its<br />

own set of motif icons.<br />

• <strong>com</strong>munityId—Use null for<br />

<strong>com</strong>munityId.<br />

• idOrPrefix—An ID or key<br />

prefix.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

Input Classes<br />

In Connect in Apex, some methods take input objects, which are instances of the following input classes.<br />

322


Connect in Apex <strong>API</strong> Reference<br />

Input Classes<br />

Input classes are concrete unless marked abstract. Concrete input classes have public constructors that take no arguments.<br />

Some methods take an abstract input object. Construct an instance of a concrete child class to pass to these methods.<br />

Most properties for the input classes can be set. Read–only properties are noted.<br />

BinaryInput Class<br />

Used to attach files to feed items and <strong>com</strong>ments.<br />

Name<br />

blob<br />

contentType<br />

filename<br />

Type<br />

Blob<br />

String<br />

String<br />

Description<br />

Contents of the file to be used for input<br />

MIME type description of the content,<br />

such as image/jpg<br />

File name with the file extension, such<br />

as UserPhoto.jpg<br />

CommentInput Class<br />

Used to add rich <strong>com</strong>ments, for example, <strong>com</strong>ments that include @mentions or attachments.<br />

Name<br />

attachment<br />

body<br />

Type<br />

FeedItemAttachmentInput<br />

MessageBodyInput<br />

Description<br />

Optional. Specifies an attachment for the<br />

<strong>com</strong>ment. Valid values are:<br />

• ContentAttachmentInput<br />

• NewFileAttachmentInput<br />

LinkAttachmentInput is not<br />

permitted for <strong>com</strong>ments.<br />

Description of message body<br />

ContentAttachmentInput Class<br />

Used to attach existing content to a <strong>com</strong>ment or feed item.<br />

Child class of FeedItemAttachmentInput Class<br />

Name<br />

contentDocumentId<br />

Type<br />

String<br />

Description<br />

ID of the existing content.<br />

FeedItemAttachmentInput Class<br />

Used to attach a file to a feed item.<br />

This class is abstract and has no public constructor. You can make an instance only of a child class.<br />

Super class for:<br />

• ContentAttachmentInput Class<br />

• LinkAttachmentInput Class<br />

• NewFileAttachmentInput Class<br />

323


Connect in Apex <strong>API</strong> Reference<br />

Input Classes<br />

• PollAttachmentInput Class<br />

FeedItemInput Class<br />

Used to add rich feed items, for example, feed items that include @mentions or files. Also used to bookmark a feed item.<br />

Name<br />

attachment<br />

body<br />

isBookmarkedByCurrentUser<br />

visibility<br />

Type<br />

FeedItemAttachmentInput<br />

MessageBodyInput<br />

Boolean<br />

FeedItemVisibilityType Enum<br />

Description<br />

Optional. Specifies the attachment for<br />

the feed item. The feed item type is<br />

inferred based on the provided<br />

attachment.<br />

Message body<br />

Specifies if the new feed item should be<br />

bookmarked for the user (true) or not<br />

(false).<br />

Specifies the type of feed item, such as a<br />

content post, a text post, and so on.<br />

• AllUsers<br />

• InternalUsers<br />

HashtagSegmentInput Class<br />

Used to include a hashtag in a feed item or <strong>com</strong>ment.<br />

Child class of MessageSegmentInput Class<br />

Name<br />

tag<br />

Type<br />

String<br />

Description<br />

Text of the hash tag without the # (hash<br />

tag) prefix<br />

LinkAttachmentInput Class<br />

Used as part of a feed item attachment, to add links.<br />

Child class of FeedItemAttachmentInput Class<br />

Name<br />

url<br />

urlName<br />

Type<br />

String<br />

String<br />

Description<br />

URL to be used for the link<br />

Title of the link<br />

LinkSegmentInput Class<br />

Used to include a link segment in a feed item or <strong>com</strong>ment.<br />

Child class of MessageSegmentInput Class<br />

324


Connect in Apex <strong>API</strong> Reference<br />

Input Classes<br />

Name<br />

url<br />

Type<br />

String<br />

Description<br />

URL to be used for the link<br />

MentionSegmentInput Class<br />

Used to include an @mention of a user in a feed item or <strong>com</strong>ment.<br />

Child class of MessageSegmentInput Class<br />

Name<br />

id<br />

Type<br />

String<br />

Description<br />

ID of the user to be mentioned<br />

MessageBodyInput Class<br />

Used to add rich messages to feed items and <strong>com</strong>ments.<br />

Name<br />

messageSegments<br />

Type<br />

List<br />

Description<br />

List of message segments contained in<br />

the body<br />

MessageSegmentInput Class<br />

Used to add rich message segments to feed items and <strong>com</strong>ments.<br />

This class is abstract and has no public constructor. You can make an instance only of a child class.<br />

Super class for:<br />

• HashtagSegmentInput Class<br />

• LinkSegmentInput Class<br />

• MentionSegmentInput Class<br />

• TextSegmentInput Class<br />

NewFileAttachmentInput Class<br />

Describes a new file to be attached to a feed item. The actual binary file, that is the attachment, is provided as part of the<br />

BinaryInput in the method that takes this attachment input, such as postFeedItem or postComment.<br />

Child class of FeedItemAttachmentInput Class<br />

Name<br />

description<br />

title<br />

Type<br />

String<br />

String<br />

Description<br />

Description of the file to be uploaded.<br />

File’s title<br />

PollAttachmentInput Class<br />

Used to attach a poll to a feed item.<br />

Child class of FeedItemAttachmentInput Class<br />

325


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

pollChoices<br />

Type<br />

List<br />

Description<br />

The text labels for the poll items. Polls<br />

must contain between 2 to 10 poll<br />

choices.<br />

TextSegmentInput Class<br />

Used to include a text segment in a feed item or <strong>com</strong>ment.<br />

Child class of MessageSegmentInput Class<br />

Name<br />

text<br />

Type<br />

String<br />

Description<br />

Plain text for this segment. If hashtags<br />

or links are detected in text, they are<br />

included in the <strong>com</strong>ment as hashtag and<br />

link segments. Mentions are not detected<br />

in text and are not separated out of the<br />

text. Mentions require<br />

MentionSegmentInput.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

In Connect in Apex, most methods produce rich output objects, which are instances of the following output classes.<br />

All properties for all output classes are read-only.<br />

All output classes are concrete unless marked abstract.<br />

All concrete output classes have no-argument constructors that can be invoked from test code only. You can write properties<br />

on these test objects and register values for methods that require test result registration.<br />

Actor Class<br />

Super class for:<br />

• ActorWithId Class<br />

Name<br />

name<br />

type<br />

Type<br />

String<br />

String<br />

Description<br />

Name of the actor, such as the group<br />

name<br />

One of the following:<br />

• file<br />

• group<br />

326


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

Type<br />

Description<br />

• unauthenticateduser<br />

• user<br />

• record type name—the name of<br />

the record type, such as<br />

myCustomObject__c<br />

ActorWithId Class<br />

Super class for:<br />

• <strong>Chatter</strong>Group Class<br />

• FileSummary Class<br />

• RecordSummary Class<br />

• UserSummary Class<br />

Child class of: Actor Class<br />

Name<br />

id<br />

motif<br />

mySubscription<br />

url<br />

Type<br />

String<br />

Motif<br />

Reference<br />

String<br />

Description<br />

Actor’s 18–character Id<br />

An icon that identifies the actor as a user,<br />

group, file, or custom object. The icon<br />

isn’t the user or group photo, and it isn’t<br />

a preview of the file.<br />

If the context user is following the item,<br />

this contains information about the<br />

subscription, else returns null.<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL for the<br />

resource<br />

Address Class<br />

Name<br />

city<br />

country<br />

formattedAddress<br />

state<br />

street<br />

zip<br />

Type<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

Name of the city<br />

Name of the country<br />

Formatted address per the locale of the<br />

context user<br />

Name of the state, province, or so on<br />

Street number<br />

Zip or postal code<br />

ApprovalAttachment Class<br />

Child class of FeedItemAttachment Class.<br />

327


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

id<br />

status<br />

Type<br />

String<br />

WorkflowProcessStatus Enum<br />

Description<br />

A work item ID.<br />

Specifies the status of a workflow process.<br />

• Approved<br />

• Fault<br />

• Held<br />

• NoResponse<br />

• Pending<br />

• Reassigned<br />

• Rejected<br />

• Removed<br />

• Started<br />

BasicTemplateAttachment Class<br />

Child class of FeedItemAttachment Class.<br />

Objects of this type are returned by attachments in FeedItems with type BasicTemplate.<br />

Property<br />

description<br />

icon<br />

linkUrl<br />

subtype<br />

title<br />

Type<br />

String<br />

Icon Class<br />

String<br />

String<br />

String<br />

Description<br />

An optional description with a 500 character limit.<br />

An optional icon.<br />

An optional URL to a detail page if there is additional content<br />

that can’t be displayed inline. Do not specify linkUrl unless<br />

you specify a title.<br />

The subtype associated with the basic template feed item.<br />

Values are:<br />

•<br />

An optional title to the detail page. If linkUrl is specified,<br />

the title links to linkUrl.<br />

<strong>Chatter</strong>Activity Class<br />

Name<br />

<strong>com</strong>mentCount<br />

<strong>com</strong>mentReceivedCount<br />

likeReceivedCount<br />

Type<br />

Integer<br />

Integer<br />

Integer<br />

Description<br />

Total number of <strong>com</strong>ments in the<br />

organization made by the user<br />

Total number of <strong>com</strong>ments in the<br />

organization received by the user<br />

Total number of likes on posts and<br />

<strong>com</strong>ments in the organization received<br />

by the user<br />

328


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

postCount<br />

Type<br />

Integer<br />

Description<br />

Total number of posts in the<br />

organization made by the user<br />

<strong>Chatter</strong>Group Class<br />

Child class of ActorWithId Class.<br />

Name<br />

canHave<strong>Chatter</strong>Guests<br />

<strong>com</strong>munity<br />

Type<br />

Boolean<br />

Reference<br />

Description<br />

true if this group allows <strong>Chatter</strong><br />

Information about the <strong>com</strong>munity the<br />

group is in<br />

Note: Communities are<br />

available as a pilot program.<br />

description<br />

fileCount<br />

lastFeedItemPostDate<br />

memberCount<br />

myRole<br />

owner<br />

photo<br />

visibility<br />

String<br />

Integer<br />

Datetime<br />

Integer<br />

GroupMembershipType Enum<br />

UserSummary<br />

Photo<br />

GroupVisibilityType Enum<br />

Group’s description<br />

Number of files posted to this group.<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z of the most<br />

recent feed item posted to the group.<br />

Total number of group members<br />

Specifies the type of membership the user<br />

has with the group, such as group owner,<br />

manager, or member.<br />

• GroupOwner<br />

• GroupManager<br />

• NotAMember<br />

• NotAMemberPrivateRequested<br />

• StandardMember<br />

Information about the owner of the<br />

group.<br />

Information about the group photo<br />

Specifies whether a group is private or<br />

public. Valid values are:<br />

• PrivateAccess<br />

• PublicAccess<br />

329


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

<strong>Chatter</strong>GroupPage Class<br />

Name<br />

currentPageUrl<br />

groups<br />

nextPageUrl<br />

previousPageUrl<br />

Type<br />

String<br />

List<br />

String<br />

String<br />

Description<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL to this page of<br />

groups<br />

List of groups<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

next page of groups<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

previous page of groups<br />

<strong>Chatter</strong>Like Class<br />

Name<br />

id<br />

likedItem<br />

url<br />

user<br />

Type<br />

String<br />

Reference Class<br />

String<br />

UserSummary<br />

Description<br />

Like’s 18–character Id<br />

A reference to the liked <strong>com</strong>ment or feed<br />

item.<br />

Like’s <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL<br />

Like’s creator<br />

<strong>Chatter</strong>LikePage Class<br />

Name<br />

currentPageToken<br />

currentPageUrl<br />

likes<br />

nextPageToken<br />

nextPageUrl<br />

previousPageToken<br />

previousPageUrl<br />

total<br />

Type<br />

Integer<br />

String<br />

List<br />

Integer<br />

String<br />

Integer<br />

String<br />

Integer<br />

Description<br />

Token identifying the current page of<br />

likes<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

current page of likes<br />

List of likes<br />

Token identifying the next page of likes<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

next page of likes<br />

Token identifying the previous page of<br />

likes<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

previous page of likes<br />

Total number of likes across all pages<br />

330


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

ClientInfo Class<br />

Name<br />

applicationName<br />

applicationUrl<br />

Type<br />

String<br />

String<br />

Description<br />

Name of the Connected App used for<br />

authentication.<br />

Value from the Info URL field of the<br />

Connected App used for authentication<br />

Comment Class<br />

Name<br />

attachment<br />

body<br />

clientInfo<br />

createdDate<br />

feedItem<br />

id<br />

isDeleteRestricted<br />

likes<br />

likesMessage<br />

myLike<br />

parent<br />

type<br />

url<br />

Type<br />

FeedItemAttachment<br />

FeedBody<br />

ClientInfo<br />

Datetime<br />

Reference<br />

String<br />

Boolean<br />

<strong>Chatter</strong>LikePage<br />

MessageBody Class<br />

Reference<br />

Reference<br />

CommentType Enum<br />

String<br />

Description<br />

If the <strong>com</strong>ment contains an attachment,<br />

property value is ContentAttachment.<br />

If the <strong>com</strong>ment does not contain an<br />

attachment, it is null.<br />

Body of the <strong>com</strong>ment<br />

Information about the Connected App<br />

used to authenticate the connection<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

Information about the feed item<br />

Comment’s 18–character Id<br />

If this property is true the <strong>com</strong>ment<br />

cannot be deleted by the context user. If<br />

it is false, it might be possible for the<br />

context user to delete the <strong>com</strong>ment, but<br />

it is not guaranteed.<br />

The first page of likes for the <strong>com</strong>ment<br />

A message body that describes who likes<br />

the <strong>com</strong>ment.<br />

If the context user has liked the<br />

<strong>com</strong>ment, this property is a reference to<br />

the specific like, null otherwise<br />

Information about the parent feed-item<br />

for this <strong>com</strong>ment<br />

Specifies the type of <strong>com</strong>ment.<br />

• ContentComment—the <strong>com</strong>ment<br />

contains an attachment<br />

• TextComment—the <strong>com</strong>ment<br />

contains only text<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL to this<br />

<strong>com</strong>ment<br />

331


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

user<br />

Type<br />

UserSummary<br />

Description<br />

Information about the <strong>com</strong>ment author<br />

CommentPage Class<br />

Name<br />

<strong>com</strong>ments<br />

currentPageToken<br />

currentPageUrl<br />

nextPageToken<br />

nextPageUrl<br />

total<br />

Type<br />

List<br />

String<br />

String<br />

String<br />

String<br />

Integer<br />

Description<br />

Collection of <strong>com</strong>ments<br />

Token identifying the first page of<br />

<strong>com</strong>ments.<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

first page of <strong>com</strong>ments, that is, the most<br />

recent <strong>com</strong>ments.<br />

Token identifying the next page of<br />

<strong>com</strong>ments.<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

next page of <strong>com</strong>ments, that is, older<br />

<strong>com</strong>ments.<br />

Total number of <strong>com</strong>ments for the parent<br />

feed item<br />

Community Class<br />

Note: Communities are available as a pilot program.<br />

Name<br />

description<br />

id<br />

invitationsEnabled<br />

name<br />

sendWel<strong>com</strong>eEmail<br />

status<br />

url<br />

urlPathPrefix<br />

Type<br />

String<br />

String<br />

Boolean<br />

String<br />

Boolean<br />

CommunityStatus enum<br />

String<br />

String<br />

Description<br />

Community description<br />

Community Id<br />

User can invite other external users to the<br />

<strong>com</strong>munity<br />

Community name<br />

Send email to all new users when they<br />

join<br />

Specifies the current status of the<br />

<strong>com</strong>munity.<br />

• Active<br />

• Inactive<br />

• UnderConstruction<br />

Full URL to <strong>com</strong>munity<br />

Community-specific URL prefix<br />

332


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

CommunityPage Class<br />

Name<br />

<strong>com</strong>munities<br />

total<br />

Type<br />

List<br />

Integer<br />

Description<br />

List of <strong>com</strong>munities context user has<br />

access to<br />

Total number of <strong>com</strong>munities<br />

ComplexSegment Class<br />

ComplexSegments are only part of field changes.<br />

Super class for FieldChangeSegment Class<br />

Child class of MessageSegment Class<br />

This is an abstract class.<br />

Name<br />

segments<br />

Type<br />

List<br />

Description<br />

List of message segments.<br />

ContentAttachment Class<br />

Child class of FeedItemAttachment Class<br />

Objects of this type are returned by attachments in FeedItems with the type ContentPost.<br />

Name<br />

checkSum<br />

description<br />

downloadUrl<br />

fileExtension<br />

fileSize<br />

fileType<br />

hasImagePreview<br />

hasPdfPreview<br />

id<br />

isInMyFileSync<br />

mimeType<br />

renditionUrl<br />

title<br />

versionId<br />

Type<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Boolean<br />

Boolean<br />

String<br />

Boolean<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

MD5 checksum for the file<br />

Description of the attachment<br />

File’s URL<br />

File’s extension<br />

Size of the file in bytes. If size cannot be<br />

determined, returns unknown.<br />

Type of file<br />

true if the file has a preview image<br />

available, otherwise ,false<br />

true if the file has a PDF preview<br />

available, otherwise, false<br />

Content’s 18–character Id<br />

Reserved for future use<br />

File’s MIME type<br />

URL to the file’s rendition resource<br />

Title of the file<br />

File’s version number<br />

333


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

EntityLinkSegment Class<br />

Child class of MessageSegment Class<br />

Name<br />

motif<br />

reference<br />

Type<br />

Motif<br />

Reference<br />

Description<br />

A set of small, medium, and large icons<br />

that indicate whether the entity is a file,<br />

group, record, or user.<br />

A reference to the link object if<br />

applicable, otherwise, null.<br />

Feed Class<br />

Name<br />

feedItemsUrl<br />

isModifedUrl<br />

Type<br />

String<br />

String<br />

Description<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL of feed items<br />

A <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL with a<br />

since request parameter that contains<br />

an opaque token that describes when the<br />

feed was last modified. Returns null if<br />

the feed is not a news feed. Use this URL<br />

to poll a news feed for updates.<br />

FeedBody Class<br />

Child class of MessageBody<br />

No additional properties.<br />

FeedFavorite Class<br />

Name<br />

<strong>com</strong>munity<br />

Type<br />

Reference<br />

Description<br />

Information about the <strong>com</strong>munity that<br />

contains the favorite<br />

Note: Communities are<br />

available as a pilot program.<br />

createdBy<br />

feedUrl<br />

id<br />

lastViewDate<br />

name<br />

UserSummary<br />

String<br />

String<br />

Datetime<br />

String<br />

Favorite’s creator<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

feed item for this favorite<br />

Favorite’s 18–character Id<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

Favorite’s name<br />

334


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

searchText<br />

type<br />

url<br />

user<br />

Type<br />

String<br />

String<br />

String<br />

UserSummary<br />

Description<br />

If the favorite is from a search, contains<br />

the search text, otherwise, an empty<br />

string<br />

An empty string or one of the following<br />

values:<br />

• ListView<br />

• Search<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL to this favorite<br />

Information about the user who saved<br />

this favorite<br />

FeedFavorites Class<br />

Name<br />

favorites<br />

total<br />

Type<br />

List<br />

Integer<br />

Description<br />

Complete list of favorites<br />

Total number of favorites<br />

FeedItem Class<br />

Name<br />

actor<br />

attachment<br />

body<br />

canShare<br />

clientInfo<br />

<strong>com</strong>ments<br />

createdDate<br />

id<br />

isBookmarkedByCurrentUser<br />

isDeleteRestricted<br />

Type<br />

Actor<br />

FeedItemAttachment<br />

FeedBody<br />

Boolean<br />

ClientInfo<br />

CommentPage<br />

Datetime<br />

String<br />

Boolean<br />

Boolean<br />

Description<br />

The entity that created the feed item.<br />

Information about the attachment. If<br />

there is no attachment, returns null.<br />

The body of the feed item.<br />

true if the feed item can be shared,<br />

otherwise, false<br />

Information about the Connected App<br />

used to authenticate the connection.<br />

First page of <strong>com</strong>ments for this feed<br />

item.<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

Feed item’s 18–character Id<br />

true if the current user has bookmarked<br />

this feed item, otherwise, false.<br />

If this property is true the <strong>com</strong>ment<br />

cannot be deleted by the context user. If<br />

it is false, it might be possible for the<br />

335


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

isEvent<br />

isLikedByCurrentUser<br />

likes<br />

likesMessage<br />

modifiedDate<br />

myLike<br />

originalFeedItem<br />

originalFeedItemActor<br />

parent<br />

photoUrl<br />

preamble<br />

type<br />

Type<br />

Boolean<br />

Boolean<br />

<strong>Chatter</strong>LikePage<br />

MessageBody Class<br />

Datetime<br />

Reference<br />

Reference<br />

Actor<br />

ActorWithId<br />

String<br />

Message Body<br />

FeedItemType Enum<br />

Description<br />

context user to delete the <strong>com</strong>ment, but<br />

it is not guaranteed.<br />

true if feed item created due to an event<br />

change, otherwise, false<br />

true if the current user has liked this<br />

feed item, otherwise, false<br />

First page of likes for this feed item<br />

A message body the describes who likes<br />

the feed item.<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

If the context user has liked the feed<br />

item, this property is a reference to the<br />

specific like, otherwise, null.<br />

A reference to the original feed item if<br />

this feed item is a shared feed item,<br />

otherwise, null.<br />

If this feed item is a shared feed item,<br />

returns information about the original<br />

poster of the feed item, otherwise, returns<br />

null.<br />

Feed item’s parent<br />

URL of the photo associated with the<br />

feed item<br />

A collection of message segments,<br />

including the unformatted text of the<br />

message that you can use as the title of a<br />

feed item. Message segments include<br />

name, link, and motif icon information<br />

for the actor that created the feed item.<br />

Specifies the type of feed item, such as a<br />

content post, a text post, and so on.<br />

• ActivityEvent<br />

• ApprovalPost<br />

• AttachArticleEvent<br />

• BasicTemplateFeedItem<br />

• ChangeStatusPost<br />

• ChatTranscriptionPost<br />

• CollaborationGroupCreated<br />

• ContentPost<br />

• EmailMessageEvent<br />

• FacebookPost<br />

• LinkPost<br />

336


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

url<br />

visibility<br />

Type<br />

String<br />

FeedItemVisibilityType Enum<br />

Description<br />

• PollPost<br />

• RypplePost<br />

• ReplyPost<br />

• TextPost<br />

• TrackedChange<br />

• TwitterPost<br />

• UserStatus<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL to this feed<br />

item<br />

Specifies the type of users who can see a<br />

feed item.<br />

• AllUsers<br />

• InternalUsers<br />

FeedItemAttachment Class<br />

Child classes:<br />

• ApprovalAttachment Class<br />

• BasicTemplateAttachment Class<br />

• ContentAttachment Class<br />

• FeedPoll Class<br />

• LinkAttachment Class<br />

No additional properties. All instances of this class are actually one of the child classes.<br />

This is an abstract class.<br />

The <strong>com</strong>position of a feed may change between releases. Your code should always be prepared to handle unknown subclasses<br />

in both MessageSegment and FeedItemAttachment objects.<br />

FeedItemPage Class<br />

Name<br />

currentPageToken<br />

currentPageUrl<br />

isModifiedToken<br />

isModifiedUrl<br />

Type<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

Token identifying the first page of feed<br />

items<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

first page of feed items<br />

An opaque polling token to use in the<br />

since parameter of the<br />

<strong>Chatter</strong>Feeds.isModified method.<br />

The token describes when the feed was<br />

last modified.<br />

A <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL with a<br />

since request parameter that contains<br />

an opaque token that describes when the<br />

337


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

items<br />

nextPageToken<br />

nextPageUrl<br />

Type<br />

List<br />

String<br />

String<br />

Description<br />

feed was last modified. Returns null if<br />

the feed is not a news feed. Use this URL<br />

to poll a news feed for updates.<br />

List of feed items<br />

Token identifying the next page of feed<br />

items<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

next page of feed items<br />

FeedModifiedInfo Class<br />

Name<br />

isModified<br />

isModifiedToken<br />

nextPollUrl<br />

Type<br />

Boolean<br />

String<br />

String<br />

Description<br />

true if the news feed has been modified<br />

since the last time it was polled; false<br />

otherwise. Returns null if the feed is<br />

not a news feed.<br />

An opaque polling token to use in the<br />

since parameter of the<br />

<strong>Chatter</strong>Feeds.isModified method.<br />

The token describes when the feed was<br />

last modified.<br />

A <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL with a<br />

since request parameter that contains<br />

an opaque token that describes when the<br />

feed was last modified. Returns null if<br />

the feed is not a news feed. Use this URL<br />

to poll a news feed for updates. Make a<br />

request to this URL after requesting the<br />

URL in the Feed.isModifiedUrl or<br />

FeedItemPage.isModifiedUrl<br />

property.<br />

FeedPoll Class<br />

Child class of FeedItemAttachment Class.<br />

This object is returned as the attachment of FeedItems with type PollPost.<br />

Name<br />

choices<br />

myChoiceId<br />

Type<br />

List<br />

String<br />

Description<br />

List of choices for poll.<br />

ID of the poll choice that the current user<br />

has voted for in this poll. Returns null<br />

if the current user hasn’t voted.<br />

338


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

totalVoteCount<br />

Type<br />

Integer<br />

Description<br />

Total number of votes cast on the feed<br />

poll item.<br />

FeedPollChoice Class<br />

Name<br />

id<br />

position<br />

text<br />

voteCount<br />

voteCountRatio<br />

Type<br />

String<br />

Integer<br />

String<br />

Integer<br />

Double<br />

Description<br />

Poll choice Id<br />

The location in the poll where this poll<br />

choice exists. The first poll choice starts<br />

at 1.<br />

Label text associated with the poll choice<br />

Total number of votes for this poll choice<br />

The ratio of total number of votes for<br />

this poll choice to all votes cast in the<br />

poll. Multiply the ratio by 100 to get the<br />

percentage of votes cast for this poll<br />

choice.<br />

FieldChangeSegment Class<br />

Child class of ComplexSegment Class<br />

No additional properties.<br />

FieldChangeNameSegment Class<br />

Child class of MessageSegment Class<br />

No additional properties.<br />

FieldChangeValueSegment Class<br />

Child class of MessageSegment Class<br />

Name<br />

url<br />

Type<br />

String<br />

Description<br />

URL value if the field change is to a<br />

URL field (such as a web address)<br />

FileSummary Class<br />

Child class of ActorWithId Class<br />

Name<br />

checksum<br />

contentSize<br />

Type<br />

String<br />

Integer<br />

Description<br />

MD5 checksum for the file<br />

Size of the file in bytes<br />

339


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

contentUrl<br />

description<br />

downloadUrl<br />

fileExtension<br />

fileType<br />

flashRenditionStatus<br />

isInMyFileSync<br />

mimeType<br />

modifiedDate<br />

origin<br />

owner<br />

pdfRenditionStatus<br />

renditionUrl<br />

thumb120By90RenditionStatus<br />

thumb240By180RenditionStatus<br />

thumb720By480RenditionStatus<br />

title<br />

versionNumber<br />

Type<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Boolean<br />

String<br />

Datetime<br />

String<br />

UserSummary<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

If the file is a link, returns the URL,<br />

otherwise, the string “null”<br />

Description of the file<br />

URL to the file, that can be used for<br />

downloading the file<br />

Extension of the file<br />

Type of file, such as PDF, PowerPoint,<br />

and so on<br />

Specifies if a flash preview version of the<br />

file has been rendered<br />

Reserved for future use<br />

File’s MIME type<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

Specifies the file source. Valid values are:<br />

• <strong>Chatter</strong>—file came from <strong>Chatter</strong><br />

• Content—file came from content<br />

File’s owner<br />

Specifies if a PDF preview version of the<br />

file has been rendered<br />

URL to the rendition for the file<br />

Specifies if a 120x90–pixel–sized preview<br />

image of the file has been rendered<br />

Specifies if a 240x180–pixel–sized<br />

preview image of the file has been<br />

rendered<br />

Specifies if a 720x480–pixel–sized<br />

preview image of the file has been<br />

rendered<br />

Title of the file<br />

File’s version number<br />

FollowerPage Class<br />

Name<br />

currentPageUrl<br />

followers<br />

Type<br />

String<br />

List<br />

Description<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

current page<br />

List of subscriptions<br />

340


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

nextPageUrl<br />

previousPageUrl<br />

total<br />

Type<br />

String<br />

String<br />

Integer<br />

Description<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

next page<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

previous page<br />

Total number of followers across all<br />

pages<br />

FollowingCounts Class<br />

Name<br />

people<br />

records<br />

total<br />

Type<br />

Integer<br />

Integer<br />

Integer<br />

Description<br />

Number of people user is following<br />

Number of records user is following<br />

Total number of items user is following<br />

FollowingPage Class<br />

Name<br />

currentPageUrl<br />

following<br />

nextPageUrl<br />

previousPageUrl<br />

total<br />

Type<br />

String<br />

List<br />

String<br />

String<br />

Integer<br />

Description<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

current page<br />

List of subscriptions<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL of the next<br />

page<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL of the previous<br />

page<br />

Total number of records being followed<br />

across all pages<br />

GlobalInfluence Class<br />

Name<br />

percentile<br />

rank<br />

Type<br />

String<br />

Integer<br />

Description<br />

Percentile value for the user’s influence<br />

rank within the organization<br />

Number indicating the user’s influence<br />

rank, relative to all other users within the<br />

organization<br />

Group<strong>Chatter</strong>Settings Class<br />

A user’s <strong>Chatter</strong> settings for a specific group.<br />

341


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

emailFrequency<br />

Type<br />

GroupEmailFreqency Enum<br />

Description<br />

The frequency with which a group<br />

member receives email from a group.<br />

GroupMember Class<br />

Name<br />

id<br />

role<br />

url<br />

user<br />

Type<br />

String<br />

GroupMembershipType Enum<br />

String<br />

UserSummary<br />

Description<br />

User’s 18–character Id<br />

Specifies the type of membership the user<br />

has with the group, such as group owner,<br />

manager, or member.<br />

• GroupOwner<br />

• GroupManager<br />

• NotAMember<br />

• NotAMemberPrivateRequested<br />

• StandardMember<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL to this<br />

membership<br />

Information about the user who is<br />

subscribed to this group<br />

GroupMemberPage Class<br />

Name<br />

currentPageUrl<br />

members<br />

myMembership<br />

nextPageUrl<br />

previousPageUrl<br />

totalMemberCount<br />

Type<br />

String<br />

List<br />

Reference<br />

String<br />

String<br />

Integer<br />

Description<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL to this page of<br />

members<br />

List of group members<br />

If the context user is a member of this<br />

group, returns information about that<br />

membership, otherwise, null.<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

next page of members<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

previous page of members<br />

Total number of group members across<br />

all pages<br />

342


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

GroupMembershipRequest Class<br />

Name<br />

createdDate<br />

id<br />

lastUpdateDate<br />

requestedGroup<br />

responseMessage<br />

status<br />

url<br />

user<br />

Type<br />

Datetime<br />

String<br />

Datetime<br />

Reference<br />

String<br />

GroupMembershipRequestStatus<br />

Enum<br />

String<br />

UserSummary<br />

Description<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

ID for the group membership request<br />

object<br />

ISO8601 date string, for example,<br />

2011-02-25T18:24:31.000Z<br />

Information about the group the context<br />

user is requesting to join.<br />

A message for the user if their<br />

membership request is declined. The<br />

value of this property is used only when<br />

the value of the status property is<br />

Declined.<br />

The maximum length is 756 characters.<br />

The status of a request to join a private<br />

group. Values are:<br />

• Accepted<br />

• Declined<br />

• Pending<br />

URL of the group membership request<br />

object.<br />

Information about the user requesting<br />

membership in a group.<br />

GroupMembershipRequests Class<br />

Name<br />

requests<br />

total<br />

Type<br />

List<br />

Integer<br />

Description<br />

Information about group membership<br />

requests.<br />

The total number of requests.<br />

HashtagSegment Class<br />

Child class of MessageSegment Class<br />

Name<br />

tag<br />

Type<br />

String<br />

Description<br />

Text of the hashtag without the hash<br />

symbol (#)<br />

343


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

url<br />

Type<br />

String<br />

Description<br />

URL search for the tag in the format:<br />

/chatter/feed-items?q=search_text<br />

Icon Class<br />

Property<br />

height<br />

width<br />

url<br />

Type<br />

Integer<br />

Integer<br />

String<br />

Description<br />

The height of the icon in pixels.<br />

The width of the icon in pixels.<br />

The URL of the icon. This URL is available to unauthenticated<br />

users. This URL does not expire.<br />

LinkAttachment Class<br />

Child class of FeedItemAttachment Class<br />

Name<br />

title<br />

url<br />

Type<br />

String<br />

String<br />

Description<br />

Title given to the link if available,<br />

otherwise, null<br />

The link URL<br />

LinkSegment Class<br />

Child class of MessageSegment Class<br />

Name<br />

url<br />

Type<br />

String<br />

Description<br />

The link URL<br />

MentionSegment Class<br />

Child class of MessageSegment Class<br />

Name<br />

accessible<br />

name<br />

user<br />

Type<br />

Boolean<br />

String<br />

UserSummary<br />

Description<br />

Specifies whether the mentioned user can<br />

see mention when it is posted: true if<br />

the mentioned user can see the post,<br />

otherwise, false.<br />

Name of the user mentioned<br />

Information about the mentioned user<br />

344


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

MessageBody Class<br />

Superclass for FeedBody Class<br />

Name<br />

messageSegments<br />

text<br />

Type<br />

List<br />

String<br />

Description<br />

List of message segments that make up<br />

this message<br />

Formatted text of the message. This can<br />

be an easy summary to use if you don’t<br />

want to process all the message segments.<br />

MessageSegment Class<br />

Superclass for:<br />

• ComplexSegment Class<br />

• EntityLinkSegment Class<br />

• FieldChangeSegment Class<br />

• FieldChangeNameSegment Class<br />

• FieldChangeValueSegment Class<br />

• HashtagSegment Class<br />

• LinkSegment Class<br />

• MentionSegment Class<br />

• MoreChangesSegment Class<br />

• ResourceLinkSegment Class<br />

• TextSegment Class<br />

This is an abstract class.<br />

The <strong>com</strong>position of a feed may change between releases. Your code should always be prepared to handle unknown subclasses<br />

in both MessageSegment and FeedItemAttachment objects.<br />

Name<br />

text<br />

type<br />

Type<br />

String<br />

MessageSegmentType Enum<br />

Description<br />

Formatted text of the message.<br />

Textual summary of the message<br />

segment. The values correspond to the<br />

different child classes. Value are:<br />

• EntityLink<br />

• FieldChange<br />

• FieldChangeName<br />

• FieldChangeValue<br />

• Hashtag<br />

• Link<br />

• Mention<br />

• MoreChanges<br />

• Text<br />

345


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

MoreChangesSegment Class<br />

Child class of MessageSegment Class<br />

In feed items with a large number of tracked changes, the message is formatted as: "changed A, B, and made X more changes."<br />

The MoreChangesSegment contains the "X more changes."<br />

Name<br />

moreChangesCount<br />

Type<br />

Integer<br />

Description<br />

Number of additional changes<br />

Motif<br />

Each property in the motif class contains a URL to a small, medium, and large icon that indicates the <strong>Database</strong>.<strong>com</strong> record<br />

type. Common record types in <strong>Chatter</strong> are files, users, and groups, but all record types have a set of motif icons. Custom object<br />

records use their tab style icon. All icons are available to unauthenticated users so that, for example, you can display the motif<br />

icons in an email.<br />

Note: The motif images are icons, not user uploaded images or photos. For example, every user has the same set of<br />

motif icons.<br />

Custom object records use their tab style icon, for example, the following custom object uses the “boat” tab style:<br />

"motif": {<br />

"largeIconUrl": "/img/icon/custom51_100/boat64.png",<br />

"mediumIconUrl": "/img/icon/custom51_100/boat32.png",<br />

"smallIconUrl": "/img/icon/custom51_100/boat16.png"<br />

},<br />

Users use the following icons:<br />

"motif": {<br />

"largeIconUrl": "/img/icon/profile64.png",<br />

"mediumIconUrl": "/img/icon/profile32.png",<br />

"smallIconUrl": "/img/icon/profile16.png"<br />

},<br />

Groups use the following icons:<br />

"motif": {<br />

"largeIconUrl": "/img/icon/groups64.png",<br />

"mediumIconUrl": "/img/icon/groups32.png",<br />

"smallIconUrl": "/img/icon/groups16.png"<br />

},<br />

Files use the following icons:<br />

"motif": {<br />

"largeIconUrl": "/img/content/content64.png",<br />

"mediumIconUrl": "/img/content/content32.png",<br />

"smallIconUrl": "/img/icon/files16.png"<br />

},<br />

Note: To view the icons in the previous examples, preface the URL with https://instance_name. For example,<br />

https://instance_name/img/icon/profile64.png.<br />

346


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

largeIconUrl<br />

mediumIconUrl<br />

smallIconUrl<br />

Type<br />

String<br />

String<br />

String<br />

Description<br />

A large icon indicating the record type.<br />

A medium icon indicating the record<br />

type.<br />

A small icon indicating the record type.<br />

PhoneNumber Class<br />

Name<br />

phoneNumber<br />

type<br />

Type<br />

String<br />

String<br />

Description<br />

Phone number<br />

Values are:<br />

• Fax<br />

• Mobile<br />

• Work<br />

Photo Class<br />

Name<br />

fullEmailPhotoUrl<br />

largePhotoUrl<br />

photoVersionId<br />

smallPhotoUrl<br />

standardEmailPhotoUrl<br />

url<br />

Type<br />

String<br />

String<br />

String<br />

String<br />

String<br />

String<br />

Description<br />

A temporary URL to the large profile<br />

picture. The URL expires after 30 days<br />

and is available to unauthenticated users.<br />

URL to the large profile picture. The<br />

default width is 200 pixels, and the<br />

height is scaled so the original image<br />

proportions are maintained.<br />

18–character Id to that version of the<br />

photo<br />

URL to the small profile picture. The<br />

default size is 64x64 pixels.<br />

A temporary URL to the small profile.<br />

The URL expires after 30 days and is<br />

available to unauthenticated users.<br />

A resource that returns a Photo object:<br />

for example,<br />

/services/data/v27.0/chatter/users/005D0000001LL8OIAW/photo.<br />

RecordSummary Class<br />

Child class of ActorWithId Class<br />

No additional properties. This is a generic record which doesn’t have special child classes.<br />

347


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Reference Class<br />

Child class of MessageSegment Class<br />

Name<br />

id<br />

url<br />

Type<br />

String<br />

String<br />

Description<br />

18–character id of the object being<br />

referenced<br />

URL to the resource<br />

ResourceLinkSegment Class<br />

Name<br />

url<br />

Type<br />

String<br />

Description<br />

URL to the resource<br />

Subscription Class<br />

Name<br />

<strong>com</strong>munity<br />

id<br />

subject<br />

subscriber<br />

url<br />

Type<br />

Reference<br />

String<br />

Actor<br />

Actor<br />

String<br />

Description<br />

Information about the <strong>com</strong>munity in<br />

which the subscription exists<br />

Subscription’s 18–character Id<br />

Information about the parent, that is, the<br />

thing or person being followed<br />

Information about the subscriber, that<br />

is, the person following this item<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL to this specific<br />

subscription<br />

TextSegment Class<br />

Child class of MessageSegment Class<br />

No additional properties.<br />

User<strong>Chatter</strong>Settings Class<br />

A user’s global <strong>Chatter</strong> settings.<br />

Name<br />

defaultGroupEmailFrequency<br />

Type<br />

GroupEmailFrequency Enum<br />

Description<br />

The default frequency with which a user<br />

receives email from a group when they<br />

join it.<br />

UserDetail Class<br />

Child class of UserSummary Class<br />

348


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

aboutMe<br />

address<br />

chatterActivity<br />

chatterInfluence<br />

email<br />

followersCount<br />

followingCounts<br />

groupCount<br />

managerId<br />

managerName<br />

phoneNumbers<br />

username<br />

Type<br />

String<br />

Address<br />

<strong>Chatter</strong>Activity<br />

GlobalInfluence<br />

String<br />

Integer<br />

FollowingCounts<br />

Integer<br />

String<br />

String<br />

List<br />

String<br />

Description<br />

Text from user's profile<br />

User’s address<br />

<strong>Chatter</strong> activity statistics<br />

User’s influence rank<br />

User's email address<br />

Number of users following this user<br />

Information about items the user is<br />

following<br />

Number of groups user is following<br />

18–character Id of the user’s manager<br />

Locale-based concatenation of manager's<br />

first and last names<br />

Collection of user's phone numbers<br />

Username of the user, such as<br />

Admin@my<strong>com</strong>pany.<strong>com</strong>.<br />

UserGroupPage Class<br />

Name<br />

currentPageUrl<br />

groups<br />

nextPageUrl<br />

previousPageUrl<br />

total<br />

Type<br />

String<br />

List<br />

String<br />

String<br />

Integer<br />

Description<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

current page<br />

List of groups<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL of the next<br />

page<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL of the previous<br />

page<br />

Total number of groups across all pages<br />

UserPage Class<br />

Name<br />

currentPageToken<br />

currentPageUrl<br />

nextPageToken<br />

nextPageUrl<br />

Type<br />

Integer<br />

String<br />

Integer<br />

String<br />

Description<br />

Token identifying the current page<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

current page<br />

Token identifying the next page<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

next page<br />

349


Connect in Apex <strong>API</strong> Reference<br />

Output Classes<br />

Name<br />

previousPageToken<br />

previousPageUrl<br />

users<br />

Type<br />

Integer<br />

String<br />

List<br />

Description<br />

Token identifying the previous page<br />

<strong>Chatter</strong> <strong>REST</strong> <strong>API</strong> URL identifying the<br />

previous page<br />

List of user detail information. The items<br />

in this list can be downcast to<br />

UserDetails if the context user is not a<br />

<strong>Chatter</strong> customer.<br />

UserSummary Class<br />

Super class of UserDetail Class.<br />

Child class of ActorWithId Class.<br />

Name<br />

<strong>com</strong>panyName<br />

firstName<br />

isActive<br />

is<strong>Chatter</strong>Guest<br />

lastName<br />

photo<br />

title<br />

userType<br />

Type<br />

String<br />

String<br />

Boolean<br />

Boolean<br />

String<br />

Photo<br />

String<br />

UserType Enum<br />

Description<br />

Name of the <strong>com</strong>pany<br />

User's first name<br />

true if user is active, otherwise, false.<br />

true if user is a <strong>Chatter</strong> customer<br />

User's last name<br />

Information about the user's photos<br />

User’s title<br />

Specifies the type of user.<br />

• <strong>Chatter</strong>Guest—User is a <strong>Chatter</strong><br />

customer in an external group<br />

• Guest—Unauthenticated users<br />

• Internal—User is a tandard<br />

organization member<br />

• Portal—User is a Customer Portal<br />

User, a <strong>com</strong>munities user, and so on.<br />

• System—User is <strong>Chatter</strong> Expert or<br />

a system user<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

350


Connect in Apex <strong>API</strong> Reference<br />

Enums<br />

Enums<br />

An enum is data type whose values are constants. Use enums to define a fixed set of values that don’t have a numerical order,<br />

such as playing card suits or the seasons of the year.<br />

Connect in Apex enums inherit all properties and methods of Apex enums.<br />

Connect in Apex provides the following enums:<br />

Enum<br />

CommentType<br />

CommunityStatus<br />

Description<br />

Specifies the type of <strong>com</strong>ment.<br />

• ContentComment—the <strong>com</strong>ment contains an attachment<br />

• TextComment—the <strong>com</strong>ment contains only text<br />

Specifies the current status of the <strong>com</strong>munity.<br />

• Active<br />

• Inactive<br />

• UnderConstruction<br />

Note: Communities are available as a pilot program.<br />

FeedFavoriteType<br />

FeedItemAttachmentType<br />

FeedItemType<br />

Specifies the origin of the feed favorite, such as whether it’s a<br />

search term or a list view:<br />

• ListView<br />

• Search<br />

Specifies the type of the attachment, such as a link or a new<br />

file:<br />

• Approval<br />

• BasicTemplate<br />

• CaseComment<br />

• Content<br />

• DashboardComponent<br />

• ExistingContent<br />

• Link<br />

• NewFile<br />

• Poll<br />

Specifies the type of feed item, such as a content post, a text<br />

post, and so on.<br />

• ActivityEvent<br />

• ApprovalPost<br />

• AttachArticleEvent<br />

• BasicTemplateFeedItem<br />

• ChangeStatusPost<br />

• ChatTranscriptionPost<br />

351


Connect in Apex <strong>API</strong> Reference<br />

Enums<br />

Enum<br />

Description<br />

• CollaborationGroupCreated<br />

• ContentPost<br />

• EmailMessageEvent<br />

• FacebookPost<br />

• LinkPost<br />

• PollPost<br />

• RypplePost<br />

• ReplyPost<br />

• TextPost<br />

• TrackedChange<br />

• TwitterPost<br />

• UserStatus<br />

FeedItemVisibilityType<br />

FeedSortOrder<br />

FeedType<br />

GroupEmailFrequency<br />

Specifies the type of users who can see a feed item.<br />

• AllUsers<br />

• InternalUsers<br />

Specifies the order returned by the sort, such as by date created<br />

or last modified:<br />

• CreatedDateDesc<br />

• LastModifiedDateDesc<br />

Specifies the type of feed, such as a feed made up of<br />

bookmarks, groups, or records:<br />

• Bookmarks<br />

• Company<br />

• Files<br />

• Groups<br />

• News<br />

• People<br />

• Record<br />

• To<br />

• UserProfile<br />

Specifies the frequency with which a user receives email from<br />

a group.<br />

• EachPost<br />

• DailyDigest<br />

• WeeklyDigest<br />

• Never<br />

• UseDefault<br />

Do not use the value UseDefault in the<br />

<strong>Chatter</strong>Users.update<strong>Chatter</strong>Settings method<br />

because this method sets the default value.<br />

352


Connect in Apex <strong>API</strong> Reference<br />

Enums<br />

Enum<br />

GroupMembershipType<br />

GroupMembershipRequestStatus<br />

GroupVisibilityType<br />

MessageSegmentType<br />

UserType<br />

WorkflowProcessStatus<br />

Description<br />

Specifies the type of membership the user has with the group,<br />

such as group owner, manager, or member.<br />

• GroupOwner<br />

• GroupManager<br />

• NotAMember<br />

• NotAMemberPrivateRequested<br />

• StandardMember<br />

The status of a request to join a private group.<br />

• Accepted<br />

• Declined<br />

• Pending<br />

Specifies whether a group is private or public.<br />

• PrivateAccess<br />

• PublicAccess<br />

Specifies the type of message segment, such as text, link, field<br />

change name, or field change value.<br />

• EntityLink<br />

• FieldChange<br />

• FieldChangeName<br />

• FieldChangeValue<br />

• Hashtag<br />

• Link<br />

• Mention<br />

• MoreChanges<br />

• ResourceLink<br />

• Text<br />

Specifies the type of user.<br />

• <strong>Chatter</strong>Guest—User is a <strong>Chatter</strong> customer in an<br />

external group<br />

• Guest—Unauthenticated users<br />

• Internal—User is a tandard organization member<br />

• Portal—User is a Customer Portal User, a <strong>com</strong>munities<br />

user, and so on.<br />

• System—User is <strong>Chatter</strong> Expert or a system user<br />

Specifies the status of a workflow process.<br />

• Approved<br />

• Fault<br />

• Held<br />

• NoResponse<br />

• Pending<br />

• Reassigned<br />

353


Connect in Apex <strong>API</strong> Reference<br />

Exceptions<br />

Enum<br />

Description<br />

• Rejected<br />

• Removed<br />

• Started<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

Exceptions<br />

All exceptions support built-in methods for returning the error message and exception type. In addition to the standard<br />

exception class, Connect in Apex supports the following exceptions:<br />

Exception<br />

ConnectApiException<br />

NotFoundException<br />

RateLimitException<br />

Description<br />

Any logic error in the way your application is utilizing Connect<br />

in Apex. This is equivalent to receiving a 400 error with<br />

<strong>Chatter</strong> <strong>API</strong> in <strong>REST</strong>.<br />

Any issues with the specified resource being found. This is<br />

equivalent to receiving a 404 error with <strong>Chatter</strong> <strong>API</strong> in <strong>REST</strong>.<br />

When you exceed the rate limit. This is equivalent to receiving<br />

a 503 Service Unavailable error with <strong>Chatter</strong> <strong>API</strong> in <strong>REST</strong>.<br />

For more information on using exceptions in Apex, see “Using Exception Methods” in Force.<strong>com</strong> Apex Code <strong>Developer's</strong> <strong>Guide</strong>.<br />

See Also:<br />

Connect in Apex <strong>API</strong> Reference<br />

354


Index<br />

Index<br />

@ me resources 157<br />

A<br />

Access tokens 21<br />

Activity response body 220<br />

Adding member to a group 107<br />

Adding photo<br />

group 114<br />

user 193<br />

Address response body 219<br />

Approval<br />

feed item attachment 231<br />

Attach input<br />

existing content 206<br />

feed poll 206<br />

link 207<br />

new file upload 207<br />

B<br />

Batch information<br />

group-memberships resource 97<br />

Batch results<br />

item response body 219<br />

response body 219<br />

Batching information<br />

groups 105<br />

result item response body 219<br />

results response body 219<br />

users 174<br />

Bearer token 22<br />

Bookmarks<br />

feed items 48<br />

feed URL 47<br />

flat feed 51<br />

resources 47<br />

C<br />

<strong>Chatter</strong> <strong>API</strong><br />

cURL 13<br />

differences with other <strong>API</strong>s 2<br />

how to example 28<br />

named resources 7<br />

quick reference 28<br />

resources 2<br />

rich input 8<br />

selecting the right <strong>API</strong> 2<br />

URLs 7<br />

using 2<br />

wildcards 12<br />

<strong>Chatter</strong> resource 52<br />

<strong>Chatter</strong> response bodies<br />

activity 220<br />

directory 221<br />

influence 221<br />

ClientInfo response body 221<br />

Comments<br />

access 53<br />

delete 53<br />

input 208<br />

likes 55<br />

on feed items 73<br />

page response body 222<br />

resources 53<br />

response body 221<br />

Communities<br />

building URL 7<br />

Company feed<br />

feed items 57<br />

resources 56<br />

URL 56<br />

Connect<br />

resource 58<br />

Conversations<br />

change status 177<br />

detail response body 224<br />

input 218<br />

summary collection response body 225<br />

summary detail response body 224<br />

unread count 178<br />

unread count response body 225<br />

D<br />

Dashboard <strong>com</strong>ponent snapshot<br />

input 209<br />

Deleting photo<br />

group 114<br />

user 193<br />

Directory response body 221<br />

E<br />

Error message response body 225<br />

Error responses 263<br />

Error with output<br />

response body 225<br />

Examples<br />

@mentions 39<br />

activity status 35<br />

add <strong>com</strong>ments 30<br />

batch 39<br />

filter a response body 28<br />

follow record 38<br />

following list 35<br />

get feed items for a record 35<br />

get the news feed 34<br />

Java 131<br />

join group 36<br />

join private group 37<br />

like feed items 32<br />

link post 131<br />

355


Examples (continued)<br />

poll news feed for updates 33<br />

post @mentions 30<br />

post multiple @mentions 31<br />

post to group 37<br />

re<strong>com</strong>mendations 36<br />

request to join private group 36<br />

search a group feed 34<br />

search a record feed 34<br />

send private message 38<br />

share a feed item 32<br />

unfollow record 38<br />

uploading binary files 8<br />

user name auto<strong>com</strong>plete 39<br />

Explanation<br />

details response body 226<br />

summary response body 226<br />

F<br />

Favorite<br />

input 210<br />

page response body 227<br />

response body 226<br />

Favorites feed<br />

feed items 64<br />

list of favorites 60<br />

resources 60<br />

specific favorite 62<br />

Features response body 227<br />

Feed item attachment<br />

approval response body 231<br />

basic template response body 232<br />

content response body 232<br />

link response body 233<br />

poll response body 233<br />

Feed items<br />

accessing 69<br />

bookmark feed 48<br />

bookmarking 69<br />

<strong>com</strong>pany feed 57<br />

deleting 69<br />

favorites feed 64<br />

files feed 87<br />

groups feed 95<br />

input 211<br />

key prefix filtered feed 92<br />

news feed 123<br />

people feed 135<br />

record feed 139<br />

response body 229<br />

to feed 158<br />

user-profile feed 162<br />

Feed response bodies<br />

feed 228<br />

feed body 228<br />

feed directory 228<br />

feed directory item 229<br />

feed item 229<br />

feed item page 233<br />

feed item preamble 234<br />

feed modified info 234<br />

Feed response bodies (continued)<br />

feed poll choice 234<br />

Feed-items resources<br />

accessing specific feed item 69<br />

<strong>com</strong>ments 73<br />

likes 77<br />

polls 78<br />

query 68<br />

resources 67<br />

Feeds<br />

bookmarks resources 47<br />

<strong>com</strong>pany resources 56<br />

favorites resources 60<br />

files resources 86<br />

filter resources 90<br />

groups resources 94<br />

list resource 65<br />

news resource 120<br />

people resources 134<br />

record resource 138<br />

share an item 32<br />

to resources 157<br />

topics resource 160<br />

user-profile resources 161<br />

users resource 170<br />

Files<br />

feed item response body 237<br />

file details response body 236<br />

file page response body 236<br />

file response body 235<br />

files shares page response body 237<br />

group files 105<br />

input 212<br />

library response body 242<br />

uploading binary example 8<br />

Files feed<br />

feed items 87<br />

flat feed 88<br />

resources 86<br />

URL 86<br />

Files resources<br />

content 82<br />

file information in batch 86<br />

rendition 85<br />

shares 82<br />

specific file information 79<br />

user files, filtered by groups 181<br />

user files, filtered by sharing 182<br />

user files, general 178<br />

Filter a response body 28<br />

Filter feed<br />

flat feed 93<br />

key prefix 91<br />

key prefix feed items 92<br />

list of filters 90<br />

resources 90<br />

Filter response bodies 258<br />

Flat feed<br />

bookmarks feed 51<br />

files feed 88<br />

filtered feed 93<br />

groups feed 96<br />

Index<br />

356


Flat feed (continued)<br />

news feed 132<br />

people feed 136<br />

record feed 153<br />

response body 237<br />

to feed 159<br />

user-profile feed 169<br />

Follow record example 38<br />

Followers<br />

follower page response body 237<br />

record resource 155<br />

users resources 183<br />

Following<br />

following counts response body 238<br />

following page response body 238<br />

input 213<br />

records 184<br />

users 184<br />

G<br />

Group chatter settings<br />

input 213<br />

response body 239<br />

Group member<br />

input 214<br />

page response body 240<br />

response body 240<br />

Group membership<br />

request collection response body 241<br />

request response body 240<br />

Group Membership Request Update<br />

input 214<br />

Group-memberships batch resource 97<br />

Group-memberships resource 97<br />

Groups<br />

joining example 36<br />

joining private group example 37<br />

page response body 241<br />

posting example 37<br />

requesting membership 113<br />

requesting membership in a private group 110<br />

requesting status for membership requests 110<br />

requesting to join private group example 36<br />

response body 238<br />

Groups feed<br />

feed items 95<br />

flat feed 96<br />

resources 94<br />

URL 94<br />

Groups resources<br />

batching information 105<br />

files information 105<br />

groups in organization 101<br />

information 103<br />

members 107<br />

members requests for private groups 110<br />

membership request 113<br />

photo 114<br />

settings 116<br />

H<br />

Hash tags<br />

message segment input 215<br />

message segment response body 246<br />

I<br />

Icon response body 241<br />

Influence<br />

resource 117<br />

response body 221<br />

thresholds response body 242<br />

Inputs<br />

attachment:existing content 206<br />

attachment:feed poll 206<br />

attachment:link 207<br />

attachment:new file upload 207<br />

<strong>com</strong>ments 208<br />

conversation 218<br />

dashboard <strong>com</strong>ponent snapshot 209<br />

favorite 210<br />

feed item 211<br />

feed poll input 212<br />

file input 212<br />

following 213<br />

group chatter settings 213<br />

group member 214<br />

group membership request update 214<br />

message body 215<br />

message segment:hash tag 215<br />

message segment:link 215<br />

message segment:mention 215<br />

message segment:text 216<br />

messages 217<br />

PATCH 8<br />

photo 216<br />

POST 8<br />

PUT 8<br />

user chatter settings 216<br />

user message:recipient 217<br />

user message:recipient list 218<br />

J<br />

Java example 131<br />

L<br />

Library response body 242<br />

Likes<br />

access 118<br />

delete 118<br />

message response body 242<br />

on <strong>com</strong>ments 55<br />

on feed item 77<br />

page response body 243<br />

resource 118<br />

response body 242<br />

Link post examples 131<br />

Links<br />

attachment input 207<br />

Index<br />

357


Links (continued)<br />

feed item attachment 233<br />

message segment input 215<br />

message segment response body 246<br />

M<br />

Members of a group 107<br />

Mentions<br />

message segment input 215<br />

message segment response body 246<br />

Message body input 215<br />

Message segment input<br />

hash tag 215<br />

link 215<br />

mention 215<br />

text 216<br />

Message segment response body<br />

entity links 244<br />

field change 245<br />

field change name 245<br />

field change value 245<br />

hashtag 246<br />

link 246<br />

mention 246<br />

more changes 247<br />

resource link 247<br />

text 247<br />

Messages<br />

collection response body 244<br />

input 217<br />

response body 243<br />

user messages, specific 192<br />

Motif<br />

response body 248<br />

Motifs<br />

batch motifs resource 120<br />

resource 119<br />

Motifs resources 119<br />

N<br />

New file upload 207<br />

News feed<br />

feed items 123<br />

flat feed 132<br />

is-modified 122<br />

polling for updates 122<br />

polling for updates example 33<br />

resources 120<br />

URL 121<br />

O<br />

OAuth<br />

authentication 26<br />

user-agent flow 19<br />

Web server flow 15<br />

Organization<br />

resource 59<br />

response body 249<br />

response body, summary 249<br />

P<br />

Parent response body 249<br />

PATCH input 8<br />

People feed<br />

feed items 135<br />

flat feed 136<br />

resources 134<br />

URL 135<br />

Phone number response body 249<br />

Photo<br />

group 114<br />

input 216<br />

response body 250<br />

user 193<br />

Polling news feed for updates 33<br />

Polls<br />

attachment input 206<br />

feed item attachment 233<br />

feed poll choice response body 234<br />

feed poll input 212<br />

on feed items 78<br />

POST input 8<br />

PUT input 8<br />

Q<br />

Query feed items 68<br />

Quick reference 28<br />

Quickstart<br />

access token 25<br />

OAuth 25<br />

prerequisites 25<br />

R<br />

Index<br />

Recipient<br />

input 217<br />

list input 218<br />

Re<strong>com</strong>mendations<br />

response body 250<br />

specific action 197<br />

specific action and key prefix 199<br />

specific action and object category 197<br />

specific action and object ID 200<br />

Record feed<br />

feed items 139<br />

flat feed 153<br />

resources 138<br />

URL 138<br />

Records<br />

followers 155<br />

following 184<br />

record information 154<br />

resources 154<br />

RecordsResponse bodies<br />

record summary 251<br />

summary response body 251<br />

Reference response body 251<br />

Refresh tokens 21<br />

Request bodies<br />

attachment:existing content 206 358


Request bodies (continued)<br />

attachment:feed poll 206<br />

attachment:link 207<br />

attachment:new file upload 207<br />

<strong>com</strong>ments 208<br />

conversation 218<br />

dashboard <strong>com</strong>ponent snapshot 209<br />

favorite 210<br />

feed item 211<br />

feed poll input 212<br />

file input 212<br />

following 213<br />

group chatter settings 213<br />

group member 214<br />

group membership request update 214<br />

message body 215<br />

message segment:hash tag 215<br />

message segment:link 215<br />

message segment:mention 215<br />

message segment:text 216<br />

messages 217<br />

photo 216<br />

user chatter settings 216<br />

user message:recipient 217<br />

user message:recipient list 218<br />

Requesting membership in a group 113<br />

Requesting membership in a private group 110<br />

Resource link<br />

message segment response body 247<br />

Resources<br />

batch motifs 120<br />

bookmarks 47<br />

chatter 52<br />

<strong>com</strong>ments 53<br />

<strong>com</strong>pany feed 56<br />

connect 58<br />

error responses 263<br />

favorites 60<br />

feed-items 67<br />

feeds 65<br />

files 79<br />

files feed 86<br />

filter feed 90<br />

groups feed 94<br />

influence 117<br />

likes 118<br />

motifs 119<br />

organization 58<br />

people feed 134<br />

records 154<br />

relationships 44<br />

response bodies 219<br />

returns 219<br />

subscriptions 156<br />

Response bodies<br />

address 219<br />

batch result item 219<br />

batch results 219<br />

chatter activity 220<br />

chatter directory 221<br />

chatter influence 221<br />

Response bodies (continued)<br />

clientinfo 221<br />

<strong>com</strong>ment 221<br />

<strong>com</strong>ment page 222<br />

conversation detail 224<br />

conversation summary 224<br />

conversation summary collection 225<br />

conversation unread count 225<br />

error message 225<br />

error with output 225<br />

explanation details 226<br />

explanation summary 226<br />

favorite 226<br />

favorites page 227<br />

features 227<br />

feed 228<br />

feed body 228<br />

feed directory 228<br />

feed directory item 229<br />

feed item 229<br />

feed item attachment:approval 231<br />

feed item attachment:basic template 232<br />

feed item attachment:content 232<br />

feed item attachment:link 233<br />

feed item attachment:poll 233<br />

feed item page 233<br />

feed item preamble 234<br />

feed modified info 234<br />

feed poll choice 234<br />

file 235<br />

file details 236<br />

file page 236<br />

file shares page 237<br />

filtering 258<br />

flat feed 237<br />

flat feed item 237<br />

follower page 237<br />

following counts 238<br />

following page 238<br />

group 238<br />

group chatter settings 239<br />

group member 240<br />

group member page 240<br />

group membership request 240<br />

group membership request collection 241<br />

group page 241<br />

icon 241<br />

influence thresholds 242<br />

library 242<br />

like 242<br />

like message body 242<br />

like page 243<br />

message 243<br />

message collection 244<br />

message segment:entity link 244<br />

message segment:field change 245<br />

message segment:field change name 245<br />

message segment:field change value 245<br />

message segment:hashtag 246<br />

message segment:link 246<br />

message segment:mention 246<br />

Index<br />

359


Response bodies (continued)<br />

message segment:more changes 247<br />

message segment:resource link 247<br />

message segment:text 247<br />

motif 248<br />

organization 249<br />

organization summary 249<br />

parent 249<br />

phone number 249<br />

photo 250<br />

re<strong>com</strong>mendation 250<br />

reference 251<br />

shares 251<br />

subscription 252<br />

subscription page 252<br />

topics 253<br />

user chatter settings 253<br />

user detail 253<br />

user group page 255<br />

user page 255<br />

user settings 255<br />

user status 256<br />

user summary 256<br />

Rich input 8<br />

S<br />

Search feed items 68<br />

Selecting the right <strong>API</strong> 2<br />

Settings<br />

group 116<br />

users 201<br />

Shares response body 251<br />

Subscribing to a group 107<br />

Subscriptions<br />

page response body 252<br />

resource 156<br />

response body 252<br />

T<br />

Text<br />

message segment input 216<br />

message segment response body 247<br />

To feed<br />

feed items 158<br />

flat feed 159<br />

resources 157<br />

URL 158<br />

Tokens 21–22<br />

Topics<br />

resource 160<br />

response body 253<br />

trending topics resource 160<br />

U<br />

Unfollow record example 38<br />

Updating photo<br />

group 114<br />

user 193<br />

Uploading binary files 8<br />

URLs 7<br />

User chatter settings<br />

input 216<br />

response body 253<br />

User detail 257<br />

User response bodies<br />

user detail 253<br />

user group page 255<br />

user page 255<br />

user settings 255<br />

user status 256<br />

user summary 256<br />

User summary 257<br />

User-agent OAuth flow 19<br />

User-profile feed<br />

feed items 162<br />

flat feed 169<br />

resources 161<br />

URL 161<br />

Users resources<br />

batching information 174<br />

conversations 174<br />

conversations, change status 177<br />

conversations, specific 176<br />

conversations, unread count 178<br />

files, filtered by groups 181<br />

files, filtered by sharing 182<br />

files, general 178<br />

followers 183<br />

following records 184<br />

following users 184<br />

groups 186<br />

messages 186<br />

messages, specific 192<br />

photo 193<br />

re<strong>com</strong>mendations 194<br />

re<strong>com</strong>mendations for specific action 197<br />

re<strong>com</strong>mendations for specific action and object ID 200<br />

re<strong>com</strong>mendations, specific action and key prefix 199<br />

re<strong>com</strong>mendations, specific action and object category 197<br />

user information 172<br />

user profile information 173<br />

user settings 201<br />

user status 203<br />

W<br />

Web server OAuth flow 15<br />

Wildcards 12<br />

Index<br />

360

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!