can't get a list of users
Closed this issue · 4 comments
rstormsf commented
var opsgenie = require('opsgenie-sdk')
opsgenie.configure({
api_key: ''
})
async function main() {
const a = await opsgenie.user.list({})
console.log(a)
}
main()
undefined
undefined:1
No handler found for url /v1/json/user/
^
SyntaxError: Unexpected token N in JSON at position 0
at JSON.parse ()
DanCarlyon commented
Looks like : https://github.com/opsgenie/opsgenie-nodejs-sdk/blob/master/lib/resources/User.js#L6
Will need
var baseURL = '/v1/json/user/';
Changing to
var baseURL = '/v2/users/';
Based on: https://docs.opsgenie.com/docs/user-api
DanCarlyon commented
👋 @rstormsf Just thought I would let you know, as it doens't look like this repo will be updated i've created one: https://www.npmjs.com/package/opsgenie-sdk-revived
I plan to continue working and expanding on it, it currently includes the V2 User API
prakhar-mudaiya commented
@DanCarlyon Thanks for creating the PR. We will take it from here. @rstormsf we are working on it.