WebAPI

WebAPI – Preventive Maintenance

99 views 31 July, 2017 3 September, 2018 Valuekeep 0

This service allows you to retrieve and handle Preventive Maintenances in Valuekeep.

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

Get List of Preventive Maintenance Events

GET /api/mytenant/myorganization/maintenancemanagementcore/Projections/GetProjectionsByFilter

This method allows you to retrieve a list of Preventive Maintenance Events, applying several filters. You can retrieve the list of Preventive Maintenance Events using the following filters:

  • StateKey: Work order states list (values in “Table of Work Order States”).
  • Year: Year of the expected date for the events. Displays all preventive maintenance events for which the year is after the value set in the filter.
  • DaysLimit: Number of days before the expected date for events to be included in the list.
  • Version: Version.
  • MaxRecords: Maximum number of records (you can request 200 records at a time).
  • PMResponsible: Username of the user in charge of the preventive maintenance.
  • WCResponsible: Username of the employee in charge of the work center.
  • PMOrWCResponsible: Person in Charge of the Preventive Maintenance or Work Center
  • HasWorkOder: Boolean filter to specify whether the system should return events with associated work orders. By default, this filter is set to “false“.

All filters are optional. The list of Preventive Maintenance Events is sorted by version ascendingly.

Example:

GET /api/mytenant/myorganization/maintenancemanagementcore/Projections/GetProjectionsByFilter?maxRecords=50&hasWorkOrder=true&stateKey=004&mpresponsible=myuser&version=AAAAAAAAAAA=

Retrieves a maximum of 50 Preventive Maintenance Event records associated with a work order and “In Progress” where the person in charge of the preventive maintenance is the employee with the “myuser” username and using version “AAAAAAAAAAA=” or later.

GET /api/mytenant/myorganization/maintenancemanagementcore/Projections/GetProjectionsByFilter?maxRecords=50&daysLimit=30&version=AAAAAAAAAAA=

Retrieves a maximum of 50 Preventive Maintenance Event records with an expected date within 30 days backwards counting from the current date and using version “AAAAAAAAAAA=” or later.

Example of the “DaysLimit” filter
Current date: 07/28/2017
DaysLimit: 30 days
With these settings, all events with an expected date after 06/28/2017 (30 days before the current date) will be displayed.

Retrieve Preventive Maintenance Event

GET /api/mytenant/myorganization/maintenancemanagementcore/Projections/GetProjectionByNaturalKey

This method allows you to retrieve a Preventive Maintenance event using the following parameter:

  • NaturalKey: Which consists on the Preventive Maintenance key together with the event (PM000002.4.151).

Example:

GET /api/mytenant/myorganization/maintenancemanagementcore/Projections/GetProjectionByNaturalKey?naturalKey=PM000002.4.151

This request will return the event “151” of the preventive maintenance with key “PM000002.4” and type ProjectionResource.

Create Work Orders from Preventive Maintenance Events

PUT /api/mytenant/myorganization/maintenancemanagementcore/Projections/CreateWorkOrdersFromProjections

This method allows you to create work orders from Preventive Maintenance Events. The “body “of the message must follow the structure for the PreventiveProjectionsResource resource.

 

Example:

PUT /api/mytenant/myorganization/maintenancemanagementcore/Projections/CreateWorkOrdersFromProjections

{
“PreventiveMaintenanceKey” : “PM000010.1”,
“StateKey” : “004”,
“Events” : [
{“EventNumber” : “2”},
{“EventNumber” : “3”}
]
}

This request can be used to create work orders and put them in the “In Progress” state (“004”), for events “2” and “3” of the preventive maintenance with key “PM000010”.
After the request, the returned resource will include the keys for the work orders created for each event.

Events already associated with a work order are ignored.
The “StateKey” is the state in which the created work orders will be placed.

Changing the expected date of a preventive maintenance event

PUT /api/mytenant/myorganization/maintenancemanagementcore/Projections/ChangeProjectionDate?naturalKey=PMKey&expectedDate=expDate

This method allows you to change the expected date of a preventive maintenance event.

Example:

PUT /api/mytenant/myorganization/maintenancemanagementcore/Projections/ChangeProjectionDate?naturalKey=PM000001.3.15&expectedDate=2018-07-30T09:55%2B01:00

This request will change the expected date of event “15” of the preventive maintenance with key “PM000001”.
The request returns a ProjectionResource type of structure.

The “expectedDate” field sent must be encoded in UTF-8 using the “%2B” HEX code to escape the “+” character
Tags:

Foi útil?