Rakesh
Posts: 0
Joined: Mon Apr 07, 2014 8:14 pm

Saving API data directly into Appery cloud DB

Hello!

I have a question about 3rd Party APIs and saving data to databases

  1. 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?

  2. 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

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Saving API data directly into Appery cloud DB

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...

Rakesh
Posts: 0
Joined: Mon Apr 07, 2014 8:14 pm

Saving API data directly into Appery cloud DB

Thanks Igor! I will read the documentation. I will update in case I have more questions.

Chris Neat
Posts: 0
Joined: Tue Oct 06, 2015 1:05 am

Saving API data directly into Appery cloud DB

How would this work? Can you use xml or JSON API results?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Saving API data directly into Appery cloud DB

For database format it would be easier to use JSON results.

Chris Neat
Posts: 0
Joined: Tue Oct 06, 2015 1:05 am

Saving API data directly into Appery cloud DB

Is there a simple example you could show? I'm not sure how I would parse, then place them in the database.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Saving API data directly into Appery cloud DB

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.

Return to “Issues”