Through this API history out of service that the locations and equipment have presented can be consulted.

You can query with the asset code to get the specific history of an asset

And dates can be filtered to verify services that occurred at that time. By default, the out of service that occurred 1 month ago is consulted.

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

Method GET

Input Parameters

Parameter

Type of field

Required

Description

code

Text

Optional

Asset code.

since

Text

Optional

Query initial date. Format: 'YYYY-MM-DDTHH:MM:SS-UTC' Example:'2016-07-12T20:00:00-03'. (By default 30 days before)

until

Text

Optional

Final date of the query. Format: 'YYYY-MM-DDTHH:MM:SS-UTC' Example:'2016-07-12T20:00:00-03'. (By default the current date)

type_date

Text

Optional

Type of filter by which the filter will be performed. Can be:
- creation_date (Default value)
- initial_date
- final_date

start

Entire

Optional

Record number from which the query will start. By default it starts at item 0.

limit

Entire

Optional

Final record number that the query will return. By default 100 records will return (Maximum Value)

Output parameters

Parameter

Type of field

Description

description

Text

Asset description

code

Text

Asset code

creation_date

Text

Out of service creation date

initial_date

Text

Out of service date started

final_date

Text

Out of service date ended

out_of_service_sec

Number

Out of service duration in seconds

Example:

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

Example Response:

{ 
"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
}

Did this answer your question?