Newer Version Available
Chatter REST API Architecture
To use Chatter REST API,
understand a few characteristics of its architecture, like how to authenticate, and which data
formats it supports.
- Authentication
- Chatter REST API uses OAuth 2.0.
- CORS (Cross-Origin Resource Scripting)
- Apex REST, Bulk API, Chatter REST API, User Interface API, Lightning Out, REST API, and Analytics REST API support CORS (cross-origin resource sharing). To access these APIs from JavaScript in a web browser, add the origin serving the script to the CORS whitelist. See Use CORS to Access Supported Salesforce APIs, Apex REST, and Lightning Out.
- Default HTML entity encoding
- Chatter REST API responses are minimally HTML
entity-encoded by default.
For non-HTML contexts, such as native mobile applications, Chatter REST API clients can request raw (unencoded) output. Set the X-Chatter-Entity-Encoding HTTP header in a request to false.
For more information, see Response Body Encoding.
- JSON and XML support
- The JavaScript Object Notation (JSON) format is supported with UTF-8. Date-time information is in ISO8601 format.
- XML serialization is similar to SOAP API. XML requests are supported in UTF-8 and UTF-16, and XML responses are provided in UTF-8.
- Responses are in JSON format by default. To specify XML, use the HTTP header Accept: application/xml. (To specify JSON, use Accept: application/json.)
- You can append either .json or .xml to the URI of any resource to specify how the return is formatted. For example, /chatter/feeds/filter/me/001/feed-elements.xml.
- Localized names and times
- Chatter REST API localizes both the names and datetimes to the locale setting of the user. Users set their locale in their personal information. If the user hasn’t set their locale, Chatter REST API uses the default locale for the organization.
- Clients can use any locale available in the organization to override the default locale. To override the locale for any API request, use the Accept-Language HTTP header.
- Salesforce ID length
- Salesforce IDs in response bodies are always 18 character IDs. In request bodies, you can use either 15 character IDs or 18 character IDs.
- UI Themes
- Clients can use the X-Connect-Theme HTTP header to specify a UI theme for any API request. There are 2 themes, each with their own set of motif icons: Classic and Salesforce1. Theme names are case-sensitive.
- Method overriding
- To override an HTTP method if you use an HTTP library that doesn’t allow
overriding or setting an arbitrary HTTP method name, use the request parameter _HttpMethod.
1POST https://instance_name/services/data/v41.0/chatter/ 2/chatter/users/me/conversations/03MD0000000008KMAQ 3?_HttpMethod=PATCH&read=true