# Data

## Get a global data entry

<mark style="color:blue;">`GET`</mark> `https://api.echo3D.com/get?key=<API_KEY>&data=<DATA>`

This query allows you to get global data entries.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                                                 |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>     | string | Your API key.                                                                                                                                               |
| data<mark style="color:red;">\*</mark>    | string | A data key, e.g. `scale`.                                                                                                                                   |
| email<mark style="color:red;">\*</mark>   | string | Your email address                                                                                                                                          |
| userKey<mark style="color:red;">\*</mark> | string | Your authentication key                                                                                                                                     |
| secKey                                    | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key). |

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

```
<VALUE>
```

{% endtab %}

{% tab title="400 " %}

```
Invalid request! No data value found in request.
```

{% endtab %}

{% tab title="404 " %}

```
Data not found
```

{% endtab %}
{% endtabs %}

## Post a global data entry

<mark style="color:green;">`POST`</mark> `https://api.echo3D.com/post?key=<API_KEY>&email=<EMAIL>&data=<DATA>&value=<VALUE>`

This query allows you to add a global data entry.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                                                 |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>     | string | The API key.                                                                                                                                                |
| data<mark style="color:red;">\*</mark>    | string | A data key, e.g. `scale`.                                                                                                                                   |
| value<mark style="color:red;">\*</mark>   | string | A data value, e.g. `2`.                                                                                                                                     |
| email<mark style="color:red;">\*</mark>   | string | Your email address                                                                                                                                          |
| userKey<mark style="color:red;">\*</mark> | string | Your authentication key                                                                                                                                     |
| secKey                                    | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key). |

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

```
Additional data updated in the global database
```

{% endtab %}

{% tab title="400 " %}

```
Invalid request! No data value found in request.
```

{% endtab %}
{% endtabs %}

## Delete global data entry

<mark style="color:green;">`POST`</mark> `https://api.echo3d.com/remove?key=<API_KEY>&data=<DATA>&email=<EMAIL>`

This query allows you to remove a global data entry.

#### Request Body

| Name                                      | Type   | Description                                                                                                                                                |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>     | string | Your API key                                                                                                                                               |
| data<mark style="color:red;">\*</mark>    | string | A data key, e.g. `scale`.                                                                                                                                  |
| email<mark style="color:red;">\*</mark>   | string | Your email address                                                                                                                                         |
| userKey<mark style="color:red;">\*</mark> | string | Your authentication key                                                                                                                                    |
| secKey                                    | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key) |

## Get metadata of an entry

<mark style="color:blue;">`GET`</mark> `https://api.echo3D.com/get?key=<API_KEY>&email=<EMAIL>&userKey=<USER_KEY>&entry=<ENTRY>&data=<DATA>`

The query allows you to get metadata of a specific entry.\
You can either query for a specific data key or for all the data associated with the entry.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                                                 |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>     | string | Your API key.                                                                                                                                               |
| entry<mark style="color:red;">\*</mark>   | string | A specific entry ID.                                                                                                                                        |
| data<mark style="color:red;">\*</mark>    | string | A data key, e.g. `scale`.                                                                                                                                   |
| email<mark style="color:red;">\*</mark>   | string | Your email address                                                                                                                                          |
| userKey<mark style="color:red;">\*</mark> | string | Your authentication key                                                                                                                                     |
| secKey                                    | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key). |

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

```
{
    "<KEY_1>": "<VALUE_1>",
    "<KEY_2>": "<VALUE_2>",
    "<KEY_3>": "<VALUE_3>",
    ...
}
```

{% endtab %}

{% tab title="302 " %}

```
<VALUE>
```

{% endtab %}

{% tab title="400 " %}

```
Invalid request! No data value found in request.
```

{% endtab %}

{% tab title="404 " %}

```
Data not found
```

{% endtab %}
{% endtabs %}

## Post metadata to an entry

<mark style="color:green;">`POST`</mark> `https://api.echo3D.com/post?key=<API_KEY>&email=<EMAIL>&userKey=<USER_KEY>&entry=<ENTRY>&data=<DATA>&value=<VALUE>`

This query allows you to add metadata to a specific entry.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                                                 |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>     | string | Your API key                                                                                                                                                |
| entry<mark style="color:red;">\*</mark>   | string | A specific entry ID.                                                                                                                                        |
| data<mark style="color:red;">\*</mark>    | string | A data key, e.g. `scale`.                                                                                                                                   |
| value<mark style="color:red;">\*</mark>   | string | A data value, e.g. `2`.                                                                                                                                     |
| email<mark style="color:red;">\*</mark>   | string | Your email address                                                                                                                                          |
| userKey<mark style="color:red;">\*</mark> | string | Your authentication key                                                                                                                                     |
| secKey                                    | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key). |

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

```
Additional data updated in asset <ENTRY>.
```

{% endtab %}

{% tab title="400 " %}

```
Invalid request! No data value found in request.
```

{% endtab %}
{% endtabs %}

## Delete metadata from an entry

<mark style="color:green;">`POST`</mark> `https://api.echo3d.com/remove?key=<API_KEY>&email=<EMAIL>&userKey=<USER_KEY>&entry=<ENTRY>&data=<DATA>`

This query allows you to remove metadata to a specific entry.

#### Request Body

| Name                                      | Type   | Description                                                                                                                                                |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>     | string | Your API key                                                                                                                                               |
| entry<mark style="color:red;">\*</mark>   | string | A specific entry ID.                                                                                                                                       |
| data<mark style="color:red;">\*</mark>    | string | A data key, e.g. `scale`.                                                                                                                                  |
| email<mark style="color:red;">\*</mark>   | string | Your email address                                                                                                                                         |
| userKey<mark style="color:red;">\*</mark> | string | Your authentication key                                                                                                                                    |
| secKey                                    | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key) |

{% tabs %}
{% tab title="200: OK " %}

```
Additional data key removed in entry <entry>
```

{% endtab %}

{% tab title="400: Bad Request " %}

```
Invalid request! 
```

{% endtab %}
{% endtabs %}

## Post metadata to a few entries with the same data name at the same time

<mark style="color:green;">`POST`</mark> `https://api.echo3d.com/batchpost?key=<API_KEY>&email=<EMAIL>&userKey=<USER_KEY>&entries=<ENTRY_IDs>&data=<DATA>&value<ENTRY_VALUES>`

You can set a few entries with the same data name together, even if they have a different value

#### Request Body

| Name                                      | Type   | Description                                                                                                                                                                            |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>     | string | Your API key                                                                                                                                                                           |
| entries<mark style="color:red;">\*</mark> | string | A list of entries to update, separated by a comma (',')                                                                                                                                |
| data<mark style="color:red;">\*</mark>    | string | A data key, e.g. `scale`.                                                                                                                                                              |
| value<mark style="color:red;">\*</mark>   | string | A list of data values, corresponding with the entry IDs, separated by a comma (','). e.g. `2,5,1`. Your number of values must be the same as the number of entries you wish to update. |
| email<mark style="color:red;">\*</mark>   | string | Your email address                                                                                                                                                                     |
| userKey<mark style="color:red;">\*</mark> | string | Your authentication key                                                                                                                                                                |
| secKey                                    | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key)                             |

## Query the number of clicks received by custom buttons for WebAR

<mark style="color:blue;">`GET`</mark> `https://api.echo3D.com/query?key=<API_KEY>&webARButtonClick=true`

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                 |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key<mark style="color:red;">\*</mark>              | string | Your API key                                                                                                                                                |
| webARButtonClick<mark style="color:red;">\*</mark> | string | true, to get the number of clicks                                                                                                                           |
| email<mark style="color:red;">\*</mark>            | string | Your email address                                                                                                                                          |
| userKey<mark style="color:red;">\*</mark>          | string | Your authentication key                                                                                                                                     |
| secKey                                             | string | Your Secret key. Only if enabled through the [Security page](https://docs.echo3d.com/web-console/manage-pages/collections-and-sharing/security#secret-key). |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "topLeftClickCounter": 0,
  "bottomRightClickCounter": 0,
  "centerClickCounter": 0,
  "rightClickCounter": 0,
  "topRightClickCounter": 0,
  "bottomClickCounter": 0,
  "bottomLeftClickCounter": 0,
  "leftClickCounter": 0,
  "topClickCounter": 0
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```
Key <API_KEY> not found!
```

{% endtab %}
{% endtabs %}
