Troubleshooting HttpResponseException: Not Found

Hi,

I’m trying to connect to an API for a service I am using (https://developer.ngenic.se/).
I get responses for queries but one specific gives HttpResponseException: Not Found

The strange part is that the same query works when trying it in the Advanced rest client.
Is it possible to somehow get more specific info / logging regarding the Not found error?

The query that gives an error should present something like this
bild

I am using this code to log the output

try {
    httpGet(params) {resp ->
        log.debug "2 resp data: ${resp.data}"
    }
} catch (e) {
    log.error "error: $e"
}

}

Try the exact same content in Postman. It could be missing headers

I tried it and it works in postman but not in Smartthings

Ok, so I got a response from the API guys and it seems the url gets distorted.

Is should be /lates?type=temperature_C
They are seeing /latest%3Ftype%3Dtemperature_C in their logs.

Any ideas on how to prevent this?

I was getting the same error and was glad to at least see that the “?” in my path was the likely culprit. I would have NEVER figured that out! I was able to test with a request that did not contain special characters successfully.

I discovered that if you get rid of “def params” and simply stick the full uri in the parenthesis after httpGet, then it works. So it would look like this:

httpGet (uri: “https://api…”)