What type is the CreatedOn parameter of REST API Endpoint DELETE /ReportMonitors?

I’m trying to call
DELETE /ReportMonitors({UserID},{WorkStationID},{CreatedOn},{RecSeq})

The Swagger UI claims that all the parameters are string (although RecSeq is really an integer). When I try to call the endpoint from the Swagger interface (or from my own code) I get a 500 error:

'{“HttpStatus”:500,“ReasonPhrase”:“REST API Exception”,“ErrorMessage”:“Specified cast is not valid.”,“ErrorType”:“System.InvalidCastException”}`

Because it fails from the Swagger interface, I am focusing on the CreatedOn parameter. I am trying to use the exact string returned from the /Ice.BO.ReportMonitorSvc/GetRowsKeepIdleTimeWithBallonInfo endpoint: 2025-12-06T09:27:34.

But I have tried many different variations and combinations such as omitting the single quotes on the CreatedOn and/or RecSeq parameter and prepending the CreatedOn parameter with “datetime” (without quotes), and nothing is working. It just keeps telling me there is an invalid cast but I have tried all the formats I can think of.

Just an idea, are you using the V1 Swagger endpoint or the V2 one? The V1 one does not handle datetime variables at all. We discovered this a few years ago. If possible, don’t reference datetime fields in V1 (read is ok, just can’t write)

If you can’t get it working just call a function.

1 Like

I was using v1:

The Swagger interface shows the same CreatedOn parameter for both versions:
v1:
delete /ReportMonitors({UserID},{WorkStationID},{CreatedOn},{RecSeq})
v2:
delete /{currentCompany}/Ice.BO.ReportMonitorSvc/ReportMonitors(‘{UserID}’,‘{CreatedOn}’,{RecSeq},‘{WorkStationID}’)

I’m running into a similar but less descript issue with v2:

{
  "HttpStatus": 400,
  "ReasonPhrase": "REST API Exception",
  "ErrorMessage": "OData path exception Bad Request - Error in query syntax. for the request https://e10host/Epicor10Live/api/v2/odata/TS/Ice.BO.ReportMonitorSvc/ReportMonitors('michael','2025-12-08 05:55:55',788823,'NUN 1')",
  "ErrorType": "Epicor.RESTApi.ErrorHandling.ApiException"
}

However, since I am using the Swagger interface and simply filling in the required parameters and clicking “Try it out!” so my response is “Wait a minute, this whole operation was your idea!”

This is the curl command it’s generating. I assume it knows how to properly format everything as long as I have the date format correct - again I have tried a few different formats without any success, including the exactly format the GetRowsKeepIdleTimeWithBallonInfo endpoint is returning:

curl -X DELETE --header 'Accept: application/json' --header 'X-API-Key: <REDACTED>' 'https://e10host/Epicor10Live/api/v2/odata/TS/Ice.BO.ReportMonitorSvc/ReportMonitors('michael','2025-12-08T05%3A55%3A55',788823,'WS%201')'

Epicor 10.2.400 doesn’t have Epicor functions as they weren’t introduced until 10.2.500. While we will be upgrading to Kinetic in the near future, I’m trying to get some stuff converted over to API usage in preparation for that.

Then call a UBAQ. Make a dummy one and do something on the GetList.