# Rest API call for setting asleep

**URL:** <https://community.homey.app/t/rest-api-call-for-setting-asleep/12589>\
**Category:** Developers\
**Created:** [May 2, 2019, 8:54pm UTC](https://community.homey.app/t/rest-api-call-for-setting-asleep/12589 "2019-05-02T20:54:38Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![aste](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/aste/32/9729_2.png) [@aste](https://community.homey.app/u/aste)\
**Post date:** [May 9, 2019, 6:57am UTC](https://community.homey.app/t/rest-api-call-for-setting-asleep/12589/7 "2019-05-09T06:57:06Z")

</div>

Maybe all this is for nothing since the Bearer tokens now expire after 24h. I thought it was a bug in 2.1.1 fixed in 2.1.2. But it seems not. If this is the case, then Homey just lost a point until I can figure out how to authenticate properly.

> [@Authentication Bearer token is changing?](https://community.homey.app/t/authentication-bearer-token-is-changing/12231/2):
>
> This is in the firmware changelog for version 2.1.1: [Core] Sessions now expire after 1 day Athom made using the bearer token unusable for the sake of “security”. Suggested solution for your usecase was to use the webhook trigger card from the logica cards. This however exposes an unprotected endpoint where only the URL itself can hold some sort of “token”. The full URL would still be logged by webservers however (unlike using a token with the authorization header) and is therefor actually less…

---

_[View the full topic](https://community.homey.app/t/rest-api-call-for-setting-asleep/12589)._
