> For the complete documentation index, see [llms.txt](https://php-snap-bi.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://php-snap-bi.gitbook.io/docs/the-basics/authentication.md).

# Authentication

### Access token B2B

Of Course, you can request access token B2B with :&#x20;

```php
<?php

use Otnansirk\SnapBI\Services\SnapBi;
...

$token = SnapBi::bca()->accessTokenB2b();

```

For other than `Snap Bi::bca()`, you can use the supported Bank Support list [here](/docs/introduction.md#bank-support).

### Bearer Token B2B

You can use this method to make requests that require B2B access token authorization. You may only need this function if it is needed for api requests that require authorization b2b access token.

| Parameters | Required | Description                                                                                                                                  |
| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| token      | NO       | If not provided, the b2b token will be automatically requested from [accessTokenB2b](#access-token-b2b) and set to the authorization header. |

```php
<?php

use Otnansirk\SnapBI\Services\SnapBi;
...

SnapBi::bca()->withTokenB2b();

// Or
// If you want to manually provide accessTokenB2b
$token = "1wdqwj21jr...";
SnapBi::bca()->withTokenB2b($token);


```
