
In continuation to my previous post which explored the Outbound APIs, let us continue to understand about Inbound APIs.
To monitor the incoming MES messages to the system, go to
Production control > Setup > Manufacturing execution > Manufacturing execution systems integration.
The data sent via external app or postman is captured here.
How to call the API
To call the MES integration API, send a POST request to the following endpoint URL:
/api/services/SysMessageServices/SysMessageService/SendMessage
The body of the request that you send should resemble like below.
Replace the values for _companyId, _messageType, and _messageContent as required.
Below one is the template for RAF
{
"_companyId": "USMF",
"_messageQueue": "JmgMES3P",
"_messageType": "ProdProductionOrderReportFinished",
"_messageContent":
"{"ProductionOrderNumber": "PRODID", "ReportFinishedLines": [{"ItemNumber": "A0001", "ReportedGoodQuantity": 10, "ReportAsFinishedDate": "2021-01-01"}]}"
}
The message type for Pick and Route card will be replaced with ProdProductionOrderPickingList and ProdProductionOrderRouteCard respectively.
When the request is pushed , the data will be captured in the MES integration form which can be processed by clicked ‘Process’

The payload for each request varies and not all the fields given the standard API fields should be used.
I`ve shared the Inbound APIs in my Github with the values which worked for me to process the RAF/Picking/Route card .
Note:
All messages for a specific production order are processed in the sequence they’re received.
If there are Queued messages which you attempt to process, but end up with the below message ‘1 record(s) processed. 0 records couldnot be processed’ , check if there are any failed jobs for the Production order of the same Message type . If yes, then cancel the failed ones and process the messages again.
A new raf or route card cannot be processed if a failed job exists for that message type.

I hope you found it useful. In the next post, we will learn about clean up jobs for MES records.






