Hi everyone. Is there a way to get a list of Devices with cURL? I tried to retrieve rows in a collection I created before and it works, but when I try to retrieve a list of devices (registrated for push notifications) it doesn't work.
Hi everyone. Is there a way to get a list of Devices with cURL? I tried to retrieve rows in a collection I created before and it works, but when I try to retrieve a list of devices (registrated for push notifications) it doesn't work.
Dear Alessandro,
You can do this only with X-Appery-Master-Key.
Do a GET request to code{database_url}/collections/_devices/code and specify
codeX-Appery-Database-Id/code and codeX-Appery-Master-Key/code.
As you need to use X-Appery-Master-Key it's better to do it via server code.
Hi Kateryna, thanks for the reply; I tried your solution but it still doesn't work.
I used both
https://appery.io/database/53a97544e4...
and
https://api.appery.io/rest/1/db/colle...
with no good results.
I put in the request header X-Appery-Database-Id and X-Appery-Master-Key.
Where am I wrong?
Hi Alessandro,
Here is ready solution for you:
1 Create REST service. Call it "getDevices".
2 Open this service.
3 Navigate to "Settings" tab and populate it with folowing settings: http://prntscr.com/4pevbj/direct
pre
URL - {database_url}/collections/_devices
Settings - your DB settings.
/pre
4 Open request tab. Navigate to "header" section. And add two parameters: http://prntscr.com/4pewf3/direct
pre
X-Appery-Database-Id - {database_id}
X-Appery-Master-Key - your DB master key
/pre
5 Navigate to "Test" tab and click "test".
6 You will get following result: http://prntscr.com/4pex55/direct
That's all.
Regards.
Thank you!
This helped me a lot.
Regards
I'd like to add that when adding a push notifcation to an app I use QuickBlox and must admit that it's one of the most convinient free third-party services I've ever used. Hope that helps.
Hello Vitaliy,
Thank you for this update!