# API and XML

**URL:** <https://community.homey.app/t/api-and-xml/147492>\
**Category:** Developers\
**Created:** [December 21, 2025, 9:08am UTC](https://community.homey.app/t/api-and-xml/147492 "2025-12-21T09:08:12Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 9:08am UTC](https://community.homey.app/t/api-and-xml/147492/1 "2025-12-21T09:08:12Z")

</div>

Hello everyone,  
I am currently creating an application (hikvision support). It needs to receive HTTP POST calls. I have declared the API in the manifest and created my api.js file. The problem is that I am receiving XML messages from the equipment, so the body is empty. Do you know how to fix this?

Best Regards

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 21, 2025, 9:23am UTC](https://community.homey.app/t/api-and-xml/147492/2 "2025-12-21T09:23:16Z")

</div>

> [@Pierre\_V](#):
>
> Do you know how to fix this?

Looks like there’s a hardcoded limitation to only support JSON, so there’s not way to fix it with the built-in app API implementation and you may have to look into running a custom web server to accept these requests.

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 9:46am UTC](https://community.homey.app/t/api-and-xml/147492/3 "2025-12-21T09:46:18Z")

</div>

Thanks,  
I have already tried this solution, but I cannot open a custom port (3000).

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 21, 2025, 10:40am UTC](https://community.homey.app/t/api-and-xml/147492/4 "2025-12-21T10:40:01Z")

</div>

That shouldn’t be an problem, there are other apps that do the same. What error are you getting?

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 10:52am UTC](https://community.homey.app/t/api-and-xml/147492/5 "2025-12-21T10:52:49Z")

</div>

here my code

```auto
const http = require('http');

module.exports = class HikCamIsapiApp extends Homey.App {
   async onInit() {
      this.server = http.createServer(async (req, res) => {…});
      this.server.listen(3000, () => { this.log(‘Serveur HTTP lancé’); });
   }

```

When i call with curl  
`curl: (7) Failed to connect to XXXX port 3000 after 30 ms: Couldn’t connect to server`

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 21, 2025, 11:21am UTC](https://community.homey.app/t/api-and-xml/147492/6 "2025-12-21T11:21:10Z")

</div>

```auto
this.log(‘Serveur HTTP lancé’);

```

Invalid quote characters.

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 11:35am UTC](https://community.homey.app/t/api-and-xml/147492/7 "2025-12-21T11:35:01Z")

</div>

yes i know. It’s after copy/past.  
In my homey log i have that:  
`2025-12-21T10:49:08.079Z [log] [HikCamIsapiApp] Serveur HTTP lancé`  
So it’s seem to be good

But the curl call faild

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 21, 2025, 11:56am UTC](https://community.homey.app/t/api-and-xml/147492/8 "2025-12-21T11:56:21Z")

</div>

Sounds like a local issue, it’s working fine for me. Or are you using an external URL to connect to Homey?

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 11:59am UTC](https://community.homey.app/t/api-and-xml/147492/9 "2025-12-21T11:59:29Z")

</div>

no only local

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 12:20pm UTC](https://community.homey.app/t/api-and-xml/147492/10 "2025-12-21T12:20:13Z")

</div>

Which homey are you on? Apparently there’s a firewall on 2023?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 21, 2025, 12:45pm UTC](https://community.homey.app/t/api-and-xml/147492/11 "2025-12-21T12:45:32Z")

</div>

HP2023, and there is no firewall.

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 12:48pm UTC](https://community.homey.app/t/api-and-xml/147492/12 "2025-12-21T12:48:12Z")

</div>

very strange. Can you send me your code please?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 21, 2025, 1:10pm UTC](https://community.homey.app/t/api-and-xml/147492/13 "2025-12-21T13:10:23Z")

</div>

```auto
  async onInit() {
    this.server = http.createServer(async (req, res) => {
      this.log('received request');
      res.end('OK');
    });
    this.server.listen(3000, () => { this.log('Serveur HTTP lancé'); });
  }

```

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 1:17pm UTC](https://community.homey.app/t/api-and-xml/147492/14 "2025-12-21T13:17:21Z")

</div>

very strange …

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 4:29pm UTC](https://community.homey.app/t/api-and-xml/147492/15 "2025-12-21T16:29:45Z")

</div>

with `homey app run` → fail

with `homey app install` → Success ….

Who know why …?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 21, 2025, 4:36pm UTC](https://community.homey.app/t/api-and-xml/147492/16 "2025-12-21T16:36:53Z")

</div>

Ohhh, right, you need to use this:

```auto
homey app run --remote

```

Without `--remote`, your app will not be running on your Homey at all, but instead in a local Docker container.

I’ve asked Athom many times to update the documentation to make this clear, but they simply don’t care.

---

<div class="post-metadata">

**Author:** ![Pierre\_V](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_v/32/16433_2.png) [@Pierre\_V](https://community.homey.app/u/Pierre_V)\
**Post date:** [December 21, 2025, 4:39pm UTC](https://community.homey.app/t/api-and-xml/147492/17 "2025-12-21T16:39:53Z")

</div>

> [@robertklep](#):
>
> `homey app run --remote`

OOOOOOOOOh thank you verrrrrry much 🙂
