---
schema_version: "1"
id: 18be51a68cca1149c132d171f3a226c304ff6e7437a1d58107d6b8fcc69b27a6
title: Getting a List of Chatter Users
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/canvas-framework/guides/platform-connect/using/canvas-app-xhr-code-example-list-of-chatter-users.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-xhr-code-example-list-of-chatter-users.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b8bd4b9cca97a593d45b8708eeaf687a6c1a986b2a6761293a2129ff300df518
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Getting a List of Chatter Users

The following code example shows a call to return a list of Chatter users.

<!-- otherprops: set_clipboard -->
```java

// Paste the signed request string into a JavaScript object for easy access.
var sr = JSON.parse('<%=signedRequestJson%>');
// Reference the Chatter user's URL from Context.Links object.
var chatterUsersUrl = sr.context.links.chatterUsersUrl;

// Make an XHR call back to salesforce through the supplied browser proxy. 
Sfdc.canvas.client.ajax(chatterUsersUrl, 
    {client : sr.client,
    success : function(data){
    // Make sure the status code is OK.
    if (data.status === 200) {
        // Alert with how many Chatter users were returned.
        alert("Got back "  + data.payload.users.length + 
        " users"); // Returned 2 users
    }
}});
```

**See Also**  


-   [Cross-Domain XHR](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-xhr-intro.md)
-   [Context](https://developer.salesforce.com/docs/platform/canvas-framework/reference/context-object.md)
-   [Links](https://developer.salesforce.com/docs/platform/canvas-framework/reference/links-object.md)

