pollDeviceToken

suspend fun pollDeviceToken(deviceCode: String): TraktAccessToken

Poll this endpoint to get the access token once the user has authorized the device. Use the interval from the device code response to determine polling frequency.

Status codes:

  • 200: Success - token returned

  • 400: Pending - user hasn't authorized yet, keep polling

  • 404: Not Found - invalid device_code

  • 409: Already Used - user already approved this code

  • 410: Expired - device_code has expired

  • 418: Denied - user explicitly denied this code

  • 429: Slow Down - polling too quickly

Parameters

deviceCode

The device_code from the device code response

See also