# Error 500: Internal Server Error trying to get access token

**URL:** <https://community.smartthings.com/t/error-500-internal-server-error-trying-to-get-access-token/55692>\
**Category:** Devices & Integrations\
**Created:** [August 25, 2016, 5:36pm UTC](https://community.smartthings.com/t/error-500-internal-server-error-trying-to-get-access-token/55692 "2016-08-25T17:36:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![giusee](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@giusee](https://community.smartthings.com/u/giusee)\
**Post date:** [August 25, 2016, 5:36pm UTC](https://community.smartthings.com/t/error-500-internal-server-error-trying-to-get-access-token/55692/1 "2016-08-25T17:36:52Z")

</div>

Hi everybody,  
I’m trying to get the **access token** in order to integrate SmartThings into my Android app.

I can get the “CODE” from the previous step (Get Authorization Code), but when I try to get the access token the system always returns:

_Oh No! Something Went Wrong!_  
_Error_  
_500: Internal Server Error_  
_URI_  
_/oauth/token_  
_Reference Id_  
_f3d5078d-150a-4f74-ac58-7da27b2c0a4a_  
_Date_  
_Thu Aug 25 17:21:35 UTC 2016_

This is the URL I use to make the POST:

[https://graph.api.smartthings.com/oauth/token?grant\_type=authorization\_code&code=tZcCph&client\_id=MY\_CLIENT\_ID&client\_secret=MY\_CLIENT\_SECRET&redirect\_uri=http://localhost](https://graph.api.smartthings.com/oauth/token?grant_type=authorization_code&code=tZcCph&client_id=MY_CLIENT_ID&client_secret=MY_CLIENT_SECRET&redirect_uri=http://localhost)

I saw there’re many other questions about this issue, but I could’t find a solution.

Does anybody knows why I always get this error?  
I tried also to change my redirect\_uri to [https://localhost](https://localhost), but nothing changed.

Thanks in advance,  
Giuseppe

---

<div class="post-metadata">

**Author:** ![Doug\_Beard](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/doug_beard/32/39132_2.png) [@Doug\_Beard](https://community.smartthings.com/u/Doug_Beard)\
**Post date:** [September 21, 2016, 2:10pm UTC](https://community.smartthings.com/t/error-500-internal-server-error-trying-to-get-access-token/55692/2 "2016-09-21T14:10:39Z")

</div>

Having the same trouble as of two days ago. This is definitely on the ST side. Support has been silent.

---

<div class="post-metadata">

**Author:** ![jasmin](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@jasmin](https://community.smartthings.com/u/jasmin)\
**Post date:** [October 3, 2016, 8:27am UTC](https://community.smartthings.com/t/error-500-internal-server-error-trying-to-get-access-token/55692/3 "2016-10-03T08:27:33Z")

</div>

I have the same problem. Do you know how to resolve it?

---

<div class="post-metadata">

**Author:** ![giusee](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@giusee](https://community.smartthings.com/u/giusee)\
**Post date:** [October 3, 2016, 8:43am UTC](https://community.smartthings.com/t/error-500-internal-server-error-trying-to-get-access-token/55692/4 "2016-10-03T08:43:01Z")

</div>

Yes, I solved the problem:  
before what I did was:

1. get CODE -\> OK
2. read jsonOBJ value from the response of the system -\> ERROR because I tried to get “token”, “expire” and also “REFRESH”. But I realized that SmartThings had no “refresh” field.  
So the only value I currently get from SmartThings auth are: “token” and “expires”.  
This solved my problem.

Giuseppe
