WebAPI

WebAPI – Meters and Meter Values

17 views 28 April, 2017 10 April, 2018 Valuekeep 0

This service allows you to retrieve and handle Meters and Meter Values in Valuekeep.

Below you can find an analysis of the methods available through the service.

List of Meters

GET /api/mytenant/myorganization/maintenancemanagementcore/meters/GetMetersByVersionAndRecords?version=AAAA&maxRecords=2000

This method allows you to retrieve the list of meters. You can retrieve this list using the following filters:

  • Version: Version
  • MaxRecords: Optional. Maximum number of records to return (if not specified, it will return 2000 records by default)

Example:

GET /api/mytenant/myorganization/maintenancemanagementcore/meters/GetMetersByVersionAndRecords?version=AAAAAAAAAAA=&maxRecords=200

Retrieves a maximum of 200 meters with version “AAAAAAAAAAA=” or later.

Get Meter Values

GET /api/mytenant/myorganization/maintenancemanagementcore/metervalues/GetMeterValuesByFilter

This method allows you to retrieve the list of meters applying several filters. You can retrieve this list using the following filters:

  • Version: Minimum version from which the list will be returned
  • MaxRecords: Maximum number of records (you can request 200 records at a time)
  • StateKey: List of states (see the numeric part of the natural key of values in the States section, on Create a Work Order)
  • AssignedTo: The employee’s username. The system returns meter values associated with WOs where tasks are assigned to this employee.
  • WorkOrderKey: Work Order code. The system returns meter values associated with this WO.
  • AssetKey: Asset code. The system returns meter values associated with this asset.
  • LocationKey: Location code. The system returns meter values associated with this location.
  • MeterKey: Monitoring code. The system returns this meter’s values.

All filters are optional. The list of values returned is sorted by version ascendingly.

Examples:

GET /api/mytenant/myorganization/maintenancemanagementcore/metervalues/GetMeterValuesByFilter?stateKey=001&stateKey=002&maxRecords=50&assignedTo=myuser&version=AAAAAAAAAAA=

Retrieves a maximum of 50 meter values for WOs in the “Pending” and “Waiting for Approval” states, assigned to the employee with the “myuser” username and using version “AAAAAAAAAAA=” or later.

GET /api/mytenant/myorganization/maintenancemanagementcore/metervalues/GetMeterValuesByFilter?workorderkey=WO001

Retrieves meter values for WO “WO001”.

Create Meter Values

POST /api/mytenant/myorganization/maintenancemanagementcore/metervalues

This method allows you to create meter values for a specific meter. The “body” of the message must follow the structure for the MeterValueResource resource.

Example:

{
“Date”: “2017-03-24T00:00:00+00:00”,
“IncrementValue”: 155,
“MeterReading”: 0,
“Meter”: “ASSET-0003”,
“WorkOrder”: null,
“Notes”: null
}

Change Meter Values

PUT /api/mytenant/myorganization/maintenancemanagementcore/metervalues/<id>

This method allows you to change monitoring value records. The value of <id> must be the record identifier and the “body” of the message must follow the structure for the MeterValueResource resource.

Example:

PUT /api/mytenant/myorganization/maintenancemanagementcore/metervalues/ab5b8fbe-2916-e711-9d08-c01885a63e51

{
“ReadingNumber”: 12,
“Date”: “2017-03-22T00:00:00+00:00”,
“MeterCumulativeReading”: 5945.35,
“IncrementValue”: 300,
“MeterReading”: 5945.35,
“Notes”: null,
“TotalCost”: 0,
“TotalCostBase”: 0,
“TotalCostReporting”: 0,
“UnitCost”: 0,
“UnitCostBase”: 0,
“UnitCostReporting”: 0,
“Meter”: “CA-0001”,
“Origin”: 1,
“ParentMeterValue”: null,
“WorkOrder”: “OT0019”,
“UserFields”: [],
“Id”: “ab5b8fbe-2916-e711-9d08-c01885a63e51”
}

This request can be used to update the meter value record with identifier “ab5b8fbe-2916-e711-9d08-c01885a63e51”.
After the request, the “Version” field will be updated in the returned resource.

Meter Type Codes

The WebAPI methods for the meters use the following codes for types of meters:

Key Description
1 Reading
2 Increment
Tags:

Foi útil?