API Reference

Listado de Categorías

Este endpoint obtiene el listado de categorías de activos

HTTP Request

GET https://admin.cmmshere.com/api/v1/assetCategories

Parámetros de consulta

Estos parámetros son opcionales y utilizados para filtrar e interactuar con la información obtenida. Los parámetros de filtrado (si se utilizan) se usan para buscar resultados que contengan dicho texto.

ParámetroTipoDefaultDescripción
nameStringNo definidoNombre de la categoría
initialsStringNo definidoSiglas de la categoría
offsetIntNo definidoOffset para paginación
limitIntNo definidoLímite para la paginación
orderByArray["created_at", "desc"]Ordenamiento. El primer valor es el campo y el segundo la dirección ASC o DESC

Ejemplo de petición

curl --location --request GET 'https://admin.cmmshere.com/api/v1/assetCategories' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 804|fCkDcz43egLAubMzPinRCIVUIjPUsGkvbVJ864IP' \
--header 'Cookie: XSRF-TOKEN=eyJpdiI6IlM4Nnp4Qnh1QnZ0dmQwb2tUSThBVkE9PSIsInZhbHVlIjoiV28ybFk2Y25wU2UzVDFoMXJaem5hT2ZyRFZ4cnE1Y2VjZWsySVgzVlF3QkhYUGFncC9TUGRxT1MxNWtyS0JsZE5hTElDZVUxNGJPTXZCM0ZVMXY2SU8veStFNHZVZUpJdDhNNWNlSVM1eVZFZEN3b2hINXlNbng2NUZIdXJoSVoiLCJtYWMiOiIyZjgxMGJjMWY3ODRhNTU5MGM2MWNkMjU1OWI5ZmU3MTQ5ZDdhMGY1YTZiN2U2NTc1OWFmYThjNDcyZTU1YzRlIn0%3D; laravel_session=eyJpdiI6IjI3aS80ZExyZW83R3NnbmE5QTVvaWc9PSIsInZhbHVlIjoiOXJWR1BNQ2N4WkdoUzhjNkF1anJFSTVHa3FDbFNiaEZueUIzL3BVTkx5NENyTmNhMHV5N2gxRzVwczZDdUdOUEJIT0Z4UHhLRGc1VnFpVjl6eHF3UVRUbVNsWGFJY1lidFo5bkF5dDdBamVzSDVzZW1DbkluUmdxOXcwYzZvVnYiLCJtYWMiOiJlMzY2NjAzYWU4NzhkOTc4NDgyYjk0YzMxZGIzYTRiY2FiYWJhNDZmM2ZiMjUyZTA0Mjk4NWNkYzBkNjkxZmQ1In0%3D' \
--data '{
    "offset" : 0,
    "limit" : 5,
    "orderBy" : ["id", "desc"]
}'

La petición de arriba devuelve un JSON estructurado de la siguiente manera

{
    "success": true,
    "code": 200,
    "results": [
        {
            "id": 82,
            "creator_id": 30,
            "area_id": 14,
            "initials": "NEW",
            "name": "NUEVA CATEGORIA DE ACTIVO MODIFICADA",
            "unique_field": null,
            "forms": null,
            "status": "1",
            "created_at": "2023-09-12T14:28:42.000000Z"
        },
        {
            "id": 80,
            "creator_id": 21,
            "area_id": 41,
            "initials": "RTR",
            "name": "Aires de precision amper confort",
            "unique_field": {
                "unique_field": {
                    "id": "nro_de_serie",
                    "name": "Nro de Serie"
                }
            },
            "forms": {
                "nro_de_serie": {
                    "id": "nro_de_serie",
                    "name": "Nro de Serie",
                    "type": "text",
                    "orden": 1,
                    "mostrar": "Nro de Serie",
                    "required": "required",
                    "mostrarDataTable": "1"
                }
            },
            "status": "1",
            "created_at": "2023-08-14T21:40:28.000000Z"
        },
        {
            "id": 79,
            "creator_id": 21,
            "area_id": 41,
            "initials": "AUT",
            "name": "Automovil",
            "unique_field": null,
            "forms": null,
            "status": "1",
            "created_at": "2023-04-18T21:50:51.000000Z"
        },
        {
            "id": 67,
            "creator_id": 35,
            "area_id": 14,
            "initials": "BBL",
            "name": "BANCO DE BATERIAS DE LITIO",
            "unique_field": {
                "unique_field": {
                    "id": "n_s",
                    "name": "N/S"
                }
            },
            "forms": {
                "n_s": {
                    "id": "n_s",
                    "name": "N/S",
                    "type": "text",
                    "orden": 1,
                    "mostrar": "N/S",
                    "required": "required",
                    "mostrarDataTable": "1"
                },
                "direccion_modbus": {
                    "id": "direccion_modbus",
                    "name": "Direccion Modbus",
                    "type": "text",
                    "orden": 2,
                    "mostrar": "Direccion Modbus",
                    "required": "",
                    "mostrarDataTable": "1"
                }
            },
            "status": "1",
            "created_at": "2023-01-19T14:12:12.000000Z"
        },
        {
            "id": 66,
            "creator_id": 40,
            "area_id": 41,
            "initials": "RECO",
            "name": "Reconectador de Media Tension",
            "unique_field": {
                "unique_field": {
                    "id": "numero_de_serie",
                    "name": "S/N"
                }
            },
            "forms": {
                "marca": {
                    "id": "marca",
                    "name": "Marca",
                    "type": "select",
                    "orden": 3,
                    "mostrar": "Marca",
                    "options": {
                        "opt0": {
                            "val": "noja_power",
                            "mostraropt": "NOJA POWER"
                        }
                    },
                    "required": "required",
                    "mostrarDataTable": "1"
                },
                "modelo": {
                    "id": "modelo",
                    "name": "Modelo",
                    "type": "select2",
                    "orden": 2,
                    "mostrar": "Modelo",
                    "options": {
                        "opt0": {
                            "val": "osm38-12-800-300",
                            "mostraropt": "OSM38-12-800-300"
                        },
                        "opt1": {
                            "val": "osm27-12-800-310",
                            "mostraropt": "OSM27-12-800-310"
                        },
                        "opt2": {
                            "val": "osm38-16-800-300",
                            "mostraropt": "OSM38-16-800-300"
                        },
                        "opt3": {
                            "val": "osm38-12-800-301",
                            "mostraropt": "OSM38-12-800-301"
                        }
                    },
                    "required": "required",
                    "mostrarDataTable": "1"
                },
                "procedencia": {
                    "id": "procedencia",
                    "name": "Procedencia",
                    "type": "select2",
                    "orden": 4,
                    "mostrar": "Procedencia",
                    "options": {
                        "opt0": {
                            "val": "australia",
                            "mostraropt": "Australia"
                        },
                        "opt1": {
                            "val": "brasil",
                            "mostraropt": "Brasil"
                        }
                    },
                    "required": "required",
                    "mostrarDataTable": "1"
                },
                "numero_de_serie": {
                    "id": "numero_de_serie",
                    "name": "S/N",
                    "type": "text",
                    "orden": 1,
                    "mostrar": "S/N",
                    "required": "required",
                    "mostrarDataTable": "1"
                }
            },
            "status": "1",
            "created_at": "2022-12-20T15:44:23.000000Z"
        }
    ]
}