# Authentication methods

Source: https://developer.avalara.com/products/communications/integration-guides/communications-integration/nhv6318423598766/

Guide: Communications

# Authentication methods

AvaTax for Communications uses [basic HTTP](https://en.wikipedia.org/wiki/Basic_access_authentication) authentication to connect to the API. Use a Base64 encoded username:password to authenticate.

Key

Value

`Authorization`

Basic "{encoded username:password}"

`client_id`

Unique identifier for your company. Avalara provides this during your account creation. Your `client_id` is the same across all environments

`Content-Type`

`application/json`

## Encode your username and password

Your Customer Portal "{encoded username:password}" is encoded in Base64. For example, if your username is`first.last@avalara.com` and your password is `secretpassword!`, use`Zmlyc3QubGFzdEBhdmFsYXJhLmNvbTpzZWNyZXRwYXNzd29yZCE=` for basic authentication. You can encode a plaintext string to Base64 in Windows Powershell using the following script:

```
 # Encode a string to Base64
[System.Convert]::ToBase64String(
  [System.Text.Encoding]::UTF8.GetBytes("first.last@avalara.com:secretpassword!")); 
```

Note

Different factors can impact your "{encoded username:password}", namely different username capitalization. Usernames are not case sensitive, but passwords are. Base64 encoded values for usernames`first.last@avalara.com` and`First.Last@avalara.com` are different but are treated as being identical behind the scenes during authentication. Base64 encoded values for passwords `secretpassword!` and `SecretPassword!` are different and cause authentication to fail because the password is not what is expected.

## Optional headers

Our tax engine allows for additional customization when calculating taxes through client profiles which will be described later. For now, just know that you can pass an additional header to use a specific profile:

Table 1. 

Key

Value

`client_profile_id`

An integer that specifies which profile you want to use when calculating the taxes in this request

Note

If a `client_profile_id` is left blank, REST v2 uses the system default configuration.