# Troubleshooting API calls

{% hint style="info" %}
The examples in this section use `your_access_token` as a placeholder for an actual token.
{% endhint %}

## 401 Error

### Issue

A 401 error occurs when there is a bad Dispatch token or Global Commerce User API token.

### Resolution

Send an API call to identify where the token originated and when it expired. For example:

{% tabs %}
{% tab title="HTTP" %}

```http
GET /oauth20/access-tokens?token=your_access_token  HTTP/1.1
Host: api.digitalriver.com
```

{% endtab %}
{% endtabs %}

The response shows you where the token originated in the domain field and when it expired in the `expiresIn` field.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/troubleshooting-api-calls.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
