> For the complete documentation index, see [llms.txt](https://trialkey.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trialkey.gitbook.io/docs/trialkey-licensing/reference/api-reference/getauthtokenuser.md).

# GetAuthTokenUser

## Gets UserName from a token

## Gets the UserName from an AuthToken

<mark style="color:blue;">`GET`</mark> `https://signup.trialkey.ca/api/v2/GetAuthTokenUser`

This endpoint allows a UserName to be looked up from an AuthToken. This can be used when using Quick Links to have a user log into your system via the TrialKey provided login page with your branding. Upon success, the system will redirect the user to the page you have specified in the dashboard along with the AuthToken as a query param. You can then use this AuthToken to ask TrialKey to validate it to find out who the user is via the GetAuthTokenUser() API, and then match them with your user profile in your own database/settings store.

Example URL:

<https://www.trialkey.ca/api/v2/GetAuthTokenUser?AuthToken=\\>\<AUTH\_TOKEN>\&AccountAPIToken=\<ACCOUNT\_API\_TOKEN>\&Domain=mywebsite.com

#### Query Parameters

| Name                                              | Type   | Description                                                                                                                                                                                                                       |
| ------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Domain<mark style="color:red;">\*</mark>          | String | Your account domain (i.e. the mywebsite.com part of [www.mywebsite.com](http://www.mywebsite.com))                                                                                                                                |
| AuthToken<mark style="color:red;">\*</mark>       | String | The AuthToken acquired from calling the DoLogin() API.                                                                                                                                                                            |
| AccountAPIToken<mark style="color:red;">\*</mark> | String | Your account API token from the profile screen in the TrialKey API dashboard. This key should be kept secret since it allows you to perform actions on your users such as deleting or modify them or their products and licenses. |

{% tabs %}
{% tab title="200 Call succeeded, user is authenticated and AuthToken returned" %}

```javascript
{
    "name"="Wilson",
    "owner": {
        "id": "sha7891bikojbkreuy",
        "name": "Samuel Passet",
    "species": "Dog",}
    "breed": "Golden Retriever",
}
```

{% endtab %}

{% tab title="404: Not Found Call failed, parameters missing or invalid, or UserName trial is expired" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Return Value:**  If any of the required parameters are missing, the call will fail with a 404 HTTP status code.

&#x20;

If the call succeeds, it will return the UserName as a string that corresponds to the `AuthToken` param.
{% endhint %}
