# Rest-API

**URL:** <https://community.openhab.org/t/rest-api/48244>\
**Category:** Beginners\
**Tags:** openhab2\
**Created:** [July 23, 2018, 11:41am UTC](https://community.openhab.org/t/rest-api/48244 "2018-07-23T11:41:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [July 24, 2018, 1:27pm UTC](https://community.openhab.org/t/rest-api/48244/4 "2018-07-24T13:27:55Z")

</div>

Well, their REST API isn’t very standard. The standard way to do this is oauth2. When you are using oauth2 when your auth token expires you will get a 401 return code.

Searching around that doc it appears that they are at least doing that much. So the approach would be to make the call, if it returns a 401 instead of 200 return code you know the token is invalid and you need to go get a new one. You can see a similar example using oauth2 at [OAuth2 using just OH Rules and myopenhab.org](https://community.openhab.org/t/oauth2-using-just-oh-rules-and-myopenhab-org/46680).

---

_[View the full topic](https://community.openhab.org/t/rest-api/48244)._
