How to obtain a list of work orders by OData?
In all Entities we have the possibility of making
Odata requests.
In Odata requests you must pay attention to the
following syntax:
- $select: expression that determines which request fields are included in the result;
- $filter: expression used to restrict the information sent in the
request;
- $orderby: expression used to organize the information sent;
- $skip: expression which ignores the first records. Example $skip = 100 - ignores the first 100 records;
- $Top: expression that returns the first N request records;
- $expand: expression that allows you to relate entities, for example
get the list of consumptions and respective parts consumed.
When making Odata requests there are two expressions that must be used:
- $select: mandatory expression, must indicate
which fields you want to get;
- $filter: as we limit the number of records per request to 100, we
recommend you filter by the ModifiedOn field, so that you only get new or
modified records.
Example
Below you will find a set of examples of Odata
requests for work orders:
Odata request to obtain work order information
1. https://cloud.valuekeep.com/api/{Tenant}/{Organization}/maintenance/workOrders/odata?$select=Id,Description,WorkOrderType,Equipment,EquipmentId,Customer,CustomerId,Responsible,Workshop,WorkshopDescription,PriorityLevel,Date,WorkOrderKey,AssetType,Location
Odata request to obtain work order information
ignoring the first 100 records
1. https://cloud.valuekeep.com/api/{Tenant}/{Organization}/maintenance/workOrders/odata?$select=Id,Description,WorkOrderType,Equipment,EquipmentId,Customer,CustomerId,Responsible,Workshop,WorkshopDescription,PriorityLevel,Date,WorkOrderKey,AssetType,Location&$filter=WorkOrderType eq 'CR'
Odata request to obtain work order information
ignoring the first 100 records and filtering by WO status
1. https://cloud.valuekeep.com/api/{Tenant}/{Organization}/maintenance/workOrders/odata?$select=Id,Description,WorkOrderType,Equipment,EquipmentId,Customer,CustomerId,Responsible,Workshop,WorkshopDescription,PriorityLevel,Date,WorkOrderKey,AssetType,Location&$filter=WorkOrderType eq 'CR'&$skip=100&$orderby=ModifiedOn
Fields placed in the Select field must begin with
Uppercase letters. You can get the name of the user fields in the select
field from the API Documentation article.