Filtros
Pode-se utilizar filtros para restringir o retorno de dados. São utilizados, passando um parâmetro na URL requisitada. Observe a tabela de possíveis filtros abaixo
Param | Descrição | Tipo | Valores | Ex |
ids | Filtra pedidos pelo id | string | ?ids=1,2,3 |
# Criar Valor de Características
POST https://api.dooca.store/features/values
Body
{
"feature_id": 1,
"external_id": null,
"name": "Generic Value",
"description": "Generic Description"
}
Status: 201
# Editar Valor de Características
PUT https://api.dooca.store/features/values/:id
Parâmetro: O ID Grupo de características.
A edição do registro pode ser parcial ou total.
{
"name": "Novo nome do Feature Goup"
}
Status: 200
# Deletar Valor de Características
DELETE https://api.dooca.store/features/values/:id
Parâmetro: O ID Feature Group.
Response: 204
# Consultar Valor de Características
GET https://api.dooca.store/features/values/:id
Parâmetro: O ID Grupo de características.
HTTP STATUS: 200 OK
{
"id": 4,
"feature_id": 1,
"external_id": null,
"name": "couro",
"slug": "couro",
"image": null,
"position": 1,
"active": true,
"created_at": "2020-03-18 08:54:39",
"updated_at": "2020-03-18 08:54:39"
}
# Listar Valor de Características
GET https://api.dooca.store/features/values
HTTP STATUS: 200 OK
[
{
"id": 4,
"feature_id": 1,
"external_id": null,
"name": "couro",
"slug": "couro",
"image": null,
"position": 1,
"active": true,
"created_at": "2020-03-18 08:54:39",
"updated_at": "2020-03-18 08:54:39"
},
{
"id": 5,
"feature_id": 1,
"external_id": null,
"name": "ouro",
"slug": "ouro",
"image": null,
"position": 3,
"active": true,
"created_at": "2020-03-18 08:54:39",
"updated_at": "2020-03-18 08:54:39"
},
{
"id": 6,
"feature_id": 1,
"external_id": null,
"name": "metal",
"slug": "metal",
"image": null,
"position": 2,
"active": true,
"created_at": "2020-03-18 08:54:39",
"updated_at": "2020-03-18 08:54:39"
},
{
"id": 7,
"feature_id": 3,
"external_id": null,
"name": "Jovem",
"slug": "jovem",
"image": null,
"position": 1,
"active": true,
"created_at": "2020-03-20 14:23:52",
"updated_at": "2020-03-20 14:23:52"
},
{
"id": 8,
"feature_id": 3,
"external_id": null,
"name": "Velho",
"slug": "velho",
"image": null,
"position": 2,
"active": true,
"created_at": "2020-03-20 14:23:52",
"updated_at": "2020-03-20 14:23:52"
},
{
"id": 9,
"feature_id": 3,
"external_id": null,
"name": "Crianca",
"slug": "crianca",
"image": null,
"position": 3,
"active": true,
"created_at": "2020-03-20 14:23:52",
"updated_at": "2020-03-20 14:23:52"
}
],
"links": {
"first": "http://api.dooca.local/features/values?page=1",
"last": "http://api.dooca.local/features/values?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http://api.dooca.local/features/values",
"per_page": 25,
"to": 6,
"total": 6
}
# Criar Característica
POST https://api.dooca.store/features
Body
{
"name": "Generic Name",
"description": "Generic Description",
"image": "uploads://placeholder.jpg",
"values": [{
"name": "Generic Value 01"
},{
"name": "Generic Value 02"
}]
}
Status: 201
# Editar Característica
PUT https://api.dooca.store/features/:id
Parâmetro: O ID da característica.
A edição do registro pode ser parcial ou total.
{
"name": "Generic Name Edit"
}
Status: 200
# Deletar Característica
DELETE https://api.dooca.store/features/:id
Parâmetro: O ID da característica.
Response: 204
# Consultar Característica
GET https://api.dooca.store/features/:id
Parâmetro: O ID da característica.
HTTP STATUS: 200 OK
{
"id_feature": "1",
"id_feature_group": "1",
"name": "Nome do feature",
"slug": "nome-do-feature",
"image": null,
"position": "6",
"active": 1,
"external_id": null,
"created_at": "1955-02-24 12:00:00",
"updated_at": "2011-10-05 12:00:00"
}
# Listar Características
GET https://api.dooca.store/features
HTTP STATUS: 200 OK
[
{
"id": 1,
"external_id": null,
"name": "estilo",
"slug": "estilo",
"image": null,
"active": true,
"created_at": "2020-03-12 18:13:23",
"updated_at": "2020-03-18 08:54:39",
"values": [
{
"id": 4,
"feature_id": 1,
"external_id": null,
"name": "couro",
"slug": "couro",
"image": null,
"position": 1,
"active": true,
"created_at": "2020-03-18 08:54:39",
"updated_at": "2020-03-18 08:54:39"
},
{
"id": 6,
"feature_id": 1,
"external_id": null,
"name": "metal",
"slug": "metal",
"image": null,
"position": 2,
"active": true,
"created_at": "2020-03-18 08:54:39",
"updated_at": "2020-03-18 08:54:39"
},
{
"id": 5,
"feature_id": 1,
"external_id": null,
"name": "ouro",
"slug": "ouro",
"image": null,
"position": 3,
"active": true,
"created_at": "2020-03-18 08:54:39",
"updated_at": "2020-03-18 08:54:39"
}
]
},
{
"id": 3,
"external_id": null,
"name": "Linha",
"slug": "linha",
"image": null,
"active": true,
"created_at": "2020-03-20 14:23:52",
"updated_at": "2020-03-20 14:23:52",
"values": [
{
"id": 7,
"feature_id": 3,
"external_id": null,
"name": "Jovem",
"slug": "jovem",
"image": null,
"position": 1,
"active": true,
"created_at": "2020-03-20 14:23:52",
"updated_at": "2020-03-20 14:23:52"
},
{
"id": 8,
"feature_id": 3,
"external_id": null,
"name": "Velho",
"slug": "velho",
"image": null,
"position": 2,
"active": true,
"created_at": "2020-03-20 14:23:52",
"updated_at": "2020-03-20 14:23:52"
},
{
"id": 9,
"feature_id": 3,
"external_id": null,
"name": "Crianca",
"slug": "crianca",
"image": null,
"position": 3,
"active": true,
"created_at": "2020-03-20 14:23:52",
"updated_at": "2020-03-20 14:23:52"
}
]
}
],
"links": {
"first": "http://api.dooca.local/features?page=1",
"last": "http://api.dooca.local/features?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http://api.dooca.local/features",
"per_page": 25,
"to": 2,
"total": 2
}
Comentários
0 comentário
Por favor, entre para comentar.