Forge Component
(13)
Published on 7 May by OutSystems R&D
13 votes
Published on 7 May by OutSystems R&D

Hi,

I'm with a "Bad Request Error" when i try to set a tag on app login. In the first try the error appear, sometimes in the next i can do the login, othewise i try several times until login. Someone know how to fix that?

Hi Cynthia,

I am not sure how to fix your problem, but I might be able to help locate it better. I know from personal experience, that the "400 Bad Request" often happens, when one of the REST calls within the "OneSignalAPI"-Module fails (e.g. because you try to send a pushnotification to a userid that's not signed up for it). In your case most likely the "Editdevice" REST call, since that's the one used in the "SetTag"-action.

To pinpoint the problem, you should be able to open the "SetTag"-action in the OneSignalAPI-eSpace (top option in the right-click-menu of the "SetTag"-action in the "OneSignalAPI/Tags" Folder in the Logic tab of your mobile app). Add a breakpoint to the Start-node of the action and in the Debugger-Tab, choose your mobile app as "entry module" and start debugging. Monitor the input variables for the REST call and see if they are being set properly.

I hope this helps you locate the problem.

Best regards,
Michael

I had this issue when sending to a user ID that was not registered. I added the check for "No player id?" to "SendPushNotificationToUserId" in "OneSignalAPI"