# Using the Free API in an HTTP request

**URL:** <https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998>\
**Category:** Configuration\
**Created:** [February 27, 2023, 8:58am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998 "2023-02-27T08:58:11Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hizo](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Hizo](https://community.gladysassistant.com/u/Hizo)\
**Post date:** [February 27, 2023, 8:58am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/1 "2023-02-27T08:58:11Z")

</div>

Hello,

I have an issue with HTML requests.

I want to send myself an SMS via Free’s API, which does this very well and for free.

You just need to do:

> [https://smsapi.free-mobile.fr/sendmsg?user=XXXXXX&pass=XXXXXXX&msg=Super](https://smsapi.free-mobile.fr/sendmsg?user=XXXXXX&pass=XXXXXXX&msg=Super) Texte de la mort

But when I put this command in the HTML requests block, whether as POST or GET, it tells me:

> An error occurred during the request. Are you sure you filled out the form correctly?

However, the SMS messages do arrive.  
I tried treating the key/value pairs as headers; no more error message but also no more SMS.

This prevents saving the scene:

> An error occurred while saving your scene. Please check that all actions/triggers are filled in and correct.

Any idea?

Thanks

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 20, 2023, 3:55am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/2 "2023-03-20T03:55:17Z")

</div>

That seems fine to me

Have you managed to resolve your issue since?

---

<div class="post-metadata">

**Author:** ![Hizo](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Hizo](https://community.gladysassistant.com/u/Hizo)\
**Post date:** [March 20, 2023, 7:56am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/3 "2023-03-20T07:56:29Z")

</div>

I’m bypassing it via MQTT, but it’s not exactly practical…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 20, 2023, 8:01am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/4 "2023-03-20T08:01:04Z")

</div>

Did you have a quick look at Gladys’ logs when you got the error?

---

<div class="post-metadata">

**Author:** ![Hizo](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Hizo](https://community.gladysassistant.com/u/Hizo)\
**Post date:** [March 20, 2023, 8:14am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/5 "2023-03-20T08:14:29Z")

</div>

Not at all, can you remind me how to do it please?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 21, 2023, 1:31am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/6 "2023-03-21T01:31:36Z")

</div>

On the machine where you’re running Gladys:

```auto
docker logs gladys

```

---

<div class="post-metadata">

**Author:** ![Hizo](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Hizo](https://community.gladysassistant.com/u/Hizo)\
**Post date:** [March 21, 2023, 8:17am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/7 "2023-03-21T08:17:34Z")

</div>

There is no related message…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 22, 2023, 2:12am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/8 "2023-03-22T02:12:53Z")

</div>

Would you mind sending me the URL privately so I can test on my side?

---

<div class="post-metadata">

**Author:** ![Hizo](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Hizo](https://community.gladysassistant.com/u/Hizo)\
**Post date:** [March 22, 2023, 7:58am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/9 "2023-03-22T07:58:25Z")

</div>

It’s done

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 24, 2023, 3:55am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/10 "2023-03-24T03:55:16Z")

</div>

Hi @Hizo! I ran a test on my side this morning, and I didn’t see anything, everything is working.

You should have received an SMS «&nbsp;Test&nbsp;» ^^

Are you sure about what you’re doing?

---

<div class="post-metadata">

**Author:** ![Hizo](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Hizo](https://community.gladysassistant.com/u/Hizo)\
**Post date:** [March 24, 2023, 8:10am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/11 "2023-03-24T08:10:06Z")

</div>

Yes I received it last night 🙂

I know I’m not always lightning-fast but this…

 ![Screenshot_20230324_090723](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/0/03d3e3475f30b720e785982540ea461739464c5a.png)

I do receive an email…

For the test I only added this action and I tested on Firefox and Opera.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 24, 2023, 8:13am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/12 "2023-03-24T08:13:41Z")

</div>

Ok, I wasn’t doing the same thing — I created a scene, saved it, and ran it.

I’ll re-test with the same scenario as you.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 24, 2023, 8:18am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/13 "2023-03-24T08:18:04Z")

</div>

Ok this time I can reproduce it:

 ![Screenshot 2023-03-24 at 16.16.06](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/0/0271e4fb604b8ebdd6a68777239db9704c22f71e.png)

When making an API call via the «&nbsp;Try&nbsp;» button, the front-end doesn’t handle the API response missing the «&nbsp;Content-Type&nbsp;» header.

It’s just a display bug, but it doesn’t prevent using the scene.

If you create the scene, don’t click «&nbsp;try&nbsp;», just save it and click «&nbsp;Run&nbsp;» the scene to test. It should work without problems 🙂

Edit: I created a GitHub issue for the front-end bug:

> <https://github.com/GladysAssistant/Gladys/issues/1721>
>
> \<img width="377" alt="Screenshot 2023-03-24 at 16 16 06" src="https://user-image…s.githubusercontent.com/7365207/227463520-87708b35-dd64-427d-b3a3-0259fdd192c2.png"\>
> 
> https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/11?u=pierre-gilles

---

<div class="post-metadata">

**Author:** ![Hizo](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Hizo](https://community.gladysassistant.com/u/Hizo)\
**Post date:** [March 24, 2023, 8:24am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/14 "2023-03-24T08:24:10Z")

</div>

OK, thanks.

I can no longer reproduce it, but testing prevented me from saving the scene as indicated in the first message.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 24, 2023, 8:27am UTC](https://community.gladysassistant.com/t/utilisation-de-lapi-free-dans-requete-http/7998/15 "2023-03-24T08:27:12Z")

</div>

Sorry I just did one last test to check that my fix was good (it was literally 5 characters to change), now I’ll stop bothering you 😉

It will be included in the next version of Gladys, but you don’t need to wait, don’t use the «&nbsp;Try&nbsp;» button in the meantime!
