Harsha Kuchampudi
Posts: 0
Joined: Tue Feb 11, 2014 11:11 pm

How do I fetch data from a JSON link?

Here is the API Access Endpoint: http://data.cityofgainesville.org/res...

I want to create a database that contains this information and updates whenever new data is added.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How do I fetch data from a JSON link?

Hello Harsha,

This can be done with update service http://docs.appery.io/documentation/b...

Harsha Kuchampudi
Posts: 0
Joined: Tue Feb 11, 2014 11:11 pm

How do I fetch data from a JSON link?

Thank you for your help. I am still having some trouble however. Could you please show me what I am supposed to have in the Update Service URL field so that I can fetch data directly from the aforementioned link? I don't understand
"{database_url}/collections/Active_Businesses/{object_id}"

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

How do I fetch data from a JSON link?

object_id would be the _id within the collections table Active_Businesses.

As you have within your JSON, a unique number, being ' "number" : "CE-13-01587" ' you would need to put a where clause.

Rather than search each object (the one in your database, and the one in JSON link) it would be faster to just update all fields with new data, even if the data has not changed.

I do all my calls old school, but here is the AJAX version:

code
url: 'https://api.appery.io/rest/1/db/collections/Active_Businesses/',
dataType: 'json',
data: {
where: '{"number" : response.number}'
},
/code

This would give you the _id (or Object_id), which you can then use to update the new data.

I am not expert and still learning Appery myself. But though i could help, as I had a problem like yours.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do I fetch data from a JSON link?

Thank you @Bad Addy!
@Harsha Kuchampudi please let us know if you have any questions.

Harsha Kuchampudi
Posts: 0
Joined: Tue Feb 11, 2014 11:11 pm

How do I fetch data from a JSON link?

@Bad Addy @Alena Prykhodko @Maryna Brodina

Thanks for your suggestions and help! I look into your suggestions and see what happens!

Return to “Issues”