# Handling a promise response by an external api in an advanced flow

**URL:** <https://community.homey.app/t/handling-a-promise-response-by-an-external-api-in-an-advanced-flow/68297>\
**Category:** Flows\
**Tags:** flow, advancedflow\
**Created:** [September 1, 2022, 2:26pm UTC](https://community.homey.app/t/handling-a-promise-response-by-an-external-api-in-an-advanced-flow/68297 "2022-09-01T14:26:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_van\_Lier](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_van_lier/32/56539_2.png) [@Pierre\_van\_Lier](https://community.homey.app/u/Pierre_van_Lier)\
**Post date:** [September 1, 2022, 2:26pm UTC](https://community.homey.app/t/handling-a-promise-response-by-an-external-api-in-an-advanced-flow/68297/1 "2022-09-01T14:26:20Z")

</div>

I created an advanced flow that connects (get request) to an external API (Cemm/Cedel) to collect my solar production. If solar production exceeds target value, I start charging my EV.

Flow works flawless. However, quite often the external API returns not a response, but a promise… If that happens, the flow generates an error… Is there an advanced flow workaround that anybody knows of?

 ![Screenshot 2022-09-01 16.18.48](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/1/f199f1e3803fbb4e4b57aaf832772567d19f6020.png)

---

<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:** [September 1, 2022, 2:34pm UTC](https://community.homey.app/t/handling-a-promise-response-by-an-external-api-in-an-advanced-flow/68297/2 "2022-09-01T14:34:16Z")

</div>

> [@Pierre\_van\_Lier](#):
>
> However, quite often the external API returns not a response, but a promise

What’s a “promise response”?

---

<div class="post-metadata">

**Author:** ![Pierre\_van\_Lier](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pierre_van_lier/32/56539_2.png) [@Pierre\_van\_Lier](https://community.homey.app/u/Pierre_van_Lier)\
**Post date:** [September 1, 2022, 2:40pm UTC](https://community.homey.app/t/handling-a-promise-response-by-an-external-api-in-an-advanced-flow/68297/3 "2022-09-01T14:40:24Z")

</div>

A ‘promise reponse’ is not the data you need, but the word 'promise’with an extra code… Server sends it because it is busy…

{“promise”:“45b82393b6ac89f54bb3c8d0bdf6ec2159081715”}

you are then supposed to reissue your get request within 10 seconds once more where you add the promise code to the get url (in this case &promise=45b82393b6ac89f54bb3c8d0bdf6ec2159081715.

If all goes well, the server returns the the data you need and no further promise…
