RallyTools / rally-node

A Node.js Toolkit for Accessing Rally's Webservice API
MIT License
53 stars 25 forks source link

Create / Query Webhooks #31

Closed joshwegener closed 7 years ago

joshwegener commented 7 years ago

I'm trying to query the webhooks, but I get an error:

{ Error: Not able to parse artifact type: webhook
    at generateError (/var/www/nodejs/node_modules/rally/dist/request.js:38:11)
    at Request._callback (/var/www/nodejs/node_modules/rally/dist/request.js:118:22)
    at Request.self.callback (/var/www/nodejs/node_modules/request/request.js:187:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/var/www/nodejs/node_modules/request/request.js:1044:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Gunzip.<anonymous> (/var/www/nodejs/node_modules/request/request.js:965:12)
    at emitNone (events.js:91:20) errors: [ 'Not able to parse artifact type: webhook' ] }
restApi.query({
    type: 'webhook',
    limit: 100,
    fetch: ['AppName', 'AppUrl', 'Name', 'TargetUrl', 'Expressions'],
    scope: {
        up: false,
        down: true
    },
    requestOptions: {}
}, function(error, result) {
    if(error) {
        console.log(error);
    } else {
        console.log(result.Results);
    }
});

How would one create, update, query webhooks?

krmorse commented 7 years ago

The webhook api is separate from the standard web services api, so it may not work for you here. I can't say I've ever tried to use rally-node for working with webhooks or any of the other services outside of WSAPI...

You can probably just use a standard node package for working with that service. request, etc...