Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Add Chatter REST API calls #22

Open
tloebach opened this issue Nov 26, 2012 · 0 comments
Open

Add Chatter REST API calls #22

tloebach opened this issue Nov 26, 2012 · 0 comments

Comments

@tloebach
Copy link

Here is code for forcetk.js that adds in the ability to access Chatter.

/*
 * Retrieves field values for a Chatter record of the given type.
 * @param objtype object type; e.g. "comments"
 * @param id the record's object ID
 * @param [fields=null] optional comma-separated list of fields for which
 *               to return values; e.g. Name,Industry,TickerSymbol
 * @param callback function to which response will be passed
 * @param [error=null] function to which jqXHR will be passed in case of error
 */

forcetk.Client.prototype.chatter = function(objtype, id, fieldlist, callback, error) {
if (!arguments[4]) {
    error = callback;
    callback = fieldlist;
    fieldlist = null;
}
var fields = fieldlist ? '?fields=' + fieldlist : '';
this.ajax('/' + this.apiVersion + '/chatter/' + objtype + '/' + id
          + fields, callback, error);
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant