Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

Hi there,

In the push tutorial, it talks about updating the device, but where can I update the channels for the device?
https://devcenter.appery.io/tutorials...

I went here:
https://devcenter.appery.io/documenta...

However, this is confusing for me because it does not like the REST service I am used to using, or like an update service.

How do I make a service that updates the device collection so I can put in channels?

Thank you so much,

Logan

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Updating the Device Collection

Hello,

Please create a REST service with method=PUT for that request: https://devcenter.appery.io/documenta...

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

Hi Sergiy,

I created the REST service, here are the settings:

Image

And here is the REQUEST tab:

Image

However, I do not know what to put in the RESPONSE tab, so this is what happens when I run the test:

Image

How does it look this far?

Thanks so much,

Logan

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Updating the Device Collection

You use incorrect URL in that service: Image

Please change it to:
prehttps://api.appery.io/rest/push/reg/{deviceID}/pre

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

Ok, I just changed the URL, and now I am getting a different error, although I think it is very close to being right:

{
"status":400,
"uri":"https://api.appery.io/rest/push/reg/F...",
"response":{
"code":"PNDU002",
"description":"app id not specified"
}
}

Is this OK? Or should I change the URL again so it specifies the app id?

Thank you so much,

Logan

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Updating the Device Collection

Please add a header parameter "X-Appery-App-Id" with a GUID of your application.
Here is an example of the GUID:
Image

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

Alright, I added that and tested the service again, but it gave a 404 error for the deviceID, and I think it is because the REST service is not connected to the correct DB?

Should the service URL be connected to the URL of the DB?

Thanks so much,

Logan

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Updating the Device Collection

Please show us a request data from the network tab of that service, e.g.: https://developer.chrome.com/devtools...

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

Ok, here is the screenshot:

Image

Thank you so much,

Logan

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Updating the Device Collection

I need to know REQUEST data, not RESPONSE.

Return to “Issues”