> For the complete documentation index, see [llms.txt](https://api.fosci.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.fosci.cloud/api-fosci/api-constructor.md).

# API Constructor

## Load

<mark style="color:blue;">`GET`</mark> `https://client.site.fosci.cloud/api/menu-constructor/load`

#### Query Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| auth       | string |             |
| client\_id | string |             |

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

```
{
  editable: boolean;
  approved: booleam;
  menu_client_id: number;
  menu_client_dishes: string;
  date: string;
  res: {
    dishes: { [id: string]: { [id: string]: DishGroup[] } };
  };
  date_list: string[];
}
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

## Get Dishes

<mark style="color:blue;">`GET`</mark> `https://client.site.fosci.cloud/api/menu-constructor/get-dishes-by-date`

#### Query Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| auth       | string |             |
| client\_id | string |             |
| date       | string |             |

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

```
{
  ing: number;
  ing_name: string;
  ing_subsection_name: string;
  dish_id: number | string;
  dish_name: string;
  dish_protein: number;
  dish_fat: number;
  dish_carb: number;
  dish_calor: number;
  dish_exit: number;
  dish_image: string;
  count: number | string;
  sticker_text: string;
  dish2_id: number | string;
  dish2_name: string;
  dish2_protein: number;
  dish2_fat: number;
  dish2_carb: number;
  dish2_calor: number;
  dish2_exit: number;
  dish2_image: string;
  count2: number | string;
  sticker_text2: string;
  dish3_id: number | string;
  dish3_name: string;
  dish3_protein: number;
  dish3_fat: number;
  dish3_carb: number;
  dish3_calor: number;
  dish3_exit: number;
  dish3_image: string;
  count3: number | string;
  sticker_text3: string;
  dish4_id: number | string;
  dish4_name: string;
  dish4_protein: number;
  dish4_fat: number;
  dish4_carb: number;
  dish4_calor: number;
  dish4_exit: number;
  dish4_image: string;
  count4: number | string;
  sticker_text4: string;
}
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

## Save changes

<mark style="color:green;">`POST`</mark> `https://client.site.fosci.cloud/api/menu-constructor/save-current-changes`

#### Request Body

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| dish\_id<mark style="color:red;">\*</mark>   | String |                                          |
| client\_id<mark style="color:red;">\*</mark> | String |                                          |
| auth<mark style="color:red;">\*</mark>       | String |                                          |
| date<mark style="color:red;">\*</mark>       | String |                                          |
| ing<mark style="color:red;">\*</mark>        | String | ing\_*(number\_of\_ingestion) -> ing\_4* |
| dish\_number                                 | String |                                          |

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

```
{
"res": {
"sum_protein": "481",
"sum_fat": "144",
"sum_carb": "290",
"sum_calor": "1700"
},
"status": "success"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
  status: "no menu_client_dishes" | "success";
}
```

{% endtab %}
{% endtabs %}

## Approve

<mark style="color:green;">`POST`</mark> `https://client.site.fosci.cloud/api/menu-constructor/approve`

#### Query Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| auth       | string |             |
| client\_id | int    |             |
| date       | string |             |

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

```
{
  status: "no menu_client_dishes" | "success";
}
```

{% endtab %}
{% endtabs %}

## Disapprove

<mark style="color:green;">`POST`</mark> `https://client.site.fosci.cloud/api/menu-constructor/disapprove`

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| auth<mark style="color:red;">\*</mark>       | String |             |
| client\_id<mark style="color:red;">\*</mark> | int    |             |
| date<mark style="color:red;">\*</mark>       | String |             |

## Style

<mark style="color:green;">`POST`</mark> `https://client.site.fosci.cloud/api/menu-constructor/get-style`

#### Query Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| auth       | string |             |
| client\_id | string |             |
| date       | string |             |

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

```
```

{% endtab %}
{% endtabs %}

## Get Style

<mark style="color:green;">`POST`</mark> `https://client.site.fosci.cloud/api/menu-constructor/get-client-settings`

#### Query Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| auth       | string |             |
| client\_id | string |             |

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

```
```

{% endtab %}
{% endtabs %}

## All dishes

<mark style="color:green;">`POST`</mark> `https://client.site.fosci.cloud/api/menu-constructor/get-all-dish`

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| api\_token<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK { "id": 6, "name": "Рыба с перловкой", "unit\_id": 3, "protein": "18.8150", "fat": "14.0000", "carb": "46.8960", "calor": "388.8440", "exit": "0.3200", "sticker\_text": "Филе трески, перловка, морковь, соль, счастье", "image": "//st3.fosci.cloud/uploads/store/Dishes/Dish6/d1a88a.jpg" }" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Client id and auth

<mark style="color:green;">`POST`</mark> `https://client.site.fosci.cloud/api/menu-constructor/get-client-auth`

#### Path Parameters

| Name                                    | Type   | Description |
| --------------------------------------- | ------ | ----------- |
| token<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                    | Type   | Description |
| --------------------------------------- | ------ | ----------- |
| pnone<mark style="color:red;">\*</mark> | String |             |
| email<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK { "client\_id": 1, "auth": "95326bf8e633066cb48650faec9ea22f" }" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}
