Parsing API Response

Hi,

long time reader first time writer, i decided this weekend to bite the bullet and try to write my first smart-app and Device handler for my fish tank sensor (seneye), not for any real reason except it has a very simple API and i have a quest to get everything i can to show up in smartthings, the problem i am having is it seems the response is always empty , i have confirmed in chrome, postman and using CURL that the API responds correctly, however the resp.data remains empty , after some googleling and going through the documentation i can find i am assuming this is because smartthings is unable to parse the response, has anyone had any experience with this ,

thanks in advance

Hi, im trying a smartapp but doesnt seem to lke the fact the response is JSON but the content type is test/html, il take a look at the CORE route may be a bit simpler

Thanks

Getting APIs to communicate like that is quite complicated, and I do not consider myself any sort of expert. However, my advice is to check out the ecobee Connect SmartApp code. You can find it by editing a SmartApp, opening the Simulator, and then there’s a button for sample code above the simulator. The ecobee Connect SmartApp handles all of the API communication for the ecobee devices. You can look at the device handler code for those, too, and see how they interact with the SmartApp. This sample code might provide some inspiration.

Cheers, il take a look, im pretty sure its something to do with the actual API having dodgy contextType as another API i tried worked just fine, i just cant seem to get the raw body so i can either manually parse or something, looks like the decorator just looks at it decides it cant parse so sets it to null…helpfully