# API: Produtos

---

- [Index](#index)
- [Show](#show)
- [Store](#store)
- [Update](#update)
- [Destroy](#destroy)

<a name="index"></a>
## Index

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|GET|`/produtos`|Default|

### Body
```json
Empty
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
[
    {
        "id": <id>,
        "empresa_id": <empresa_id>,
        "nome": <nome>,
        "descricao": <descricao>,
    },
    //...
]
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="show"></a>
## Show

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|GET|`/produtos`|Default|

### Body
```json
Empty
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
{
    "id": <id>,
    "empresa_id": <empresa_id>,
    "nome": <nome>,
    "descricao": <descricao>,
}
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="store"></a>
## Store

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|POST|`/produtos`|Default|

### Body
```json
{
    "empresa_id": int,
    "nome": string,
    "descricao": string,
    "default_ativos_referencias": [
        {
            "ativo_medicao_id": int,
            "min_val": double,
            "max_val": double
        },
        //..
    ]
}
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
{
    "empresa_id": <empresa_id>,
    "nome": <nome>,
    "descricao": <descricao>,
    "id":<id>
}
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="update"></a>
## Update

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|PUT|`/produtos/{equipamento}`|Default|

### Body
```json
{
    "empresa_id": int,
    "nome": string,
    "descricao": string,
    "default_ativos_referencias": [
        {
            "ativo_medicao_id": int,
            "min_val": double,
            "max_val": double
        },
        //..
    ]
}
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
{
    "empresa_id": <empresa_id>,
    "nome": <nome>,
    "descricao": <descricao>,
    "id":<id>
}
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="destroy"></a>
## Destroy

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|DELETE|`/produtos/{equipamento}`|Default|

### Body
```json
Empty
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>204 - No Content</larecipe-badge>
```json
Empty
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```