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

# Setting up the API

## Environmental variables to use:

<pre><code><strong>Cognito client ID: 6k5i4pgbvftapjjfv5gu1rkaot
</strong>REST API base endpoint: https://backend.app.ynteq.com/api/rest
API documentaiton link: https://app.ynteq.com/api-docs
</code></pre>

## Getting your access token:

1. Generate the refresh token (with an access token)

```
POST https://cognito-idp.eu-central-1.amazonaws.com/
```

Binary JSON data to attach to the request:

```

{
"AuthFlow": "USER_PASSWORD_AUTH",
"ClientId": "cognito_client_id",
"AuthParameters": {
"USERNAME": "user_email",
"PASSWORD": "user_password"
}
}
```

You can use the access token from the response, and after it had expired, refresh it with the step below.

2. Refresh the access token if needed with the refresh token

```
POST https://cognito-idp.eu-central-1.amazonaws.com/
```

Binary JSON data to attach to the request:

```
{
"AuthFlow": "REFRESH_TOKEN_AUTH",
"ClientId": "cognito_client_id",
"AuthParameters": {
"REFRESH_TOKEN": "provided_refresh_token_from_steps_above"
}
}
```

3. Use the provided access token to access the API

**Notes:**\
• all requests will be attached to the logged in user\
• please see the expiration time for the access token

Making requests

For further information, please check the API documentation under the sections below. To authenticate your requests, use the access token generated from steps above, and include it inside the Authorization\
header like this: `Bearer your-access-token.`
