Skip to content

classy-org/classy-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

classy-api-client

Simple client for Classy API v2.

installation

$ npm install --save classy-api-client

usage

ApiClient.request(method, resource, postBody, authParams, callback)

const ApiClient = require('classy-api-client')({
  apiUrl: 'https://api.classy.org/2.0',
  oauthUrl: 'https://api.classy.org/',
  timeout: 10000,
  clientId: 'YOUR_ID'
  clientSecret: 'YOUR_SECRET'
});

// These keys are required for user-specific requests
const authParams = {
  grant_credentials: 'password',
  code: null,
  username: 'YOUR_USERNAME',
  password: 'YOUR_PASSWORD'
};

ApiClient.request('GET', '/me', null, authParams, (error, result) => {
  if (error) {
    console.log(error);
  } else {
    console.log(result);
  }
});

For non-user-specific requests, set authParams to null.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published