Flexible Navigation (OData)
About OData
The Open Data Protocol is an open protocol that gives API clients the possibility to have various data representations by using HTTP messages.
OData supports several kinds of query options for querying data. API clients may use these different queries to control the payload responses and can therefore perform GET requests more effectively.
(See Additional Information at the bottom of this page for more general information on OData)
Seen below is the list of query options supported by PolyWorks|DataLoop API :
(These queries are listed in the OData and OData2 metaclass in the diagram on this page PolyWorks|DataLoop API Data Model )
$filter query
- $filter :
The $filter query filters the list that is returned and allows the API client to obtain only the resources that matches certain criteria.
Below is a simple example of how to use the filter query.
https://example.com/dataloopcore/api/metrology/v2/Workspaces?$filter=name eq 'Block_Retention'
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#Workspaces",
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"id": "16454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "Block_Retention",
"note": "",
"creationDateSystem": "2020-09-11T11:32:57.213766Z",
"modificationDateSystem": "2022-05-10T17:26:32.049387Z"
}
]
}
It is possible to use the $filter query on a object that is complex as you can see in the following example:
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$filter=contains(userProperties/Office, '227')
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#InspectorPieces",
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"id": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2021-06-22T12:27:05.672969Z",
"creationDateSystem": "2021-06-22T12:27:09.204899Z",
"modificationDateSystem": "2022-05-10T17:46:44.494477Z",
"snapshotHash": "64465e43c91113efbed0809760cb37c44256bd38",
"webInterfaceUrl": "https://staging1.dl.server.dev.polyworks.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzdtCIEeyWF6S7bd8G_w",
"controlsCount": 38,
"failedControlsCount": 2,
"measuredControlsCount": 38,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Live",
"E-Mail address": "rdelmont@gmail.com",
"Office": "227",
"Operator name": "Dedel",
"Order number": "2",
"Serial number": "101002"
}
}
]
}
Datetime filtering
When filtering by datetime property, you can use either UTC or local time expressed in the ISO-8601 notation. For example, "2007-04-05T14:30Z" or "2007-04-05T12:30−02:00".
Please note that the date time property returned through the API is always in UTC.
Advanced filtering
If a special character is present in the property name used for filtering, escape characters should be used with the rules defined for XML encoding, for example using the x#### notation.
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$filter=userProperties/Line_x0020_number eq '2'
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$filter=userProperties/_x4e2d__x56fd_ eq '中囯'
If multiple filters are being applied to a request, logical operator keywords such as 'and' and 'or' must be used when listing them.
See http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#_Toc31358949 for more information.
$count query
- $count :
The $count query allows the API client to see the amount of matching items of the request. This is particularly useful if combined with $top or $skip because you will have an idea of the number of pages you have to navigate through without having to transfer all the data at once.
Here is an example of the use of the $count query alone. Notice the JSON returns, within the property "@odata.count", the number of workspaces that were found. A more complex example is available below in the $skip section.
https://example.com/dataloopcore/api/metrology/v2/Workspaces?$count=true
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#Workspaces",
"@odata.count": 2,
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"id": "16454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "Block_Retention",
"note": "",
"creationDateSystem": "2020-09-11T11:32:57.213766Z",
"modificationDateSystem": "2022-05-10T17:26:32.049387Z"
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Mjo0OS42MDc3OTla\"",
"id": "3fb3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "AllJson",
"note": "",
"creationDateSystem": "2021-06-21T21:44:43.522426Z",
"modificationDateSystem": "2022-05-10T17:42:42.319206Z"
}
]
}
$orderBy query
- $orderBy:
The $orderBy query allows API clients to sort the list of resources that is returned in either ascending order or descending order based on a certain property in the resource. As shown below, the request that obtains a list of InspectorPieces ordered by the measuredControlsCount property.
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$orderby=measuredControlsCount desc
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#InspectorPieces",
"value": [{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"id": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2021-06-21T21:35:10.733715Z",
"creationDateSystem": "2021-06-21T21:44:49.252166Z",
"modificationDateSystem": "2022-05-10T17:42:42.314219Z",
"snapshotHash": "701fdab77c7c04580286249e696c1fb6f35467c5",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzQdCIEeyWF6S7bd8G_w",
"controlsCount": 53,
"failedControlsCount": 9,
"measuredControlsCount": 53,
"warningControlsCount": 1,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Simulator",
"E-Mail address": "rdelmont@innovmetric.com",
"Line": "Playground",
"Operator name": "Romu",
"Order number": "1",
"Serial number": "101001"
}
}, {
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"id": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2021-06-22T12:27:05.672969Z",
"creationDateSystem": "2021-06-22T12:27:09.204899Z",
"modificationDateSystem": "2022-05-10T17:46:44.494477Z",
"snapshotHash": "64465e43c91113efbed0809760cb37c44256bd38",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzdtCIEeyWF6S7bd8G_w",
"controlsCount": 38,
"failedControlsCount": 2,
"measuredControlsCount": 38,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Live",
"E-Mail address": "rdelmont@gmail.com",
"Office": "227",
"Operator name": "Dedel",
"Order number": "2",
"Serial number": "101002"
}
}, {
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"id": "18454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2020-09-11T11:31:53.973416Z",
"creationDateSystem": "2020-09-11T11:33:01.616255Z",
"modificationDateSystem": "2022-05-10T17:26:32.045397Z",
"snapshotHash": "9b72b930b125ba5901e98ef163bfe00222d56bdc",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFGNCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
}, {
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNi41MzIwNVo=\"",
"id": "35454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2020-09-11T20:53:05.116134Z",
"creationDateSystem": "2020-09-11T20:53:06.636192Z",
"modificationDateSystem": "2022-05-10T17:26:22.007992Z",
"snapshotHash": "ea789a49de317f2dd17d806a29e2be19a715b27e",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFNdCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
}
}
]
}
$top query
- $top:
The $top query requests a certain number of results from the top of the list of resources to be returned in the answer.
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$top=2
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#InspectorPieces",
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"id": "18454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2020-09-11T11:31:53.973416Z",
"creationDateSystem": "2020-09-11T11:33:01.616255Z",
"modificationDateSystem": "2022-05-10T17:26:32.045397Z",
"snapshotHash": "9b72b930b125ba5901e98ef163bfe00222d56bdc",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFGNCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNi41MzIwNVo=\"",
"id": "35454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2020-09-11T20:53:05.116134Z",
"creationDateSystem": "2020-09-11T20:53:06.636192Z",
"modificationDateSystem": "2022-05-10T17:26:22.007992Z",
"snapshotHash": "ea789a49de317f2dd17d806a29e2be19a715b27e",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFNdCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
}
]
}
$skip query
- $skip:
The $skip query allows a certain number of results to not be included in the list of resources that are returned. This is often used in combination with $top and $count to get results by page. In the example that follows, it is possible to see that the list that contains four items returns the results omitting the two first InspectorPieces.
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$skip=2&$count=true
"@odata.context": "https://example.com/dataloopcore/api/metrology/v1/$metadata#InspectorPieces",
"@odata.count": 4,
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"id": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2021-06-21T21:35:10.733715Z",
"creationDateSystem": "2021-06-21T21:44:49.252166Z",
"modificationDateSystem": "2022-05-10T17:42:42.314219Z",
"snapshotHash": "701fdab77c7c04580286249e696c1fb6f35467c5",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzQdCIEeyWF6S7bd8G_w",
"controlsCount": 53,
"failedControlsCount": 9,
"measuredControlsCount": 53,
"warningControlsCount": 1,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Simulator",
"E-Mail address": "rdelmont@innovmetric.com",
"Line": "Playground",
"Operator name": "Romu",
"Order number": "1",
"Serial number": "101001"
}
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"id": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2021-06-22T12:27:05.672969Z",
"creationDateSystem": "2021-06-22T12:27:09.204899Z",
"modificationDateSystem": "2022-05-10T17:46:44.494477Z",
"snapshotHash": "64465e43c91113efbed0809760cb37c44256bd38",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzdtCIEeyWF6S7bd8G_w",
"controlsCount": 38,
"failedControlsCount": 2,
"measuredControlsCount": 38,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Live",
"E-Mail address": "rdelmont@gmail.com",
"Office": "227",
"Operator name": "Dedel",
"Order number": "2",
"Serial number": "101002"
}
}
]
}
The $skip query must be applied before the $top query, in cases where these queries are used together, regardless of the order in which they appear in the request. The service must impose a stable ordering across requests that include $skip. Since our service does not impose the use of $orderBy, the developer must therefore use the $orderBy query whenever the $top or $skip query are used.
$expand query
- $expand:
The $expand query allows the API client to retrieve the related resources connected to the resources initially returned. Multiple navigation properties can be specified at the same time. In the example below, it is possible to see the different InspectorProjects with the details concerning each of their InspectorPieces.
https://example.com/dataloopcore/api/metrology/v2/InspectorProjects?$expand=inspectorPieces
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#InspectorProjects(inspectorPieces())",
"value": [
{
"@odata.etag": "W/\"MjAyNC0wMy0wN1QxNDo0ODoyNi44NjUyNTVa\"",
"id": "17454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "Block",
"note": "Choux",
"snapshotHash": "ea789a49de317f2dd17d806a29e2be19a715b27e",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w",
"userProperties": null,
"inspectorPieces": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"id": "18454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2020-09-11T11:31:53.973416Z",
"creationDateSystem": "2020-09-11T11:33:01.616255Z",
"modificationDateSystem": "2022-05-10T17:26:32.045397Z",
"snapshotHash": "9b72b930b125ba5901e98ef163bfe00222d56bdc",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFGNCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNi41MzIwNVo=\"",
"id": "35454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2020-09-11T20:53:05.116134Z",
"creationDateSystem": "2020-09-11T20:53:06.636192Z",
"modificationDateSystem": "2022-05-10T17:26:22.007992Z",
"snapshotHash": "ea789a49de317f2dd17d806a29e2be19a715b27e",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFNdCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
}
]
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"id": "40b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "BlockJson",
"note": "",
"snapshotHash": "b84b15f03db6c6682a3b82f8d45a0f5c376445bd",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w",
"userProperties": {
"Customer name": "Nasa",
"Organization": "Innovmetric",
"Part drawing number": "None",
"Part name": "Block",
"Part number": "1",
"Production order": "101"
},
"inspectorPieces": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"id": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2021-06-21T21:35:10.733715Z",
"creationDateSystem": "2021-06-21T21:44:49.252166Z",
"modificationDateSystem": "2022-05-10T17:42:42.314219Z",
"snapshotHash": "701fdab77c7c04580286249e696c1fb6f35467c5",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzQdCIEeyWF6S7bd8G_w",
"controlsCount": 53,
"failedControlsCount": 9,
"measuredControlsCount": 53,
"warningControlsCount": 1,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Simulator",
"E-Mail address": "rdelmont@innovmetric.com",
"Line": "Playground",
"Operator name": "Romu",
"Order number": "1",
"Serial number": "101001"
}
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"id": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2021-06-22T12:27:05.672969Z",
"creationDateSystem": "2021-06-22T12:27:09.204899Z",
"modificationDateSystem": "2022-05-10T17:46:44.494477Z",
"snapshotHash": "64465e43c91113efbed0809760cb37c44256bd38",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzdtCIEeyWF6S7bd8G_w",
"controlsCount": 38,
"failedControlsCount": 2,
"measuredControlsCount": 38,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Live",
"E-Mail address": "rdelmont@gmail.com",
"Office": "227",
"Operator name": "Dedel",
"Order number": "2",
"Serial number": "101002"
}
}
]
}
]
}
The following example contains a request that contains multiple $expand queries so it is possible to see the different Workspaces that contain InspectorProjects that also contain InspectorPieces.
https://example.com/dataloopcore/api/metrology/v2/Workspaces?$expand=inspectorProjects($expand=inspectorPieces)
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#Workspaces(inspectorProjects(inspectorPieces()))",
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"id": "16454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "Block_Retention",
"note": "",
"creationDateSystem": "2020-09-11T11:32:57.213766Z",
"modificationDateSystem": "2022-05-10T17:26:32.049387Z",
"inspectorProjects": [
{
"@odata.etag": "W/\"MjAyNC0wMy0wN1QxNDo0ODoyNi44NjUyNTVa\"",
"id": "17454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "Block",
"note": "Choux",
"snapshotHash": "ea789a49de317f2dd17d806a29e2be19a715b27e",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w",
"userProperties": null,
"inspectorPieces": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"id": "18454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2020-09-11T11:31:53.973416Z",
"creationDateSystem": "2020-09-11T11:33:01.616255Z",
"modificationDateSystem": "2022-05-10T17:26:32.045397Z",
"snapshotHash": "9b72b930b125ba5901e98ef163bfe00222d56bdc",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFGNCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNi41MzIwNVo=\"",
"id": "35454855-86d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2020-09-11T20:53:05.116134Z",
"creationDateSystem": "2020-09-11T20:53:06.636192Z",
"modificationDateSystem": "2022-05-10T17:26:22.007992Z",
"snapshotHash": "ea789a49de317f2dd17d806a29e2be19a715b27e",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=VUhFF9CGEeyWF6S7bd8G_w&pieceId=VUhFNdCGEeyWF6S7bd8G_w",
"controlsCount": 12,
"failedControlsCount": null,
"measuredControlsCount": 12,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": null
}
]
}
]
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Mjo0OS42MDc3OTla\"",
"id": "3fb3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "AllJson",
"note": "",
"creationDateSystem": "2021-06-21T21:44:43.522426Z",
"modificationDateSystem": "2022-05-10T17:42:42.319206Z",
"inspectorProjects": [
{
"@odata.etag": "W/\"MjAyNC0wNC0xNVQyMDoxMDozMC44Nzg1ODZa\"",
"id": "40b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "BlockJson",
"note": "",
"snapshotHash": "b84b15f03db6c6682a3b82f8d45a0f5c376445bd",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w",
"userProperties": {
"Customer name": "Nasa",
"Organization": "Innovmetric",
"Part drawing number": "DN-001",
"Part name": "Block",
"Part number": "1",
"Production order": "101"
},
"inspectorPieces": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"id": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 1",
"creationDateUser": "2021-06-21T21:35:10.733715Z",
"creationDateSystem": "2021-06-21T21:44:49.252166Z",
"modificationDateSystem": "2022-05-10T17:42:42.314219Z",
"snapshotHash": "701fdab77c7c04580286249e696c1fb6f35467c5",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzQdCIEeyWF6S7bd8G_w",
"controlsCount": 53,
"failedControlsCount": 9,
"measuredControlsCount": 53,
"warningControlsCount": 1,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Simulator",
"E-Mail address": "rdelmont@innovmetric.com",
"Line": "Playground",
"Operator name": "Romu",
"Order number": "1",
"Serial number": "101001"
}
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"id": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"name": "piece 2",
"creationDateUser": "2021-06-22T12:27:05.672969Z",
"creationDateSystem": "2021-06-22T12:27:09.204899Z",
"modificationDateSystem": "2022-05-10T17:46:44.494477Z",
"snapshotHash": "64465e43c91113efbed0809760cb37c44256bd38",
"webInterfaceUrl": "https://example.com/polyworks/dataloop/#/projectReviewV3.html?prjId=mfGzQNCIEeyWF6S7bd8G_w&pieceId=mfGzdtCIEeyWF6S7bd8G_w",
"controlsCount": 38,
"failedControlsCount": 2,
"measuredControlsCount": 38,
"warningControlsCount": null,
"approvalStatus": "Undefined",
"userProperties": {
"Device": "Live",
"E-Mail address": "rdelmont@gmail.com",
"Office": "227",
"Operator name": "Dedel",
"Order number": "2",
"Serial number": "101002"
}
}
]
}
]
}
]
}
$select query
- $select:
The $select query allows the API client to request a subset of properties from each of the resources so the returned payloads may be more pertinent. In the following example, the request returns the name and email of every single one of the InspectorPieces.
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$select=userProperties, name
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#InspectorPieces(userProperties,name)",
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"name": "piece 1",
"userProperties": null
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNi41MzIwNVo=\"",
"name": "piece 2",
"userProperties": null
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"name": "piece 1",
"userProperties": {
"Device": "Simulator",
"E-Mail address": "rdelmont@innovmetric.com",
"Line": "Playground",
"Operator name": "Romu",
"Order number": "1",
"Serial number": "101001"
}
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"name": "piece 2",
"userProperties": {
"Device": "Live",
"E-Mail address": "rdelmont@gmail.com",
"Office": "227",
"Operator name": "Dedel",
"Order number": "2",
"Serial number": "101002"
}
}
]
}
The OData JSON payload
It is important to note that, when returning the JSON payload of a GET request, OData stocks the JSON in a property named "value", so bear this in mind when accessing the data of the resource.
Combining multiple queries
It is possible for many different queries to be applied to one single GET request. Therefore, a GET request could obtain the top twenty resources in a list and also display them in ascending order based on their 'name' property for example, and all this within the same request.
It is also possible to apply multiple queries to a list of resources returned after having already applied multiple expand queries on the request.
The example below displays the use of multiple queries within one request:
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$select=userProperties,name&$skip=2&$count=true&$expand=measurementObjects
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#InspectorPieces(userProperties,name,measurementObjects())",
"@odata.count": 4,
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"name": "piece 1",
"userProperties": {
"Device": "Simulator",
"E-Mail address": "rdelmont@innovmetric.com",
"Line": "Playground",
"Operator name": "Romu",
"Order number": "1",
"Serial number": "101001"
},
"measurementObjects": [
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"id": "2ac62da5-3ca9-4118-8555-416e0c6e1f6f",
"name": "datum cylinder C",
"type": "Cylinder",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "C",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"id": "ee7d002e-7c52-4f2a-8e32-7ac04f073ea6",
"name": "cylinder 2",
"type": "Cylinder",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"id": "3222223b-cac0-4ad6-b866-0535cd3ad353",
"name": "datum plane B",
"type": "Plane",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "B",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "3021847d-7855-4d81-a5aa-5e6fdec4cf9d",
"name": "circle 1",
"type": "Circle",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "1004337d-c106-44f9-9455-c3458845a385",
"name": "circle 2",
"type": "Circle",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "9b09ef72-d420-4f56-b891-4ac55dbd0b10",
"name": "circle 3",
"type": "Circle",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "40231147-d50e-42b1-b191-d52b5738eba6",
"name": "circle 5",
"type": "Circle",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "e2c63389-d7cb-4276-abdc-68a953f76ffd",
"name": "circle 4",
"type": "Circle",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PatternDto",
"id": "ceee8517-dfb2-4723-b645-48bf2b56995e",
"name": "datum pattern A",
"type": "Circle Pattern",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "A",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"id": "338d95c0-0173-4f36-b300-ade9a8b61d77",
"name": "line 1",
"type": "Line",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"id": "23bb5450-a3e4-4344-b4cb-81a18abf4aa4",
"name": "line 2",
"type": "Line",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.AngleDto",
"id": "7e5ff56e-1809-4021-878d-828d26079e8e",
"name": "angle 1",
"type": "Angle",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"feature": "line 2",
"refFeature": "line 1",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ConeDto",
"id": "3d0427ad-4533-4fa2-ba54-03fe9417ef38",
"name": "Conical",
"type": "Cone",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CrossSectionDto",
"id": "b92ac1e9-6ead-4ebf-bc4e-f0414ec6bdf2",
"name": "c-s 1 (Y=-59.097)",
"type": "Cross-Section",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CrossSectionDto",
"id": "ed4ca667-6305-4567-8643-a242c6b5ca2e",
"name": "airfoil 1 c-s",
"type": "Cross-Section",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"id": "d07a151a-1e84-4cf6-8fb4-496828fe181e",
"name": "surf pt - hem pt 1",
"type": "Surface Point",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null,
"nominal": {
"x": null,
"y": null,
"z": null
}
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"id": "fd2c750e-d640-4e7f-a7e9-88848251de18",
"name": "hem pt 1",
"type": "Hem Point",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null,
"nominal": {
"x": null,
"y": null,
"z": null
}
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"id": "ec4dbe13-dcd8-4361-9e16-143493625e08",
"name": "surf pt - hem pt 2",
"type": "Surface Point",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null,
"nominal": {
"x": null,
"y": null,
"z": null
}
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"id": "d8048ad2-2d8d-41d7-b9b1-39b873c84abe",
"name": "hem pt 2",
"type": "Hem Point",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null,
"nominal": {
"x": null,
"y": null,
"z": null
}
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"id": "303d3474-606f-48c8-8ea8-b79625bfebbe",
"name": "surf pt - trim pt 1",
"type": "Surface Point",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null,
"nominal": {
"x": null,
"y": null,
"z": null
}
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"id": "e0aed893-ceaa-43ec-a27b-1d1166561a17",
"name": "trim pt 1",
"type": "Boundary Point",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null,
"nominal": {
"x": null,
"y": null,
"z": null
}
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CaliperDto",
"id": "cc6b2df8-f3cd-4a35-acdc-ff8e1878e243",
"name": "caliper 1",
"type": "Caliper",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.AirfoilGaugeDto",
"id": "827b2e3f-a6e7-439d-acea-3215e996a989",
"name": "airfoil 1",
"type": "Airfoil Gauge",
"_InspectorPieceID": "41b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
}
]
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"name": "piece 2",
"userProperties": {
"Device": "Live",
"E-Mail address": "rdelmont@gmail.com",
"Office": "227",
"Operator name": "Dedel",
"Order number": "2",
"Serial number": "101002"
},
"measurementObjects": [
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"id": "2ac62da5-3ca9-4118-8555-416e0c6e1f6f",
"name": "datum cylinder C",
"type": "Cylinder",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "C",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"id": "ee7d002e-7c52-4f2a-8e32-7ac04f073ea6",
"name": "cylinder 2",
"type": "Cylinder",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"id": "3222223b-cac0-4ad6-b866-0535cd3ad353",
"name": "datum plane B",
"type": "Plane",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "B",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "3021847d-7855-4d81-a5aa-5e6fdec4cf9d",
"name": "circle 1",
"type": "Circle",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "1004337d-c106-44f9-9455-c3458845a385",
"name": "circle 2",
"type": "Circle",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "9b09ef72-d420-4f56-b891-4ac55dbd0b10",
"name": "circle 3",
"type": "Circle",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "40231147-d50e-42b1-b191-d52b5738eba6",
"name": "circle 5",
"type": "Circle",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"id": "e2c63389-d7cb-4276-abdc-68a953f76ffd",
"name": "circle 4",
"type": "Circle",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PatternDto",
"id": "ceee8517-dfb2-4723-b645-48bf2b56995e",
"name": "datum pattern A",
"type": "Circle Pattern",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "A",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"id": "338d95c0-0173-4f36-b300-ade9a8b61d77",
"name": "line 1",
"type": "Line",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"id": "23bb5450-a3e4-4344-b4cb-81a18abf4aa4",
"name": "line 2",
"type": "Line",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.AngleDto",
"id": "7e5ff56e-1809-4021-878d-828d26079e8e",
"name": "angle 1",
"type": "Angle",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"feature": "line 2",
"refFeature": "line 1",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ConeDto",
"id": "3d0427ad-4533-4fa2-ba54-03fe9417ef38",
"name": "Conical",
"type": "Cone",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"datumLabel": "",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CrossSectionDto",
"id": "b92ac1e9-6ead-4ebf-bc4e-f0414ec6bdf2",
"name": "c-s 1 (Y=-59.097)",
"type": "Cross-Section",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CaliperDto",
"id": "cc6b2df8-f3cd-4a35-acdc-ff8e1878e243",
"name": "caliper 1",
"type": "Caliper",
"_InspectorPieceID": "76b3f199-88d0-ec11-9617-a4bb6ddf06ff",
"customProperties": null
}
]
}
]
}
The $expand and the $select queries are particular. They can be used on the resources in a nested type of way and eventually allow the API client to access resources that may be separated by two, three, or more composition connectors without having to make a new query.
Query options can be applied to a select item that is a path to a single complex value or a collection of primitive or complex values by adding a list of query options separated by semi-colons, enclosed in parentheses, to the select item.
Here is an example containing nested $expand and $select queries which well illustrates the preceding points mentioned.
https://example.com/dataloopcore/api/metrology/v2/InspectorPieces?$select=name&top=10&$expand=measurementObjects($select=controls,name;$expand=controls($select=measured))
{
"@odata.context": "https://127.0.0.1/dataloopcore/metrologydata/v1/$metadata#InspectorPieces(name,measurementObjects(controls,name,controls(measured)))",
"value": [
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNC4wMTY0MjVa\"",
"name": "piece 1",
"measurementObjects": [
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 2",
"controls": [
{
"measured": 6.376
},
{
"measured": -61.728
},
{
"measured": -50.18
},
{
"measured": 12.702
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 3",
"controls": [
{
"measured": 6.319
},
{
"measured": -88.136
},
{
"measured": -50.133
},
{
"measured": 12.662
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"name": "plane 1",
"controls": [
{
"measured": 0.083
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"name": "plane 2",
"controls": [
{
"measured": 0.073
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"name": "cylinder 1",
"controls": [
{
"measured": 12.722
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ConeDto",
"name": "cone 1",
"controls": [
{
"measured": 60.443
}
]
}
]
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzoyNjozNi41MzIwNVo=\"",
"name": "piece 2",
"measurementObjects": [
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 2",
"controls": [
{
"measured": 6.376
},
{
"measured": -61.728
},
{
"measured": -50.18
},
{
"measured": 12.702
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 3",
"controls": [
{
"measured": 6.319
},
{
"measured": -88.136
},
{
"measured": -50.133
},
{
"measured": 12.662
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"name": "plane 1",
"controls": [
{
"measured": 0.083
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"name": "plane 2",
"controls": [
{
"measured": 0.073
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"name": "cylinder 1",
"controls": [
{
"measured": 12.722
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ConeDto",
"name": "cone 1",
"controls": [
{
"measured": 60.443
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"name": "plane 5",
"controls": []
}
]
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0Njo1OC44OTY1MDZa\"",
"name": "piece 1",
"measurementObjects": [
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"name": "datum cylinder C",
"controls": [
{
"measured": 12.614
},
{
"measured": 12.771
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"name": "cylinder 2",
"controls": [
{
"measured": 12.722
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"name": "datum plane B",
"controls": [
{
"measured": 0.061
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 1",
"controls": [
{
"measured": 6.376
},
{
"measured": -61.846
},
{
"measured": -50.241
},
{
"measured": 12.66
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 2",
"controls": [
{
"measured": 6.319
},
{
"measured": -88.253
},
{
"measured": -50.119
},
{
"measured": 12.652
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 3",
"controls": [
{
"measured": 6.405
},
{
"measured": -53.626
},
{
"measured": -25.158
},
{
"measured": 12.657
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 5",
"controls": [
{
"measured": 6.358
},
{
"measured": -96.387
},
{
"measured": -24.972
},
{
"measured": 12.652
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 4",
"controls": [
{
"measured": 6.427
},
{
"measured": -75.002
},
{
"measured": -9.511
},
{
"measured": 12.663
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PatternDto",
"name": "datum pattern A",
"controls": [
{
"measured": 6.152
},
{
"measured": 44.953
},
{
"measured": -75.017
},
{
"measured": -31.99
},
{
"measured": 12.657
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"name": "line 1",
"controls": []
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"name": "line 2",
"controls": []
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.AngleDto",
"name": "angle 1",
"controls": [
{
"measured": 134.555
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ConeDto",
"name": "Conical",
"controls": [
{
"measured": 0.007
},
{
"measured": 94.172
},
{
"measured": 60.441
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CrossSectionDto",
"name": "c-s 1 (Y=-59.097)",
"controls": [
{
"measured": 0.521
},
{
"measured": -0.144
},
{
"measured": 0.261
},
{
"measured": 0.022
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CrossSectionDto",
"name": "airfoil 1 c-s",
"controls": [
{
"measured": 2.45
},
{
"measured": -1.225
},
{
"measured": 0.657
},
{
"measured": 0.026
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"name": "surf pt - hem pt 1",
"controls": [
{
"measured": 0.081
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"name": "hem pt 1",
"controls": [
{
"measured": 0.058
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"name": "surf pt - hem pt 2",
"controls": [
{
"measured": 0.094
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"name": "hem pt 2",
"controls": [
{
"measured": 0.051
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"name": "surf pt - trim pt 1",
"controls": [
{
"measured": 0.105
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ComparisonPointDto",
"name": "trim pt 1",
"controls": [
{
"measured": 1.016
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CaliperDto",
"name": "caliper 1",
"controls": [
{
"measured": 75.861
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.AirfoilGaugeDto",
"name": "airfoil 1",
"controls": [
{
"measured": 40.738
},
{
"measured": -8.485
},
{
"measured": 13.795
},
{
"measured": 4.349
},
{
"measured": 12.311
}
]
}
]
},
{
"@odata.etag": "W/\"MjAyMi0wNS0xMFQxNzo0NzowNC4zNTAyOTla\"",
"name": "piece 2",
"measurementObjects": [
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"name": "datum cylinder C",
"controls": [
{
"measured": 12.614
},
{
"measured": 12.771
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CylinderDto",
"name": "cylinder 2",
"controls": [
{
"measured": 12.722
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PlaneDto",
"name": "datum plane B",
"controls": [
{
"measured": 0.061
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 1",
"controls": [
{
"measured": 6.376
},
{
"measured": -61.846
},
{
"measured": -50.241
},
{
"measured": 12.66
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 2",
"controls": [
{
"measured": 6.319
},
{
"measured": -88.253
},
{
"measured": -50.119
},
{
"measured": 12.652
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 3",
"controls": [
{
"measured": 6.405
},
{
"measured": -53.626
},
{
"measured": -25.158
},
{
"measured": 12.657
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 5",
"controls": [
{
"measured": 6.358
},
{
"measured": -96.387
},
{
"measured": -24.972
},
{
"measured": 12.652
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CircleDto",
"name": "circle 4",
"controls": [
{
"measured": 6.427
},
{
"measured": -75.002
},
{
"measured": -9.511
},
{
"measured": 12.663
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.PatternDto",
"name": "datum pattern A",
"controls": [
{
"measured": 6.152
},
{
"measured": 44.953
},
{
"measured": -75.017
},
{
"measured": -31.99
},
{
"measured": 12.657
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"name": "line 1",
"controls": []
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.LineDto",
"name": "line 2",
"controls": []
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.AngleDto",
"name": "angle 1",
"controls": [
{
"measured": 134.555
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.ConeDto",
"name": "Conical",
"controls": [
{
"measured": 0.007
},
{
"measured": 94.172
},
{
"measured": 60.441
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CrossSectionDto",
"name": "c-s 1 (Y=-59.097)",
"controls": [
{
"measured": 0.521
},
{
"measured": -0.144
},
{
"measured": 0.261
},
{
"measured": 0.022
}
]
},
{
"@odata.type": "#DataLoopCore.Services.MetrologyData.V1.Dtos.Data.CaliperDto",
"name": "caliper 1",
"controls": [
{
"measured": 75.861
}
]
}
]
}
]
}
Using multiple GET requests or adding complex expansions to a single one?
In some cases, it is simpler to invoke multiple queries to return the linked resources rather than accessing the related resources through a series of expansions. When using multiple $expand within the same request, the payload becomes very large and may contain a lot of redundant information not necessarily pertinent to the API client.
When making the decision on whether to create distinct GET requests or to add new $expand, you must also be mindful of the amount of characters allowed in the HTTP GET request when creating the query. The number of bytes worth of information that can be sent in a single request varies depending on the server configuration.
Therefore, it is up to you to decide which method is preferable for accessing specific resources depending on what is desired in the returned payload.
The OData2 Metaclass
The Odata2 Metaclass contains only the $expand and the $select queries. This is because these are the only two queries that can be applied to a GET request if the request contains the id of a certain resource within its endpoint. The payload of the request with the id as an endpoint will therefore not be a list but a single item rather and the $expand and $select queries will be able to be applied to this GET request.
Additional information
For more information, please consult the following documentation:
https://www.odata.org/getting-started/basic-tutorial/
https://www.odata.org/getting-started/advanced-tutorial/
https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html
Updated 10 months ago