# Authentication

To access the Poplar API you'll need to use either a **Test** or **Production** Access Token. These can be found and generated on the [**API**](https://app.heypoplar.com/credentials) page of your account:

<div><figure><img src="https://content.gitbook.com/content/xfN4IIBsOUuqBd0ERnDW/blobs/k9YYQysU5vB5myGnkWlH/Screen%20Shot%202022-05-16%20at%2012.32.53%20PM.png" alt="" width="123"><figcaption></figcaption></figure> <figure><img src="https://content.gitbook.com/content/xfN4IIBsOUuqBd0ERnDW/blobs/ONwW4pAIsFi4XTX7weNv/Screen%20Shot%202022-05-16%20at%2012.35.51%20PM.png" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="danger" %}
**Never give your Access Token to a third party**

Your Access Token can give access to your private Poplar data and should be treated like a password. If you believe your Access Token has been compromised then it can be **Revoked.**
{% endhint %}

## How to use your Access Token

To use your Token, simply provide it as part of the authorization header when you make a request. Tokens use the bearer authorization header when you make a request.

```bash
curl \ 
-s https://api.heypoplar.com/v1/me \ 
-H 'Authorization: Bearer <access token>' \
-H 'Accept: application/json'
```

If you are using any of our client SDK's then this process is automated during initialization. This means that you do not need to specify this header explicitly.

### Testing

When creating a new access token, you have the option to create a *production* or *test* access token.&#x20;

{% hint style="warning" %}
Test tokens **ONLY** work for the **mailings** endpoin&#x74;**.** To test other endpoints use a production token.
{% endhint %}

Test access tokens are intended to support the testing of API integrations and can be identified by the `test` prefix. When using a test token, mailings will be generated in your account however they will not be mailed.&#x20;

From your campaigns **History** section, you can easily filter between test and production mailings:

<figure><img src="https://2043599786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfN4IIBsOUuqBd0ERnDW%2Fuploads%2FabqRr82K3HdDzPbMm3zf%2Fimage.png?alt=media&#x26;token=13574610-7df1-4e6f-95b5-9d4573be2fc8" alt=""><figcaption></figcaption></figure>
