Skip to content
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]: Getting error 400 without any specific details #75

Closed
1 task done
sjorobekov opened this issue Jan 10, 2024 · 8 comments
Closed
1 task done

[Bug]: Getting error 400 without any specific details #75

sjorobekov opened this issue Jan 10, 2024 · 8 comments

Comments

@sjorobekov
Copy link

What's on your mind?

How should I understand what should be changed in my request?

Error: HTTP-Code: 400
Message: Bad Request
Body: {"errors":[{}]}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nan-li
Copy link
Contributor

nan-li commented Jan 10, 2024

Hi @sjorobekov, thank you for reporting. We are in the process of updating the error types. Can you share what request you were making that resulted in this failure?

@sjorobekov
Copy link
Author

sjorobekov commented Jan 11, 2024

Hi @sjorobekov, thank you for reporting. We are in the process of updating the error types. Can you share what request you were making that resulted in this failure?

Hi @nan-li. Thank you for your reply. I was experimenting with different data, and now it is working, and I don't remember what was the initial payload. So closing the issue

@nan-li
Copy link
Contributor

nan-li commented Jan 11, 2024

@sjorobekov Ok!
If you run into this again, please let us know, so we can work on a fix to make the errors more detailed.

@ansh
Copy link

ansh commented Jan 31, 2024

@sjorobekov Can you share your working code? I am getting 400 error when I try the code from the docs

@nan-li
Copy link
Contributor

nan-li commented Jan 31, 2024

Hi @sjorobekov,

Can you share the code you are running? Feel free to open a new issue with your details.

@p-janik
Copy link

p-janik commented Feb 12, 2024

Hey, I noticed recently that for example player returned by this lib doesn't contain app_id property. That was not the case before.

It looks like for example updatePlayer expects player argument (error thrown in our case was app_id must be a valid UUID), so adding app_id to the player resource before update call fixes the issue.

Hopefully it helps someone here.

@thorep
Copy link

thorep commented Feb 27, 2024

I also get 400 with no message of whats wrong.. if i remove external_id it works but i dont get an id in response..

async sendNotification(sub: string, message: PushMessage): Promise {
const notification = new OneSignal.Notification();
notification.app_id = process.env.ONESIGNAL_APPID;
notification.name = message.name;
notification.contents = message.contents;
notification.headings = message.headings;
notification.include_aliases = { alias_label: ['external_id'] };
notification.external_id = sub;
notification.target_channel = 'push';
const notificationResponse =
await this.client.createNotification(notification);
console.log(notificationResponse);
return notificationResponse;
}

@JoeDareZone
Copy link

JoeDareZone commented Mar 1, 2024

Hey, I noticed recently that for example player returned by this lib doesn't contain app_id property. That was not the case before.

It looks like for example updatePlayer expects player argument (error thrown in our case was app_id must be a valid UUID), so adding app_id to the player resource before update call fixes the issue.

Hopefully it helps someone here.

@p-janik Thank you so much! You are my hero, I was stuck on this for ages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants