-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: createNotification returns HTTP-Code: 400 Message: Bad Request Body: {"errors":[{}]} #77
Comments
I figured it out. So, the documentation says to configure your app like this:
The problem is, that the API wants the API key. Not the USER_KEY_TOKEN and not the APP_KEY_TOKEN. once I changed the configuration, it started working:
Update: Setting the API KEY solved one problem, but the create Notification function kept throwing HTTP ERROR 400 with no understandable error descriptions in the body. I started experimenting with Postman to see what properties needs to be added to the notification object.
|
brilliant client side SDKs, absolutely esoteric server side sdk implementation lol |
Their documentation is absolutely garbage and has been since their existence. Who is going to setup a legit push notification service that doesn't implement a back-end solution for sending out notifications. WOW. This is unbelievable. Thank god you've provided this. I can't believe this has been open and unaddressed for 2 months! |
I mean someone could argument just stop beeing a react andy 🤣 |
I don't think that your comment is relevant, or constructive. |
I mean it was meant as a bad joke, obviously I stumbled upon this Issue because I had the same problem. |
@ArpadGBondor, I'm glad you figured this out. Looks like you got caught by a typo in our docs! What exists const configuration = OneSignal.createConfiguration({
userKey: '<YOUR_USER_KEY_TOKEN>',
appKey: '<YOUR_APP_KEY_TOKEN>',
}); What it should be const configuration = OneSignal.createConfiguration({
userKey: '<YOUR_USER_KEY_TOKEN>',
appKey: '<YOUR_API_KEY_TOKEN>', // just one letter off 🤦🏽♂️
}); This is confusing indeed, and I think the best course of action is to change the name of that key from I've gone ahead and updated the docs 🙏🏽 FYI there's a sample project for Node that shows how to correctly set this stuff up and even use some of the functions, albeit to a limited amount. |
In my case it was missing ENV keys. The error message was fixed when I downgraded to [email protected] |
What happened?
I'm trying to implement a function that we can use to send notifications using OneSignal.
The error I'm getting makes no sense to me.
Steps to reproduce?
What did you expect to happen?
Either create the notification, or give me an error message that makes sense.
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: