Git Product home page Git Product logo

catchpoint-api's Introduction

CatchPoint API - JS Wrapper

Build Status codecov npm Known Vulnerabilities

JS based API wrapper to call catchpoint functionality (https://io.catchpoint.com/ui/help)

Contributing

  • Please open PR's against develop branch
  • Install dependencies via npm install and gulp via npm install -g gulp
  • Add functionality and contribute tests in the tests directory
  • run gulp test

Documentation

Initialization

  const CatchPointAPI = require('catchpoint-api');
  const catchPoint = new CatchPointAPI();

Authentication

  catchPoint.authorization.createSession({
    clientId: 'myClientId',
    clientSecret: 'myClientSecret'
  }).then((response) => {
    console.log("my token is: ", response.access_token);
  }).catch((error) => {
    console.error(error);
  })

Adding access token to client

  catchpoint.setAccessToken('myToken');

Auth Example

  const CatchPointAPI = require('catchpoint-api');
  const catchPoint = new CatchPointAPI();

  catchPoint.authorization.createSession({
    clientId: 'myClientId',
    clientSecret: 'myClientSecret'
  }).then((response) => {
    catchpoint.setAccessToken(response.access_token);
  }).catch((error) => {
    console.error(error);
  })

Nodes

Get all nodes

  • Requires authentication
  catchPoint.nodes.getAll().then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

Get specific node

  • Requires authentication
  catchPoint.nodes.getById({id: 123}).then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

Node Groups

Get all node groups

  • Requires authentication
  catchPoint.nodeGroups.getAll().then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

Get specific node group

  • Requires authentication
  catchPoint.nodeGroups.getById({id: 123}).then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

Folders

Get all folders with filtering.

  • Requires authentication
  const filterParams = {
    divisionId: 123, // optional
    productId: 1234, // optional
    parentFolderId: 1234, // optional
    statusId: 12, // optional
    name: 'name', // optional
    pageNumber: 1, // optional
    pageSize: 10 // optional
  };

  catchPoint.folders.getAll(filterParams).then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

Get specific folder

  • Requires authentication
  catchPoint.folders.getById({id: 123}).then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

Products

Get all products with filtering.

  • Requires authentication
  const filterParams = {
    divisionId: 123, // optional
    statusId: 12, // optional
    name: 'name', // optional
    pageNumber: 1, // optional
    pageSize: 10 // optional
  };

  catchPoint.products.getAll(filterParams).then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

Get specific product

  • Requires authentication
  catchPoint.products.getById({id: 123}).then((response) => {
    console.log(response);
  }).catch((error) => {
    console.error(error);
  })

catchpoint-api's People

Contributors

maxpresman 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.