Welcome to the Athom Community Forum! This is a place to share ideas, ask for help and discuss about Homey in general.

Please read Welcome to the forum to get started.
SDK2

Web API

Is it possible to return something other than JSON by adding endpoints to the REST API? I was reading and experimenting with the api.js (https://apps.developer.athom.com/tutorial-Web Api.html), but whatever I return gets wrapped in a JSON object. In my case, I would like to return plain text, preferably with a custom content-type. Is this at all possible?
Tagged:

Comments

  • lubbertkramerlubbertkramer Moderator
    edited January 30
    Kyrcio said:
    Is it possible to return something other than JSON by adding endpoints to the REST API? I was reading and experimenting with the api.js (https://apps.developer.athom.com/tutorial-Web Api.html), but whatever I return gets wrapped in a JSON object. In my case, I would like to return plain text, preferably with a custom content-type. Is this at all possible?
    When you request it with your app/web app you can transform the JSON into anything you want offcourse but Athom will be giving access as described at the developers pages :) If you really would like to request a change  then you can always open up a request at the github of Athom
  • GeurtDijkerGeurtDijker Moderator, Backer - Geek Edition
    Guess you want one step further than this:
    https://github.com/athombv/homey/issues/1746

  • I suppose so, depending on how that was implemented. Normally REST uses HTTP status codes. It is strange to bake it into the response, but I guess there is a specific problem they are trying to solve.

    Maybe the web API is not supposed to be used to integrate with other HTTP-based devices? I could of course just open up another HTTP endpoint on another port, if that’s the way Athom intended it for apps.
Sign In or Register to comment.