> For the complete documentation index, see [llms.txt](https://alecmei-gubin.gitbook.io/citron-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alecmei-gubin.gitbook.io/citron-system/untitled/proekty/resursy-proekta.md).

# Ресурсы проекта

## index

<mark style="color:blue;">`GET`</mark> `https://api.url/api/project_resources`

Возвращает все ресурсы в проекте

#### Headers

| Name          | Type    | Description                         |
| ------------- | ------- | ----------------------------------- |
| Authorization | integer | Токен, выданный вам при авторизации |

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

```javascript
{
    "data": [
        {
            "id": 2,
            "name": "Компудахтер",
            "project_id": 1,
            "position": 1
        },
        {
            "id": 4,
            "name": "Хостинг",
            "project_id": 1,
            "position": 2
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## show

<mark style="color:blue;">`GET`</mark> `https://api.url/api/project_resources/{id}`

Возвращает ресурс по id

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | id ресурса  |

#### Headers

| Name          | Type   | Description                         |
| ------------- | ------ | ----------------------------------- |
| Authorization | string | Токен, выданный вам при авторизации |

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

```javascript
{
    "data": {
        "id": 2,
        "name": "Компудахтер",
        "project_id": 1,
        "position": 1
    }
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "errors": {
        "id": [
            "The selected id is invalid."
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## store

<mark style="color:green;">`POST`</mark> `https://api.url/api/project_resources`

Создание ресурса проекта

#### Query Parameters

| Name        | Type    | Description              |
| ----------- | ------- | ------------------------ |
| position    | integer | Позиция ресурса в списке |
| project\_id | integer | id проекта               |
| name        | string  | Название ресурса         |

#### Headers

| Name          | Type    | Description                         |
| ------------- | ------- | ----------------------------------- |
| Authorization | integer | Токен, выданный вам при авторизации |

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

```javascript
{
    "data": {
        "id": 4,
        "name": "Хостинг",
        "project_id": "1",
        "position": "2"
    }
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "errors": {
        "name": [
            "The name field is required."
        ],
        "project_id": [
            "The project id field is required."
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## update

<mark style="color:orange;">`PUT`</mark> `https://api.url/api/project_resources/{id}`

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | id ресурса  |

#### Query Parameters

| Name        | Type    | Description              |
| ----------- | ------- | ------------------------ |
| name        | string  | Название ресурса         |
| project\_id | integer | id проекта               |
| position    | integer | Позиция ресурса в списке |

#### Headers

| Name          | Type   | Description                         |
| ------------- | ------ | ----------------------------------- |
| Authorization | string | Токен, выданный вам при авторизации |

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

```
```

{% endtab %}
{% endtabs %}

## delete

<mark style="color:red;">`DELETE`</mark> `https://api.url/api/project_resources/{id}`

Удаляет ресурс проекта

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | id ресурса  |

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

```javascript
[
    "success"
]
```

{% endtab %}
{% endtabs %}
