pivotal-api
Pivotal API
Last updated 5 years ago by g3org3 .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install pivotal-api 
SYNC missed versions from official npm registry.

Pivotal-Tracker Api Module.

Interact with pivotal-tracker's api

Add it to your project

$ npm i --save https://github.com/g3org3/pivotal-api
  // Dependency
  const PivotalApi = require('pivotal-api')

  // User Token
  const Api = new PivotalApi(process.env.PIVOTAL_TOKEN)

Api

  • getMyinfo
  • getProjects
  • getAccounts
  • getAccountMembership

Get my info

  Api.getMyinfo((err, myInfo) => {
    if (err) console.log(err);
    else console.log(myInfo.name);
  });

  // Or if you like promises
  Api.getMyinfo()
  .then(res => console.log(res.name) )
  .fail(err => console.log(err) );

Get Projects

  Api.getProjects((err, projects) => {
    if (err) console.log(err);
    else console.log(projects);
  });

  // Or if you like promises
  Api.getMyinfo()
  .then(res => console.log(res) )
  .fail(err => console.log(err) );

Get Accounts

  Api.getAccounts((err, accounts) => {
    if (err) console.log(err);
    else console.log(projects);
  });

  // Or if you like promises
  Api.getAccounts()
  .then(res => console.log(res) )
  .fail(err => console.log(err) );

Get Account's Memberships

  Api.getAccountMemberships(account_id, (err, memberships) => {
    if (err) console.log(err);
    else console.log(memberships);
  });

  // Or if you like promises
  Api.getAccountMemberships(account_id)
  .then(res => console.log(res) )
  .fail(err => console.log(err) );

Get Accounts' Memberships

  // array of accounts with { id }
  // you could use the getAccounts response 
  // just with promises
  Api.getAccountsMemberships(accounts)
  .then(res => console.log(res) )
  .fail(err => console.log(err) );

Current Tags

  • 0.0.8                                ...           latest (5 years ago)

7 Versions

  • 0.0.8                                ...           5 years ago
  • 0.0.7                                ...           5 years ago
  • 0.0.6                                ...           5 years ago
  • 0.0.5                                ...           5 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |