I have created ODATA endpoint in 365FO which will be used by external system to insert data to D365FO.How can i acknowledge that the data has been inserted successfully into D365fO and send back the data in JSON format to the external system
I have created ODATA endpoint in 365FO which will be used by external system to insert data to D365FO.How can i acknowledge that the data has been inserted successfully into D365fO and send back the data in JSON format to the external system
Hi Murcus,
With standard oData endpoint it's not possible, or you need to use middleware to transform standard oData response to response you want.
Take a look at custom web service
Iam still in the same question.Let me clarify.
I would like on data getting inserted into the table I get a result like this.
{"status":"success","data":{[{"id":"1","employee_name":"Tiger Nixon","employee_salary":"320800","employee_age":"61","profile_image":""}
ok}
Are you still talking about the scenario where your external service inserts data in D365FO, and you want to get the inserted data back to the external system as verification? If yes, you have been instructed above. If you still feel unsure about what to do, please share more information about your implementation.
Or are you now talking about having some new integration where D365FO sends data to your external system? If this is the case, I suggest you post a new question. Let's keep one question in one discussion.
Hi Sergei Minozhenko,
Thanks for your response.
Assume I want to send data in JSON format to an external system how can I do it
Hi Murcus,
Here is the example of a response for insert operation for SalesOrigin. The external application should handle the response and react accordingly. No additional actions needed from D365 side and response is generated automatically.
HTTP/1.1 201 Created // header info // //json response { "@odata.context":"URL/data/$metadata#SalesOrderOriginCodes/$entity","@odata.etag":"W/\"JzEsNTYzNzE1MjA4MTswLDAn\"","dataAreaId":"dat","OriginCode":"Test5","OriginDescription":"test5 desc","IsOriginTypeAssigned":"No","OriginType":null }
No need to "fetch" anything, it's given to you as a response to your OData call.
How to handle the response in your external application depends a lot about your application. But in any case it's not specific to D365.
You are making a web request in programming language x (which we don't know), and you want to capture the response and handle it. You should start by searching the web for this information. Then, if you still are unclear, try to find communities / forums for programming language x and ask your question there.
lets say you re testing using postman.On Post of the endpoint you get a response in Json which looks like this
{
"@odata.context": "xxx.onebox.dynamics.com/.../$metadata
"@odata.etag": "W/\"JzEsNKZzNzIwMjMykic=\"",
"PaymReference": "Paym-0054-596",
"Amount": 20000,
"ChequeNo": "900",
"ReceiptNo": "009",
"MainAccountNum": "3070000",
"InvoiceNo": "INV-0002",
}
how can I fetch this record send it back as a result
Yes, that was mentioned already in your original question. And Sergei told you that the response from D365 contains what you need. Once you get the response it's up to the calling application to handle the information.
I have given this enpoint to be used by external system to insert data into D365fo table xxx.cloud.onebox.dynamics.com/.../Service
After inserting the record in AX table,I want to fetch that record and send back to the external system as Acknowledgement of success
Hi murcus,
that would depend a lot about your external application, so far we don't know for example which programming language you are using. But most likely for your language there are some libraries for parsing json.
That question is not anymore related to D365FO, so I suggest to find documentation, or ask in communities of that programming language.
André Arnaud de Cal...
294,261
Super User 2025 Season 1
Martin Dráb
233,011
Most Valuable Professional
nmaenpaa
101,158
Moderator