Skip to content

tomraithel/node-teamseer-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-teamseer-client

NPM version Build status

A simple Node client for the teamseer.com SOAP API.

Installation

npm install teamseer-client

Api coverage

Only getActiveUsers and getRecordsByUser are implemented at the moment.

Documentation

Creating a client

var teamseer = require('teamseer-client');

var client = new teamseer.Client({
	companyId: '12345',
	companyKey: 'abc123fghi456',
	apiVersion: '1_0_1'
});

getRecordsByUser Get records as array for one person

/**
 * Return all recorded days for a user within a given range
 * @param {string} userIdentifier Typically the users email
 * @param {string} fromDate The start date as YYYY-MM-DD
 * @param {string} toDate The end date as YYYY-MM-DD
 * @returns {Promise}
 */
client.getRecordsByUser('[email protected]', '2015-12-01', '2015-12-31').then(function(records) {
	console.log(records);
});

// Example output:
//[
//	{
//		date: '2015-12-21',
//		hasNotes: true,
//		needsApproval: true,
//		status: '22',
//		type: '00',
//		userIdentifier: '[email protected]'
//	},
//	{
//		date: '2015-12-22',
//		hasNotes: false,
//		needsApproval: true,
//		status: '22',
//		type: '00',
//		userIdentifier: '[email protected]'
//	}
//]

getActiveUsers Get a list of all active users

/**
 * Returns active users as an array
 * @returns {Promise}
 */
client.getActiveUsers().then(function(records) {
	console.log(records);
});

// Example output:
//
// [ '[email protected]',
//	'[email protected]',
//	'[email protected]',
//	'[email protected]',
//	'[email protected]',
//	'[email protected]' ]

Full Example

var teamseer = require('teamseer-client');

var client = new teamseer.Client({
	companyId: '12345',
	companyKey: 'abc123fghi456',
	apiVersion: '1_0_1'
});

client.getRecordsByUser('[email protected]', '2015-12-01', '2015-12-31').then(function(records) {
	console.log("success", records);
}, function(err) {
	console.log("error", err);
});

Changelog

  • 1.0.0 Initial release
  • 1.0.1 Using RxJs 5 beta
  • 1.0.2 Bugfix for result lists with only one item

License: ISC

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

About

A simple node client for the teamseer.com API

Resources

Stars

Watchers

Forks

Packages

No packages published