Coder Social home page Coder Social logo

mite-api's Introduction

mite-api

Simple Node.js module to access the mite-api.

Getting Started

Install the module with: npm install mite-api

var miteApi = require('mite-api');
var mite = miteApi({
    account: 'account',
    apiKey: 'apiKey',
    applicationName: 'applicationName'
});

miteApi(options)

Available options are:

  • account - the name of your mite account
  • apiKey - your personal API-Key
  • applicationName - your application name. The mite-api wants to be identify all apps. Also the applicationName is set as the User-Agent-header in every request.
  • query - if set to true the apiKey is added to the url as api_key parameter. Otherwise the apiKey is in the X-MiteApiKey-header.

API-Methods

The optional options-object is passed as query parameters to the api-url. For example you can add properties to limit the output. See the mite-api for more information.

var options = {
    limit: 100,
    page: 2
};

// more complex example (http://mite.yo.lk/en/api/time-entries.html)
var options = {
    customer_id: 1,
    billable: true,
    from: '2012-01-01',
    to: '2012-12-31',
    group_by: 'project'
};

The done callback is called when the request has finished. The first parameter is an err and the second the result of the api-call.

  • mite.getAccount()
  • mite.getMyself()
  • mite.getTimeEntries([options], done)
  • mite.getDailyTimeEntries(year, month, day, [options], done)
  • mite.getTimeEntry(id, [options], done)
  • mite.addTimeEntry(entry, done)
  • mite.updateTimeEntry(id, entry, done)
  • mite.deleteTimeEntry(id, done)
  • mite.getUsers([options], done)
  • mite.getArchivedUsers([options], done)
  • mite.getUser(id, [options], done)
  • mite.getCustomers([options], done)
  • mite.getArchivedCustomers([options], done)
  • mite.getCustomer(id, [options], done)
  • mite.addCustomer(customer, done)
  • mite.updateCustomer(id, customer, done)
  • mite.deleteCustomer(id, done)
  • mite.getProjects([options], done)
  • mite.getArchivedProjects([options], done)
  • mite.getProject(id, [options], done)
  • mite.addProject(project, done)
  • mite.updateProject(id, project, done)
  • mite.deleteProject(id, done)
  • mite.getServices([options], done)
  • mite.getArchivedServices([options], done)
  • mite.getService(id, [options], done)
  • mite.addService(service, done)
  • mite.updateService(id, service, done)
  • mite.deleteService(id, done)

mite-api's People

Contributors

dependabot[bot] avatar der-on avatar ephigenia avatar marcel-devdude avatar moritzwachter avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.