# Open API Gladys Plus , Route not found

**URL:** <https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808>\
**Category:** Configuration\
**Created:** [January 2, 2023, 10:52pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808 "2023-01-02T22:52:22Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 2, 2023, 10:52pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/1 "2023-01-02T22:52:22Z")

</div>

Good evening

Why, when I run

```auto
curl https://api.gladysgateway.com/api/v1/device/TOKEN

```

with the correct token and the correct subscription as well  
do I get this in return

```auto
{"status":404,"error_code":"NOT_FOUND","
```

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 3, 2023, 7:13am UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/2 "2023-01-03T07:13:56Z")

</div>

This is authentication with a Bearer token, so include it in the headers of your request.

---

<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:** [January 3, 2023, 8:17am UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/3 "2023-01-03T08:17:35Z")

</div>

@VonOx not for the Gladys Plus Open API!

@bong101 the route is not correct, «&nbsp;/state&nbsp;» is missing and you must make the API call as a POST:

```auto
POST https://api.gladysgateway.com/v1/api/device/state/YOUR_OPEN_API_KEY

Body:
{
    "device_feature_external_id": "mqtt:my-phone-presence",
    "state": 1
}

```

The documentation:

> **[Open API | Gladys Assistant](https://gladysassistant.com/fr/docs/plus/open-api/#envoyez-une-requ%C3%AAte-dapi)**
>
> Nous proposons l'Open API Gladys Plus pour permettre aux utilisateurs Gladys Plus d'envoyer des requêtes API depuis l'extérieur de leur réseau.

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 3, 2023, 8:26am UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/4 "2023-01-03T08:26:18Z")

</div>

My bad, I hadn’t noticed, I thought it was the REST API.

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 3, 2023, 12:00pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/5 "2023-01-03T12:00:34Z")

</div>

Come on !!!???  
I want the list of devices, so by following this [Gladys Assistant REST API documentation](https://apidoc.gladysassistant.com/#api-Device-get)

I was hoping to get a list …

---

<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:** [January 3, 2023, 12:11pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/6 "2023-01-03T12:11:41Z")

</div>

This API documentation corresponds to the Gladys local API, not the Gladys Plus Open API!

The local API can be accessed directly with a bearer token obtained via the login route.

What do you need this for?

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 3, 2023, 5:55pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/7 "2023-01-03T17:55:10Z")

</div>

As I said in another post here, I find there aren’t enough logs, especially in scenes.  
J’utilise Rundeck pour lancer pas mal de jobs de domotique…je voudrais donc faire mes scènes dans Rundeck (et ça ne me dérange pas).

API access is to check the states of devices, mainly read (GET) before or after manipulations in Gladys.

But it seems I didn’t understand, from the documentation, the difference between the APIs, and how to use them. I’ll read through it again

Olivier

---

<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:** [January 4, 2023, 8:30am UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/8 "2023-01-04T08:30:22Z")

</div>

For scenes, it’s something I’d like to add to Gladys: the ability to track the execution of scenes in the UI in a simple and clear way.

On that, we talked about it recently here if you’re interested:

> [@Voir les logs dans Gladys interface](https://community.gladysassistant.com/t/voir-les-logs-dans-gladys-interface/5066/12?u=pierre-gilles):
>
> Ma position n’a toujours pas changée, cf le dernier message smiley Je suis pour afficher des messages d’erreurs contextuelles aux bons endroits (voir même l’erreur brute quand l’erreur est inconnue), mais afficher les logs complètes, c’est pas vraiment la philosophie de Gladys. Aujourd’hui dans Gladys le sujet a bien évolué depuis puisqu’on a 2 pattern pour remonter des erreurs dans l’interface : Lorsque tu es dans Gladys et que tu fais une action «&nbsp;en directe&nbsp;» (ajouter une caméra, cliqu…

> [@bong101](#):
>
> But it seems I didn’t understand, in the documentation, the difference between the APIs, and how to use them. I’ll reread it.

Ok I understand better now.

In fact Gladys and Gladys Plus are two different things:

- Gladys is a local program that runs on your machine (Raspberry Pi, server, NAS) at home.  
This program has a REST API which is used by the local frontend and this API is documented here =\> [https://apidoc.gladysassistant.com](https://apidoc.gladysassistant.com) (the link you posted above)
- Gladys Plus is a cloud proxy that gives access to a user’s local instance from anywhere in the world. This proxy has an end-to-end encrypted Websockets API that allows you, when you access the frontend at [plus.gladysassistant.com](http://plus.gladysassistant.com), to see the same thing as your local instance. The Websockets API is for frontend use only and is not intended to be used by the user. This proxy also has an «&nbsp;Open API&nbsp;», which by its nature is not end-to-end encrypted (but is encrypted in transit via SSL), which allows sending sensor states and your phone’s locations to your local instance. Because of the nature of this API (not end-to-end encrypted), I haven’t for now added any read routes, only a few write routes. I can add read routes later but I want it to be clear with the community that if we add read routes (optional), the Gladys Plus proxy will therefore see the traffic passing through (which wasn’t the case before).

I hope my explanation is clear 😃

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 4, 2023, 2:52pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/9 "2023-01-04T14:52:00Z")

</div>

Thank you Pierre-Gilles

Being able to know whether we are in a scene, where we are in a scene, the date and time of the last executions (some may be instantaneous), graphically, visually, that would be nice

I think that to develop this, we should first start with logs/journals… and then do the graphical part, but I understand that the goal is ease of use… The majority here «&nbsp;tinker&nbsp;» a bit, not really Madame Michu, even if she is the target.

Then we entrust Gladys with our electricity or our water (if I start a watering pump, for example), and behind that, it’s 💰 money 💰 that is at stake… so we must be able to trace what happens

Regarding the use of the APIs, indeed, I will look into the internal API, but I don’t see in the docs how to proceed, how do we call the internal API?

Thanks again  
Olivier

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 6, 2023, 3:46pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/10 "2023-01-06T15:46:32Z")

</div>

We can close the matter, I was able to make progress… I’ll manage with my gladys-rundeck-Node-red

See 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:** [January 10, 2023, 8:35am UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/11 "2023-01-10T08:35:37Z")

</div>

Ok great, were you able to access the internal API in the end?

Sorry for the late reply — I’ve had a very busy period on my end!

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 11, 2023, 12:57pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/12 "2023-01-11T12:57:15Z")

</div>

no, because I don’t know how to do it… because, unless I’m mistaken, the page describes very well the info/actions that one can do with the API; however, how to use it, there’s nothing…

Busy start to the year? That’s a good sign

Olivier

---

<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:** [January 11, 2023, 7:41pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/13 "2023-01-11T19:41:49Z")

</div>

> [@bong101](#):
>
> no, because I don’t know how to do it… because unless I’m mistaken, the page describes very well the info/actions that one can do with the API, but how to use it, there’s nothing…

Indeed

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 11, 2023, 9:01pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/14 "2023-01-11T21:01:21Z")

</div>

Rundeck is a scheduler. I use it to create scenes, because I’ve already said it here: not enough logs. I run home automation and operational jobs on my Raspberry Pis. It is installed on a different Raspberry Pi than Gladys.

---

<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:** [January 11, 2023, 9:27pm UTC](https://community.gladysassistant.com/t/open-api-gladys-plus-route-not-found/7808/15 "2023-01-11T21:27:27Z")

</div>

> [@bong101](#):
>
> It’s installed on a different Raspberry Pi than Gladys

Ok! On the same network as the Gladys Pi?

If yes, in that case it’s fine you can use this local API 🙂

To use this API, you can first use the login route to retrieve an access token (POST /login. The doc: [Gladys Assistant REST API documentation](https://apidoc.gladysassistant.com/#api-User-LoginUser) ), by hitting the IP of your local Pi

Example, if your Pi is at 192.168.1.12, you do:

> POST 192.168.1.12/api/v1/login

With this as the POST body:

 ![Screenshot 2023-01-12 at 00.22.18](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/d/d7cf4bf79eff5638d4d743e6d10ffae4c4d34838.png)

Then, all the other routes are accessible by setting a header

> Authorization: Bearer YOUR\_ACCESS\_TOKEN

If you want to get inspiration from what is done on the front-end, open the Network tab while you browse the Gladys frontend and look at the parameters!
