post
https://api.trakt.tv/oauth/device/token
Use the device_code and poll at the interval (in seconds) to check if the user has authorized you app. Use expires_in to stop polling after that many seconds, and gracefully instruct the user to restart the process. It is important to poll at the correct interval and also stop polling when expired.
When you receive a 200 success response, save the access_token so your app can authenticate the user in methods that require it. The access_token is valid for 7 days. Save and use the refresh_token to get a new access_token without asking the user to re-authenticate. Check below for all the error codes that you should handle.
JSON POST Data
| Key | Type | Value |
|---|---|---|
code * | string | device_code from the initial method. |
client_id * | string | Get this from your app settings. |
client_secret * | string | Get this from your app settings. |
Status Codes
This method will send various HTTP status codes that you should handle accordingly.
| Code | Description |
|---|---|
200 | Success - save the access_token |
400 | Pending - waiting for the user to authorize your app |
404 | Not Found - invalid device_code |
409 | Already Used - user already approved this code |
410 | Expired - the tokens have expired, restart the process |
418 | Denied - user explicitly denied this code |
429 | Slow Down - your app is polling too quickly |
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…