Query service očekává POST request. Základní HTTP hlavičky a tělo (body request) jako JSON:
POST https://${serverName}:${port}/api/query/${názevEntity}
Accept: application/json
Content-Type: application/json
Cookie: securityToken=CARD:123456789
X-FySerialization: ui2
${body}
V těle požadavku jde specifikovat filter, řazení, limit
počtu položek (s offset
lze použít stránkování výsledků).
AND
.EQUALS, NOT_EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, EMPTY, NOT_EMPTY, FULL_TEXT, CONTAINS, NOT_CONTAINS, STARTS_WITH, ENDS_WITH, DATE_RANGE, YEAR, MONTH, TODAY
Příklad požadavku.
{
"limit": 10, // maximální počet záznamů (pokud se neuvede, je limit 100 000)
"offset": 1, // 0 = první stránka
"logicalOperator": "AND",
"filterByColumn":{
"id":{
"operator":"GREATER_THAN_OR_EQUAL",
"value":"2",
"noValueOperator":false
},
"name": {
"operator": "FULL_TEXT",
"value": "text",
"noValueOperator": false
}
"createdAt": {
"operator": "DATE_RANGE",
"value": {
"startValue": "2022-01-01",
"endValue": "2022-10-13"
},
"noValueOperator": false
}
},
"sort": [
{
"column": "name",
"direction": "ASC"
},
{
"column": "updatedAt",
"direction": "DESC"
}
]
}
POST http://localhost:82/api/query/Languages
Accept: application/json
Content-Type: application/json
Cookie: securityToken=CARD:123456789
X-FySerialization: ui2
{}
{
"rows": [
{
"id": 1,
"name": "English",
"iso6391": "en",
"iso31662": "US",
"state": "ACTIVE",
"isDefault": false,
"createdAt": "2021-10-18 16:04:54",
"updatedAt": "2021-10-19 09:05:05",
"createdBy": null,
"updatedBy": {
"id": 1,
"referenceName": "Admin Admin"
},
"referenceName": "English"
},
{
"id": 2,
"name": "Čeština",
"iso6391": "cs",
"iso31662": "CZ",
"state": "ACTIVE",
"isDefault": true,
"createdAt": "2021-10-18 16:04:54",
"updatedAt": "2021-10-19 09:05:28",
"createdBy": null,
"updatedBy": {
"id": 1,
"referenceName": "Admin Admin"
},
"referenceName": "Čeština"
}
],
"totalCount": 2
}
POST http://localhost:82/api/query/Stage
Accept: application/json
Content-Type: application/json
Cookie: securityToken=CARD:123456789
X-FySerialization: ui2
{}
{
"rows": [
{
"id": 1,
"name": "Kancelář",
"shortcut": null,
"externalId": null,
"type": "ITEM",
"effectivityPct": 100.0,
"orderWeight": 100,
"productionScreen": null,
"stageDisplayedBatchLimit": 100,
"problemTypes": [],
"machineDowntimeThresholdMin": 15,
"machineFinishingDowntimeThresholdMin": 15,
"leadTimeDuration": 10.0,
"leadTimeUnit": "DAY",
"manipulationBeforeDuration": 0.0,
"manipulationBeforeUnit": "HOUR",
"manipulationAfterDuration": 0.0,
"manipulationAfterUnit": "HOUR",
"batchSplittable": true,
"treeMode": false,
"usableForRepairs": false,
"hideTimesOnStage": false,
"takeNextJob": false,
"checkRepairs": false,
"fixedPreparationTime": false,
"jit": false,
"important": false,
"fixedLeadTime": false,
"generateSerialNumbers": false,
"excludeFromEffectiveness": false,
"displayAllRemainingBoms": false,
"batchNoteEditable": false,
"chooseStockPositionOnFinish": false,
"productDesign": false,
"assembly": false,
"nestings": false,
"hideInPreparation": false,
"startFamilyBatches": false,
"disableParallelGoods": false,
"separatedEffectivity": false,
"cutting1d": false,
"printOnDrawing": false,
"manualPriorityAssignment": false,
"externalCapacity": false,
"outputStockPosition": null,
"nonconformityStockPosition": null,
"note": null,
"createdAt": "2021-11-08 08:58:59",
"updatedAt": "2021-11-08 08:58:59",
"createdBy": {
"id": 3,
"referenceName": "Karel Šebela"
},
"updatedBy": {
"id": 3,
"referenceName": "Karel Šebela"
},
"stageGroup": {
"id": 1,
"name": "THP",
"colorHex": "#fbfbfb",
"orderWeight": 1000,
"costCenter": null,
"transitionMinutes": null,
"consumptionMergeDays": 0,
"rebalanceWorkers": false,
"fixedLeadTime": false,
"hidden": true,
"hideOnMaterialConsumption": false,
"createdAt": "2021-10-18 16:04:54",
"updatedAt": "2021-11-11 15:14:06",
"createdBy": null,
"updatedBy": {
"id": 3,
"referenceName": "Karel Šebela"
},
"referenceName": "THP"
},
"costCenter": null,
"defaultPrinter": null,
"preferredStock": null,
"stock": {
"id": 1,
"name": "Hlavni sklad",
"receiveStock": false,
"productionStock": false,
"separate": false,
"dispatch": false,
"company": {
"id": 1,
"defaultBankAccount": null,
"currency": "CZK",
"personalPickup": false,
"referenceName": "Factorify s.r.o."
},
"externalId": null,
"dispositionArea": null,
"plant": null,
"readPermission": null,
"receivePermission": null,
"issuePermission": null,
"palletMaximumCapacity": null,
"createdAt": "2021-10-18 16:04:54",
"updatedAt": "2022-03-04 07:36:27",
"createdBy": null,
"updatedBy": {
"id": 3,
"referenceName": "Karel Šebela"
},
"referenceName": "Hlavni sklad"
},
"outputStock": {
"id": 1,
"name": "Hlavni sklad",
"receiveStock": false,
"productionStock": false,
"separate": false,
"dispatch": false,
"company": {
"id": 1,
"defaultBankAccount": null,
"currency": "CZK",
"personalPickup": false,
"referenceName": "Factorify s.r.o."
},
"externalId": null,
"dispositionArea": null,
"plant": null,
"readPermission": null,
"receivePermission": null,
"issuePermission": null,
"palletMaximumCapacity": null,
"createdAt": "2021-10-18 16:04:54",
"updatedAt": "2022-03-04 07:36:27",
"createdBy": null,
"updatedBy": {
"id": 3,
"referenceName": "Karel Šebela"
},
"referenceName": "Hlavni sklad"
},
"dispositionArea": null,
"plant": null,
"nonconformityStock": null,
"referenceName": "Kancelář"
},
..... // další položky
],
"totalCount": 14
}
POST http://localhost:82/api/query/Enum
Accept: application/json
Content-Type: application/json
Cookie: securityToken=CARD:123456789
X-FySerialization: ui2
{}
{
"rows": [
{
"id": "CARRIERS",
"name": "Přepravci",
"numerical": false,
"deletable": false,
"createdAt": "2021-10-18 16:04:54",
"updatedAt": "2021-10-18 16:04:54",
"createdBy": null,
"updatedBy": null,
"referenceName": "Přepravci"
},
{
"id": "MATERIAL_UNITS",
"name": "Jednotky materiálů",
"numerical": false,
"deletable": false,
"createdAt": "2021-10-18 16:04:54",
"updatedAt": "2021-10-18 16:04:54",
"createdBy": null,
"updatedBy": null,
"referenceName": "Jednotky materiálů"
},
... // další položky
],
"totalCount": 65
}
Číselníky jsou specifický typ entity. Pro získání hodnot číselníku je třeba volat specifický endpoint.
GET http://localhost:82/api/enum/MATERIAL_UNITS
Accept: application/json
Cookie: securityToken=CARD:123456789
X-FySerialization: ui2
{
"createdAt": "2021-10-18 16:04",
"updatedAt": "2021-10-18 16:04",
"id": "MATERIAL_UNITS",
"name": {
"1": "Material units",
"2": "Jednotky materiálů"
},
"numerical": false,
"values": [
{
"createdAt": "2021-10-18 16:04",
"updatedAt": "2021-10-18 16:04",
"id": 69,
"enumIdId": "MATERIAL_UNITS",
"code": "cm",
"label": {
"1": "cm",
"2": "cm"
},
"deletable": true,
"changed": false,
"referenceName": "69"
},
{
"createdAt": "2021-10-18 16:04",
"updatedAt": "2021-10-18 16:04",
"id": 70,
"enumIdId": "MATERIAL_UNITS",
"code": "cm2",
"label": {
"1": "cm2",
"2": "cm2"
},
"deletable": true,
"changed": false,
"referenceName": "70"
},
.... // další položky
],
"deletable": false,
"new": false
}