Page 1 of 2

Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 2:04 pm
by Andy Parker

Hi,

I've fought with this for a couple of days now and can't find out where I'm going wrong.

I've configure the app from the tutorial and successfully got push messages received on the phone when sent from the console.

I've now set up the REST services for registration and Push from app. I've got the registration working, I can see the entry in the database.

But, I cannot get the push from app working, all I get (when testing in the browser) is: POST https://api.appery.io/rest/push/msg 400 (Bad Request)

I've also ran the APK on the phone, I get an error from the Service as well. Not sure how to show the error message in the alert though.

I've posted the screenshots of the setup below in the hope this helps:
Image
Image
Image
Image
Image


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 2:33 pm
by Kateryna Grynko

Hi Andy,

Please share the app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.
What is the name of service?


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 2:38 pm
by Andy Parker

I've shared it, thanks Katya.

Service is called SendPushService.
App is called push notifications.

many thanks

Andy


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 2:42 pm
by Andy Parker

Also, it's on the second page, "sendpushnotifications", the first page "startScreen" is only for initialising push for the receiving of push notifications.


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 4:10 pm
by Maryna Brodina

Hello! You have to fill in service request fields: scheduledTime, timeZone and useDeviceTimeZone, it won't work without it.


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 4:18 pm
by Andy Parker

thanks Maryna,

I actually did that to get the response, and the test worked.

I have now tried using those parameters as well in the actual push service request, I dont get the error any longer :-) thanks for that, but I also didn't actually get a push to the device either?

Is there any way to get an immediate notification without scheduling?


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 5:08 pm
by Andy Parker

Many thanks for this. I just received the first notification.

Can you tell me, is there a way to get the notification to be sent for now, or do I have to calculate the scheduled time every time?


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Mon Dec 09, 2013 8:49 pm
by Maryna Brodina

Instead request parameter schedule add parameter status with sent value


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Tue Dec 10, 2013 7:50 am
by Andy Parker

Fantastic! that worked a treat. Many thanks again.


Push from App - POST https://api.appery.io/rest/push/msg 400 (Bad Request)

Posted: Tue Dec 10, 2013 11:48 pm
by Jose Gandia Ferrero

Hi, I have the same problem...

I've configure the app from the tutorial and successfully got push messages received on the phone when sent from the console too.

The problem is the REST services for Push from app.

This is the Response in the test REST services

{
"status":"400 Bad Request",
"url":"https://api.appery.io/rest/push/msg",
"response":{
"code":"PNMN007",
"description":"Serialization error"
}
}

These are the screenshot of configuration Rest service.

Can you help me? Image Image Image