GEO+JSON Parsing

I am new to Groovy development and working to pull data from an api that only supports a content-type of geo+json. My code parses that headers but not the data. Any suggestions on to get the map created?

def str_uri = [
            uri: "https://api.weather.gov/alerts/active/zone/${settings.noaa_zone}", 
			headers: [
				"user-agent": "My Hubitat Driver (email_address)"
            ]
    try { 
            httpGet(str_uri) { str_uri_resp ->
            str_uri_resp.headers.each {
                log.debug "Response Header: ${it.name} : ${it.value}"

            }

            if (log_all_noaa == true) {
               log.debug "response contentType: ${str_uri_resp.contentType}"
                log.debug "response data: ${str_uri_resp.data}"
            }
            if (log_all_noaa == false) {
                log.info "NOAA Alert detailed logging disabled"
            }
    		
        }
        } catch (e) {
            log.error "NOAA _Alert ERROR: $e"
        }
1 Like

I tried doing this too before going on vacation.
I'm interested in how to do this as well (if possible in Hubitat).

Did you ever get this working? If so mind sharing the code?

1 Like

I have not had a chance to work on it lately. Never did get it working.

Someone was also working on similar code.

See this post for details

and the complete code here
https://community.hubitat.com/t/beta-noaa-severe-weather-alert/10944

1 Like