> For the complete documentation index, see [llms.txt](https://docs.sentiance.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sentiance.com/sdk/api-reference/android/tokenresultcallback.md).

# TokenResultCallback

This interface is used with [`getUserAccessToken(TokenResultCallback)`](/sdk/api-reference/android/sentiance.md#getuseraccesstoken).

## TokenResultCallback API

### `onSuccess()`

> ```java
> void onSuccess(Token token)
> ```
>
> Called when the Sentiance SDK has a working token (either previously cached or newly obtained).

| Parameters |                                                                                              |
| ---------- | -------------------------------------------------------------------------------------------- |
| token      | A [`Token`](/sdk/api-reference/android/token.md) object containing token ID and expiry date. |

### `onFailure()`

> ```java
> void onFailure()
> ```
>
> Called when a token could not be obtained. This can happen if both of the following conditions are met:
>
> * The token has expired,
> * there is no network connection that can be used to get a new token from the Sentiance API.
