> For the complete documentation index, see [llms.txt](https://docs.w3lcome.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.w3lcome.com/integration/w-access.md).

# W-Access

## The W-Access Object

| Attribute                                                            | Description                                                                                                          |
| -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| <p><strong>enabled</strong> <br><em><code>bool</code></em></p>       | Boolean indicating if the integration is active or not                                                               |
| **aesKey** *`string`*                                                | AES key used to encrypt the host QR Code                                                                             |
| **qrcodeDuration** *`int`*                                           | Duration (in **seconds**) that the QR Code will still be valid                                                       |
| <p><strong>url</strong><br><em><code>string</code></em></p>          | If provided, the iPad will make a local POST request to this URL after the visitor finishes its check-in on the iPad |
| <p><strong>username</strong><br><em><code>string</code></em></p>     | It will be used to authenticate during the local POST request                                                        |
| <p><strong>password</strong></p><p><em><code>string</code></em></p>  | It will be used to authenticate during the local POST request                                                        |
| **totpEnabled** *`bool`*                                             | Indicates if TOTP is enabled or not. Default value: `false`                                                          |
| **staticVisitorQRCode** *`bool`*                                     | If enabled the visitor is going to have a static qrcode                                                              |
| <p><strong>createdAt</strong></p><p><em><code>string</code></em></p> | Immutable field, updated automatically                                                                               |
| <p><strong>updatedAt</strong></p><p><em><code>string</code></em></p> | Immutable field, updated automatically                                                                               |

## Methods

## Get data

<mark style="color:blue;">`GET`</mark> `https://api.w3lcome.com/v1/integration/waccess`

This endpoint allows you to get the W-Access configurations

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Content-Type   | string | application/JSON |
| Authentication | string | Basic `token`    |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{    
    "enabled": true,
    "aesKey": "longSecretKey",   
    "qrcodeDuration": 21600,
    "url": "http://192.168.100.36/checkin",
    "username": "w3lcome.token",
    "password": "Vy1BY2Vzcy1Ub2tlbg",
    "totpEnabled": false,
    "staticVisitorQRCode": false,
    "createdAt": "2020-03-11T19:21:26.970Z",
    "updatedAt": "2020-03-11T19:21:26.970Z"
}
```

{% endtab %}

{% tab title="404 Error" %}

```javascript
{    
    "type": "NOT_FOUND"
}
```

{% endtab %}
{% endtabs %}

## Post data

<mark style="color:green;">`POST`</mark> `https://api.w3lcome.com/v1/integration/waccess`

This endpoint allows you to update the W-Access configurations

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Content-Type   | string | application/JSON |
| Authentication | string | Basic `token`    |

#### Request Body

| Name                | Type    | Description      |
| ------------------- | ------- | ---------------- |
| staticVisitorQRCode | boolean | Default `false`  |
| totpEnabled         | boolean | Default `false`  |
| username            | string  | Default `""`     |
| password            | string  | Default `""`     |
| url                 | string  | Default `""`     |
| enabled             | boolean | Default: `false` |
| aesKey              | string  | Default: `""`    |
| qrcodeDuration      | number  | Default: `30`    |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
    "enabled": true,
    "aesKey": "newLongSecretKey",
    "qrcodeDuration": 3600,
    "url": "http://192.168.100.36/checkin"
    "username": "w3lcome.token",
    "password": "Vy1BY2Vzcy1Ub2tlbg",
    "createdAt": "2020-03-11T19:21:26.970Z",
    "updatedAt": "2020-03-12T16:39:22.970Z"
}
```

{% endtab %}

{% tab title="400 Error" %}

```javascript
{
    "type": "INVALID_PARAMETER"
}
```

{% endtab %}
{% endtabs %}

## Remove data

<mark style="color:red;">`DELETE`</mark> `https://api.w3lcome.com/v1/integration/waccess`

This endpoint allows you to delete the W-Access configurations

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Content-Type   | string | application/JSON |
| Authentication | string | Basic `token`    |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
    "success": true
}
```

{% endtab %}

{% tab title="500 Error" %}

```javascript
{
    "type": "INTERNAL"
}
```

{% endtab %}
{% endtabs %}

## Table of Errors

| Method | Type                               | Description |
| ------ | ---------------------------------- | ----------- |
| `GET`  | NOT\_FOUND                         |             |
| `POST` | INVALID\_PARAMETER                 |             |
| `*`    | <p>INTERNAL</p><p>UNAUTHORIZED</p> |             |

## Dynamic QR Code (Host)

{% hint style="info" %}
To use the dynamic QR Code, the [Host](/host/the-host-object.md#the-object) must have the property **wAccessCardNumber** under **metadata** which is an Int32
{% endhint %}

#### Valid Sample

```javascript
{
    "name": "Alisson Enz",
    "email": "alisson@w3lcome.com",
    "metadata": {
        "wAccessCardNumber": 123456
    }
}
```

#### Invalid Sample

It will not work, the system only accepts custom fields under **metadata**

```javascript
{
    "name": "Alisson Error",
    "email": "alisson@error.com",
    "wAccessCardNumber": 123456
}
```
