> For the complete documentation index, see [llms.txt](https://atlas.anywhere.now/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atlas.anywhere.now/developer-docs/generic-dialogue-provider/authentication.md).

# Generic Dialogue Provider API authentication

Authenticate requests to the Generic Dialogue Provider API.

Generic Dialogue Provider API endpoints require bearer-token authentication unless the endpoint explicitly states otherwise.

## Authorization header

Send the token in the `Authorization` header:

| Header          | Value                   |
| --------------- | ----------------------- |
| `Authorization` | `Bearer <access-token>` |

## Access tokens

Token acquisition is handled by the Authentication Service configuration for the environment. The Generic Dialogue Provider service validates bearer JWTs with a configured signing key and token lifetime.

Use the token endpoint, regional host name, tenant-scoping model, and client-secret delivery flow supplied for the target environment. Do not copy legacy token URLs into new integrations unless AnywhereNow provides them for that environment.

## Example authenticated request

### Obtain an Access Token

Use the Authentication Service token endpoint supplied for this GDP environment. Its realm identifies the **AnywhereNow tenant**, not an interchangeable Microsoft Entra tenant ID. Obtain that identifier and the provider client secret through the supplied OnePortal or AnywhereNow contact route. The provider secret is separate from a Microsoft 365 sign-in application secret.

The documented GDP token request uses HTTP POST with form-encoded fields:

```bash
curl --request POST "<supplied-token-endpoint>" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "client_id=genericdialogueprovider" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "client_secret=<provider-client-secret>"
```

Use the client configuration supplied for your environment. The response includes `access_token`, `token_type`, and `expires_in`. Send the access token as a bearer token on API requests and use the returned expiry rather than assuming a fixed lifetime. This example does not define a refresh-token, credential-rotation, or recovery contract. Never store real credentials in shared examples or diagnostic output.

### Call the API

```bash
curl -X GET "<base-url>/api/v1/message/3657e938-d1ae-42f6-8b89-75e5e39f1be9" \
  -H "Authorization: Bearer <access-token>"
```

## Authentication errors

| Status                      | Description                                                                                                                       |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `401 Unauthorized`          | The bearer token is missing, invalid, expired, or cannot be validated by the service.                                             |
| `500 Internal Server Error` | The service could not process the request. The response body is not guaranteed; do not depend on a response body for this status. |

## Related topics

* [Generic Dialogue Provider API](/developer-docs/generic-dialogue-provider.md)
* [Messages, dialogues, and attachments](/developer-docs/generic-dialogue-provider/messages-and-dialogues.md)
* [Event subscriptions and callbacks](/developer-docs/generic-dialogue-provider/events.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://atlas.anywhere.now/developer-docs/generic-dialogue-provider/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
