0.1.60 • Published 5 years ago

samanage v0.1.60

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Samanage.js

Samanage API implementation for NodeJS

NOTE: This lib is a work in progress. At the moment I'm implementing functionality that I utilize in my day job. I welcome all contributions and tips.

#TODO *Actually write this usage guide.

#Simple Usage

// These ID's are used for the resolution states for incidents. You can obtain these ID's by looking at the requests made through the GUI
let samanage = new (require('samanage'))({
    stateID: {
        resolved: 68591,
        on_hold: 68590,
        awaiting_input: 68589,
        assigned: 68588,
        "new": 68587
    }
});

// Bearer token
// You can get the bearer token from viewing your own profile as an admin in Samanage
samanage.auth({
    bearer: "xxxxxxx"
});

// Basic auth
samanage.auth({
    user: "user@domain.com",
    pass: "password"
});


let incidents = samanage.incidents();
let MessageTemplate = samanage.MessageTemplate;


let testMessage = new MessageTemplate()
                        .setTitle("Test title")
                        .setDescription("Test description")
                        .getMessageObject;

incidents.create(testMessage).then(function(result) {
    console.log(result.body);
});

#Searching

let incidents = samanage.incidents();

// Search can be a samanage URI or an object of key: value pairs. These pairs must be a field in your samanage instance to search
incidents.search({title: "test title*"}).then(function(res) {
    // returns res, body, page#
    
    console.log(res.body);
})
0.1.60

5 years ago

0.1.50

5 years ago

0.1.40

5 years ago

0.1.30

5 years ago

0.1.20

5 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago