Page 1 of 1
Saving API data directly into Appery cloud DB
Posted: Mon Apr 07, 2014 8:30 pm
by Rakesh
Hello!
I have a question about 3rd Party APIs and saving data to databases
I want to read data from a 3rd party API and write it directly into the Appery cloud database. While most of the tutorials show how to display the data returned from an API call in the UI, I also want to save the data directly into the DB. How may I do this?
How can I do the above as a backend only service, i.e. without creating a UI. I want to create a backend service that automatically hits a 3rd party API every 30 minutes and updates the database, like a batch process.
Thanks in advance!
Rakesh
Saving API data directly into Appery cloud DB
Posted: Tue Apr 08, 2014 12:01 am
by Igor
Hello,
If you want to migrate service data to the appery.io DB you need to:
1 Create "server code" which would get data from your external API and put it into the Appery DB.
2 Run this "Server code" manualy or with your appery.io application.
Please pass this tutorial to understand server code basics:
http://docs.appery.io/tutorials/creat...
If you want to understand server code deeply you can read this doc:
http://docs.appery.io/documentation/b...
Saving API data directly into Appery cloud DB
Posted: Tue Apr 08, 2014 12:04 am
by Rakesh
Thanks Igor! I will read the documentation. I will update in case I have more questions.
Saving API data directly into Appery cloud DB
Posted: Wed Oct 07, 2015 2:12 am
by Chris Neat
How would this work? Can you use xml or JSON API results?
Saving API data directly into Appery cloud DB
Posted: Wed Oct 07, 2015 9:04 am
by Illya Stepanov
For database format it would be easier to use JSON results.
Saving API data directly into Appery cloud DB
Posted: Wed Oct 07, 2015 8:51 pm
by Chris Neat
Is there a simple example you could show? I'm not sure how I would parse, then place them in the database.
Saving API data directly into Appery cloud DB
Posted: Thu Oct 08, 2015 10:53 am
by Illya Stepanov
Most of our examples in tutorials section uses JSON data as a response: https://devcenter.appery.io/tutorials...
or in this case in XML: https://devcenter.appery.io/tutorials...
your service should return a data preferably in JSON format, after that your script reads this data and runs database create (https://devcenter.appery.io/documenta...) or update (https://devcenter.appery.io/documenta...) methods.