---
description: Common Methods
---

# Methods

## Recommended Headers

| Header       | Value            |
| ------------ | ---------------- |
| Accept       | application/json |
| Content-Type | application/json |

## Common Endpoints

## Get Entity by ID

<mark style="color:blue;">`GET`</mark> `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity/:entityId`

Get a single entity identified by its ID.

#### Path Parameters

| Name     | Type    | Description                                |
| -------- | ------- | ------------------------------------------ |
| cloudId  | integer | ID of the cloud.                           |
| entity   | string  | Name of the entity type, f.e. "suppliers". |
| entityId | integer | ID of the entity to get.                   |

#### Headers

| Name          | Type   | Description                             |
| ------------- | ------ | --------------------------------------- |
| Authorization | string | Bearer accessToken                      |
| If-None-Match | string | ETag to return results only if changed. |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}

## Filter\&Sort Entities

<mark style="color:blue;">`GET`</mark> `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity`

Get a custom-sorted paginated list of entities matching the filter criteria. Without applying a filter over `deleted`, only non-deleted entities are output.

#### Path Parameters

| Name    | Type    | Description                                |
| ------- | ------- | ------------------------------------------ |
| cloudId | integer | ID of the cloud.                           |
| entity  | string  | Name of the entity type, f.e. "suppliers". |

#### Query Parameters

| Name   | Type    | Description                     |
| ------ | ------- | ------------------------------- |
| filter | string  | Filter conditions.              |
| sort   | string  | Sort parameter.                 |
| page   | integer | Page to start with.             |
| limit  | integer | Page size (100 records maximum) |

#### Headers

| Name          | Type   | Description                             |
| ------------- | ------ | --------------------------------------- |
| Authorization | string | Bearer accessToken                      |
| If-None-Match | string | ETag to return results only if changed. |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}

## Update an Entity

<mark style="color:purple;">`PATCH`</mark> `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity/:entityId`

Update a single entity identified by its ID.

#### Path Parameters

| Name     | Type    | Description                                |
| -------- | ------- | ------------------------------------------ |
| cloudId  | integer | ID of the cloud.                           |
| entity   | string  | Name of the entity type, f.e. "suppliers". |
| entityId | integer | ID of the entity to update.                |

#### Headers

| Name          | Type   | Description                         |
| ------------- | ------ | ----------------------------------- |
| Authorization | string | Bearer accessToken                  |
| If-Match      | string | ETag to update only if not changed. |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}

## Create New Entities

<mark style="color:green;">`POST`</mark> `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity`

Create a list of new entities.

#### Path Parameters

| Name    | Type    | Description                                |
| ------- | ------- | ------------------------------------------ |
| cloudId | integer | ID of the cloud.                           |
| entity  | string  | Name of the entity type, f.e. "suppliers". |

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Bearer accessToken |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}

## Replace Single Entity

<mark style="color:orange;">`PUT`</mark> `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity/:entityId`

Replace a single entity identified by its ID.

#### Path Parameters

| Name     | Type    | Description                                |
| -------- | ------- | ------------------------------------------ |
| cloudId  | integer | ID of the cloud.                           |
| entity   | string  | Name of the entity type, f.e. "suppliers". |
| entityId | integer | ID of the entity to replace.               |

#### Headers

| Name          | Type   | Description                                                                              |
| ------------- | ------ | ---------------------------------------------------------------------------------------- |
| Authorization | string | Bearer accessToken                                                                       |
| If-Match      | string | <p>ETag required when updating an entity.<br>ETag ignored when inserting new entity.</p> |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}

## Replace Many Entities

<mark style="color:orange;">`PUT`</mark> `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity`

Replace a list of entities.

#### Path Parameters

| Name    | Type    | Description                                |
| ------- | ------- | ------------------------------------------ |
| cloudId | integer | ID of the cloud.                           |
| entity  | string  | Name of the entity type, f.e. "suppliers". |

#### Headers

| Name          | Type   | Description                                                                                                    |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------- |
| Authorization | string | Bearer accessToken                                                                                             |
| If-Match      | string | <p>ETag required when updating at least a single entity.<br>ETag ignored when inserting new entities only.</p> |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}

## Delete an Entity

<mark style="color:red;">`DELETE`</mark> `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity/:entityId`

Delete a single entity identified by its ID.

#### Path Parameters

| Name     | Type   | Description                                |
| -------- | ------ | ------------------------------------------ |
| cloudId  | string | ID of the cloud.                           |
| entity   | string | Name of the entity type, f.e. "suppliers". |
| entityId | string | ID of the entity to delete.                |

#### Headers

| Name          | Type   | Description                                         |
| ------------- | ------ | --------------------------------------------------- |
| Authorization | string | Bearer accessToken                                  |
| If-Match      | string | ETag ignored (temporarily) when deleting an entity. |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}
```
{    "name": "Cake's name",    "recipe": "Cake's recipe name",    "cake": "Binary cake"}
```
{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}
```
{    "message": "Ain't no cake like that."}
```
{% endtab %}
{% endtabs %}

## Options

`OPTIONS` `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity`

#### Path Parameters

| Name    | Type    | Description                                |
| ------- | ------- | ------------------------------------------ |
| cloudId | integer | ID of the cloud.                           |
| entity  | string  | Name of the entity type, f.e. "suppliers". |

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Bearer accessToken |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}

## Options with Entity ID

`OPTIONS` `https://api.dotykacka.cz/v2/clouds/:cloudId/:entity/:entityId`

#### Path Parameters

| Name     | Type    | Description                                |
| -------- | ------- | ------------------------------------------ |
| cloudId  | integer | ID of the cloud.                           |
| entity   | string  | Name of the entity type, f.e. "suppliers". |
| entityId | integer | ID of the entity to get the options for.   |

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Bearer accessToken |

{% tabs %}
{% tab title="200 " %}
```
```
{% endtab %}
{% endtabs %}
