Query data from Appery DB

This forum contains topics that were moved from Get Satisfaction
Claes Dahlberg
Posts: 0
Joined: Tue Oct 21, 2014 3:40 pm

Query data from Appery DB

Post by Claes Dahlberg »

Hi, I've got a app that use ApperyDB data and I'd like to query this data from another database. Is this possible?

I'd like to query data from a Appery DB every five minutes and import this data to another Database. How would a HTTPS-request be written in order to do this?
How can I pass authentictaion in the request?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Query data from Appery DB

Post by Evgene Karachevtsev »

Hello Claes,

Unfortunately we do not have rest API for import and export databases. When you work with Appery.io database you can use the rest API described here
http://devcenter.appery.io/documentat...
I.e. you can, for example, read all data from the collections of one database and place it in the appropriate collection of another one.

Claes Dahlberg
Posts: 0
Joined: Tue Oct 21, 2014 3:40 pm

Query data from Appery DB

Post by Claes Dahlberg »

Hi Evgene,

I think I understand what you say but to just to be sure:

The Appery.db can't be accessed from another app than the apps developed with the appery development environment? WHat I'd like to do is to collect data with an android phone with a Appery app and store it to a appery.db collection. From this collection I will fetch data a couple of times a day and feed our backend systems with it after som conversion.

Kindest regards

Claes

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Query data from Appery DB

Post by Evgene Karachevtsev »

Claes

[quote:]The Appery.db can't be accessed from another app than the apps developed with the appery development environment?[/quote]

No, the database can be accessed from anywhere via rest API of Appery.io db.

[quote:]to collect data with an android phone with a Appery app and store it to a appery.db collection[/quote]

I think you won't have problems here.

[quote:]From this collection I will fetch data a couple of times a day and feed our backend systems with it after som conversion"[/quote]

And this should not be a problem too. Knowing the ID of the database, the name of the collection and maybe a master key (please read more about master key here: http://devcenter.appery.io/documentat... ) you can get all the data from the collection http://devcenter.appery.io/documentat...

Claes Dahlberg
Posts: 0
Joined: Tue Oct 21, 2014 3:40 pm

Query data from Appery DB

Post by Claes Dahlberg »

Great to hear but I can't get this working. I will access the REST-api from a HTTP-connector. I can't get the key and database ID right in the URL:

I've tried with this:

https://api.appery.io/rest/1/db/get?###################
https://api.appery.io/rest/1/db/colle...?###################

where ################### is database ID.

It doesn't work!

This is basics, I know but, I've spent hours on this without success.

Thanks!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Query data from Appery DB

Post by Evgene Karachevtsev »

Claes,

You should send Database-Id as a header parameter request, not in the query string

There is an example in the documentation

curl-X GET-H "X-Appery-Database-Id: 544a5cdfe4b03d005b6233b9"
https://api.appery.io/rest/1/db/colle...

Please see the screenshot of how it works from the Windows command line
Image

Post Reply