You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not totally clear what the userKey and appKey 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
Error: HTTP-Code: 404
Message: Unknown API Status Code!
Body: {}
I saw other issues logged where people have set the configuration like this:
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'))
kpturner
changed the title
[question]: Having problems making a simple fetchUser API call
[question]: Having problems making a simple fetchUser API call + broken links in docs
Sep 4, 2023
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
The text was updated successfully, but these errors were encountered: