orgsync-api
v0.4.2
Published
### WARNING: OrgSync API V3 is currently unstable
Downloads
4
Readme
OrgSync API Javascript Client
WARNING: OrgSync API V3 is currently unstable
To install, simply use Bower and add
'orgsync-api'
to your bower.json
. The same API is also duplicated
in Node.js via the npm package with the same name. On the browser you'll need
jQuery
for generating XHR and JSONP requests. superagent
is required for
generating requests in Node.js.
// Create an API instance.
var api = new OrgSyncApi();
// Login (optionally pass {key: yourKey} to the OrgSyncApi constructor).
api.login({
community_id: 123,
username: 'example',
password: 'example'
}, function (er) {
// Use the `get` method to request data.
api.get('/communities/2/orgs', function (er, data) {
if (er) return alert('Failed with error: ' + er);
alert('Everything went better than expected: ' + JSON.stringify(data));
});
// Or with parameters...
api.get('/communities/2/orgs', {page: 2}, function (er, data) { ... });
});