I love to hear about this sort of thing. I teach Thunkable to my students, too, in an elective for 7th and 8th graders. The educator category is so quiet around here… but I know there are teachers lurking.
Thanks, @muneer, I do hope that my tutorial is helpful.
That URL is a little complicated to reconstruct but I think I got it:
https://www.fema.gov/api/open/v2/DisasterDeclarationsSummaries? $filter=declarationDate gt '2021-01-01T04:00:00.000z' and state eq 'CA' and incidentType eq 'Fire'&$inlinecount=allpages
(I chose the year 2001, the state CA, and ‘Fire’ for the incident type).
I always test the URL in a browser before I worry about what’s happening in Thunkable.
I get this JSON response from that url… so to answer your question, it seems like FEMA is still working.
{"metadata":{"skip":0,"top":1000,"count":0,"filter":"declarationDate gt '2021-01-01T04:00:00.000z' and state eq 'CA' and incidentType eq 'Fire'","format":"json","metadata":true,"orderby":{},"select":null,"entityname":"DisasterDeclarationsSummaries","version":"v2","url":"/api/open/v2/DisasterDeclarationsSummaries?$filter=declarationDate%20gt%20%272021-01-01T04:00:00.000z%27%20and%20state%20eq%20%27CA%27%20and%20incidentType%20eq%20%27Fire%27&$inlinecount=allpages","rundate":"2021-03-04T05:46:18.301Z","DeprecationInformation":{"depDate":null,"deprecatedComment":"","depApiMessage":"","depNewURL":"","depWebMessage":""}},"DisasterDeclarationsSummaries": []}
When formatted, that looks like this:
You’re trying to get object → metadata → count. In my example, that value equals 0. You’re also trying to get object → DisasterDeclarationsSummaries → [first list item] → incidentBeginDate. In my example, that value is an empty array/list. So if I try to assign it to a label’s Text in Thunkable, I’m probably going to generate an error/crash.
This is why error checking is so important with APIs. You need to be prepared (FEMA term!) for missing or blank data such as that. And you should always check the green error block’s value. I use an If/else block in my projects to do that, which you can see starting at the 17:09 mark in the video @muneer linked to.