# Questions about Rest API

**URL:** <https://community.gladysassistant.com/t/questions-sur-api-rest/6148>\
**Category:** Présentations\
**Created:** [February 26, 2021, 9:38pm UTC](https://community.gladysassistant.com/t/questions-sur-api-rest/6148 "2021-02-26T21:38:53Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [February 28, 2021, 11:08am UTC](https://community.gladysassistant.com/t/questions-sur-api-rest/6148/5 "2021-02-28T11:08:05Z")

</div>

Hello @Ook! For now, the Gladys 4 REST API is more for «&nbsp;internal&nbsp;» use within Gladys. There is not yet a long-term token mechanism to use the API externally (with an API key).

This is, however, a planned development, which is listed here:

> [@API ouverte avec jeton d'authentification longue durée](https://community.gladysassistant.com/t/api-ouverte-avec-jeton-dauthentification-longue-duree/5540):
>
> Dans la V3, il était possible de générer des jetons d’applications afin de faciliter l’accès à l’API REST en ajoutant &token=xxxxx dans l’appel. Cela faciliterait la création de script pour Automate ou Taskr

You can vote for the feature if you want to see it in Gladys 🙂

Out of curiosity, why would you like to use the API externally?

**In the meantime, two possibilities**

**1) The MQTT API**

If you want to send new device values, you can use the Gladys MQTT API (more explanations in the documentation), which is the cleanest option, in my opinion 🙂

**2) Use a «&nbsp;user&nbsp;» token as if you were the frontend**

If you really want to use the API in a script before API tokens are available, you can use the login flow in your script to retrieve an access\_token and a refresh\_token, then call the Gladys API with an access\_token in the «&nbsp;Authorization&nbsp;» header.

It’s less clean than using future API keys, but it gets the job done in the meantime 🙂

---

_[View the full topic](https://community.gladysassistant.com/t/questions-sur-api-rest/6148)._
