Open kpturner opened 1 year ago
Well I finally got it working by providing no configuration at all
const configuration = OneSignal.createConfiguration({})
const client = new OneSignal.DefaultApi(configuration)
client
.fetchUser(process.env.ONESIGNAL_APP_ID as string, 'external_id', 'foo')
.then((data) => {
logger.debug(data, 'API called successfully. Returned data')
})
.catch((error) => logger.error(error, 'Error calling OneSignal'))
How can we help?
I cannot seem to make a simple
fetchUser
API call work. The documentation tells me to do it like so:It is not totally clear what the
userKey
andappKey
should be so I have assumed that this is the application key and REST API key from the "Keys & IDs" page on the OneSignal Dashboard.However, when I try that I just get
I saw other issues logged where people have set the configuration like this:
But that just gives me the same error.
I then found this: https://github.com/OneSignal/onesignal-node-api/blob/main/DefaultApi.md#fetchUser
But that does not work because
fetchUser
expects 3 (or 4) parameter, not 1.What am I doing wrong?
As an aside, this https://github.com/OneSignal/onesignal-node-api has broken or misleading links.
The link here does not take you to anywhere useful
And this link is broken
Code of Conduct