Fracttal →

Query the out-of-service history of assets.

Through this API you can query the out-of-service history of locations and equipment.

You can perform the query with the asset code to obtain the specific history of an asset.

You can also perform a date filter to query the out-of-service occurred in that time. The default is to query the out of service that occurred 1 month ago.

Endpoint with asset filter:

https://app.fracttal.com/api/items_availability/:code_asset

Input parameters

ParameterTypeRequiredDescription
codeTextOptionalCode of the asset
sinceTextOptionalInitial date of the query. Format:
'YYYYY-MM-DDTHH:MM:SS-UTC'
Example: '2016-07-12T20:00:00-03'. (Default 30 days before)
untilTextOptionalEnd date of the query.
Format: 'YYYYY-MM-DDTHH:MM:SS-UTC'
Example: '2016-07-12T20:00:00-03'. (Default is the current date)
type_dateTextOptionalType of date by which the filter will be performed.
It can be:
- Creation_date (default value)
- Initial_date
- Final_date
start IntegerOptionalRecord number from which the query will start, by default it starts at item 0.
limit IntegerOptionalFinal record number to be returned by the query. By default 100 records are returned (Maximum value).

Output parameters

ParameterTypeLocation (id_type_item = 1)
descriptionTextDescription of asset
codeTextAsset code
creation_dateTextDate of creation of the out of service
initial_dateTextDate on which the out-of-service began
final_dateDateDate on which the out-of-service was terminated
out_of_service_secNumberDuration in seconds of out of service

Example:

Petition: (GET) https://app.fracttal.com/api/items_availability/?since=2020-01-01T00:00:00-05&until=2020-04-30T23:59:00-05&code=222-GXC

{
    "success": true,}
    "message": "200",
    "data": [
        {
            "id": 162,
            "id_company": 133,
            "id_item": 5008,
            "creation_date": "2020-04-20T13:41:09.950329+00:00",
            "initial_date": "2020-04-20T13:39:49.511+00:00",
            "final_date": "2020-04-23T19:30:46+00:00",
            "out_of_service_sec": 280256,
            "description": "AUTOMOVIL TOYOTA Hotwheels Double { 222-GXC } HILUX V8",
            "code": "222-GXC"
        },
        {
            "id": 142,
            "id_company": 133,
            "id_item": 5008,
            "creation_date": "2020-03-06T16:55:57.927531+00:00",
            "initial_date": "2020-03-01T16:52:00+00:00",
            "final_date": "2020-03-06T16:57:07+00:00",
            "out_of_service_sec": 432307,
            "description": "AUTOMOVIL TOYOTA Hotwheels Double { 222-GXC } HILUX V8",
            "code": "222-GXC"
        },
        {
            "id": 148,
            "id_company": 133,
            "id_item": 5008,
            "creation_date": "2020-03-18T18:01:52.896563+00:00",
            "initial_date": "2020-03-18T17:58:44.213+00:00",
            "final_date": "2020-04-07T13:35:17.484273+00:00",
            "out_of_service_sec": 1712193,
            "description": "AUTOMOVIL TOYOTA Hotwheels Double { 222-GXC } HILUX V8",
            "code": "222-GXC"
        },
        {
            "id": 160,
            "id_company": 133,
            "id_item": 5008,
            "creation_date": "2020-04-15T17:57:49.416216+00:00",
            "initial_date": "2020-04-14T16:20:00+00:00",
            "final_date": "2020-04-15T18:50:05+00:00",
            "out_of_service_sec": 95405,
            "description": "AUTOMOVIL TOYOTA Hotwheels Double { 222-GXC } HILUX V8",
            "code": "222-GXC"
        }
    ],
    "total": 4
}

Test iT

Language