0
Been looking at this for a few hours now and am struggling to work out how to deserialize the response from a call to a Web API. We had a previous version that worked fine but the Endpoint structure changed after an update to API and as a result the code no longer works.
Basically I am trying to extract the Tasks returned from the results of the API call, see below for a structure of the returned API call from Postman.
In the previous version there was no "Order" element, can anyone assist in showing how I can get access to the Tasks as a List so I can process them?
Regards Peter.
Been looking at this for a few hours now and am struggling to work out how to deserialize the response from a call to a Web API. We had a previous version that worked fine but the Endpoint structure changed after an update to API and as a result the code no longer works.
Basically I am trying to extract the Tasks returned from the results of the API call, see below for a structure of the returned API call from Postman.
JavaScript:
"Version": 1,
"Result": "Success",
"Data": {
"Order": {
"Oid": "f3a3afa9-ac2b-4914-b3cb-585c761f2dfb",
"Did": 265532,
"Tasks": [
{
"Oid": "af82ce50-0587-4752-ba3b-d60dbfebe041",
"CreatedOn": "2023-05-19T02:24:55.437Z",
"ChangedOn": "2023-05-19T02:45:26.28Z",
"Description": "",
"Comment": "",
"IsStarted": false,
"ScheduledOn": "2023-05-19T12:14:51.507",
"ProductionDeadline": "2023-05-21T16:00:00",
"ScheduledStart": "2023-05-19T11:56:00",
"ScheduledEnd": "2023-05-19T12:04:00",
"RealStart": "0001-01-01T00:00:00",
"RealEnd": "0001-01-01T00:00:00",
"OrderItemPartsCount": 27,
"CalculatedSeconds": "120",
"IdleSeconds": "0",
"ScheduledSeconds": 480,
"RealSeconds": 0,
"PercentComplete": 0,
"HasFinishedItems": false,
"IsCustomTask": false,
"AppointmentType": "OrderSpecificAppointment",
"Station": {
"_Value": "Centurio",
"oid": "f7f3c5fe-49f0-4a9a-b366-29c4ab990fc7"
},
"MasterTask": {
"_Value": "",
"oid": "179212f4-ff0e-465d-962c-51b7da711bb7"
}
},
{
"Oid": "72b6a0ba-cbc2-4f9b-9372-86805d40f7e3",
"CreatedOn": "2023-05-19T02:24:55.437Z",
"ChangedOn": "2023-05-19T02:25:28.37Z",
"Description": "",
"Comment": "",
"IsStarted": false,
"ScheduledOn": "2023-05-19T11:54:55.437",
"ProductionDeadline": "2023-05-21T16:00:00",
"ScheduledStart": "2023-05-19T12:11:00",
"ScheduledEnd": "2023-05-19T13:10:00",
"RealStart": "0001-01-01T00:00:00",
"RealEnd": "0001-01-01T00:00:00",
"OrderItemPartsCount": 27,
"CalculatedSeconds": "3540",
"IdleSeconds": "0",
"ScheduledSeconds": 3540,
"RealSeconds": 0,
"PercentComplete": 0,
"HasFinishedItems": false,
"IsCustomTask": false,
"AppointmentType": "OrderSpecificAppointment",
"Station": {
"_Value": "Twinmatic",
"oid": "d92a32c3-0763-49d7-a8eb-77ea68afa311"
}
}
]
}
},
"Details": ""
}
Regards Peter.
Last edited by a moderator: