npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

workflowmax

v1.0.6

Published

Workflowmax API for Node.js

Downloads

7

Readme

WorkflowMax API for Node.js

Currently supported functions

client
 list([params])
 search([params])
 get(id, [params])
 add(data, [params])
 update(data, [params])
 archive(data, [params])
 delete(data, [params])

 getContact(id, [params])
 addContact(params)
 updateContact(id, params)
 deleteContact(id, params)

 rawGet(method, [params])
 rawPost(method, data,[params])
 rawPut(method, data, [params])
 rawDelete(method, data, [params])

lead
 list({ from: '20180101', to: '20190101', ...params })
 current([params])
 get(id, [params])
 add(data, [params])

 categories([params])

 rawGet(method, [params])
 rawPost(method, data,[params])
 rawPut(method, data, [params])
 rawDelete(method, data, [params])

categories
 list([params])

 rawGet(method, [params])
 rawPost(method, data,[params])
 rawPut(method, data, [params])
 rawDelete(method, data, [params])

staff
 list([params])

 rawGet(method, [params])
 rawPost(method, data,[params])
 rawPut(method, data, [params])
 rawDelete(method, data, [params])

job
 list({ from: '20180101', to: '20190101', ...params })
 current([params])
 get(id, [params])
 add(data, [params])
 update(data, [params])
 
 rawGet(method, [params])
 rawPost(method, data,[params])
 rawPut(method, data, [params])
 rawDelete(method, data, [params])

raw
 get(entity, method, [params])
 post(entity, method, data,[params])
 put(entity, method, data, [params])
 delete(entity, method, data, [params])

P.S. All unsupported methods can be reached via raw requests now

Usage

npm install workflowmax --save

or Yarn

yarn add workflowmax
var WorkflowMax = require('workflowmax');
var wfm = new WorkflowMax({ apiKey: 'YOUR_API_KEY', accountKey: 'YOUR_ACCOUNT_KEY'});

wfm.api.client.list()
  .then( function (clientList) {
    console.log(clientList);
  });

Raw requests

Currently not all API entities and methods have realisations in this API, but you can make raw requests.

You can use get, post, put, delete requests according to WorkflowMax documentation.

For example raw request for previous get client list code will be:

wfm.api.raw.get('client', 'list')
  .then( function (clientList) {
    console.log(clientList);
  });

Get client contact details via raw request:

wfm.api.raw.get('client', 'contact/10000004')
  .then( function (contactDetails) {
    console.log(contactDetails);
  });

All existing entity methods (e.g 'wfm.api.lead') also provide raw handlers.

They are called rawGet, rawPost, rawPut and rawDelete.

Example for client contact details:

wfm.api.client.rawGet('contact/10000004')
  .then( function (contactDetails) {
    console.log(contactDetails);
  });

Results

You will receive unmodified results in format that is used by WorkflowMax, kinda of XML.

Errors

Thrown errors:

General http errors and auth errors will be thrown as axios error instance without modification

Also some request errors (e.g. trying to least leads without from/to additional parameters) will be thrown as 500 error from WorkflowMax servers

Errors in results:

WorkflowMax sends errors in similar way as results, so we.

For example trying to get client using wrong id will result in:

<Response api-method="Get">
  <Status>ERROR</Status>
  <ErrorDescription>Invalid client identifier</ErrorDescription>
</Response>

While normal result will be like:

<Response api-method="Get">
  <Status>OK</Status>
  <Client>
    ...
  </Client>
</Response>

Examples

Examples are located at https://github.com/indemandly/workflowmax/tree/master/examples

To run examples:

  1. Clone repo & install dependencies:
git clone https://github.com/indemandly/workflowmax.git`
cd workflowmax
npm install
  1. Open examples/credentials.js and put your API keys obtained from WorkflowMax (how to get keys: https://www.workflowmax.com/api/authentication)

  2. List clients:

node ./examples/client/list

If you will get error at this step - check your credentials (step 2), to check your credentials in browser try this https://api.workflowmax.com/client.api/list?apiKey=YOUR_API_KEY&accountKey=YOUR_ACCOUNT_KEY

By default examples are using built version of this package, but you can change it in examples/instance.js by uncommenting one of lines:

const WorkflowMax = require('../build') // Built, node 4+ compatible

or

const WorkflowMax = require('../src') // ES6 (babel-node run)

P.S. to use source version you need to run scripts with babel-node e.g. babel-node ./examples/client/list

Building

If you want to make own build just use build command:

npm run build

or Yarn:

yarn build