24

Currently it is not possible to make an api page that just receives the http request body as a payload. By which i mean that you can't read or handle the true json body of the HTTP request that is posted to the webservice page in the AL code.


The only option now is to make the fields on the page match the body perfectly (which would make a record and that is not a httpbody but the result of that) or make a codeunit webservice with a parameter (which is not reading a httpbody, so that doesn't really count.). This really isn't a very flexible nor an easy way to make complex integrations.


My suggestion is to just make it possible to recieve the body that you then can use in the AL code and make it possible to create a response when done. This would be great for:

  1. Connection apps that cannot change their json (or any other) output in their httppost.
  2. The developer can write better code for handeling the body instead of just depending on the api page structure.
  3. better integration with many other external products.
  4. it would fit in quite well with the current possibilities for Json and XML handeling in AL.


I would suggest making it an extra property on the api page or making it possible through a codeunit. Although a page would be nicer, since this handles the unbound cases and therefore can be used without the setup of a webservice record in BC. Also, if the property is set up, please keep in mind that the page should not give a bad request when it does not match the fields. As a developer you just want to handle the body yourself with a response they seem fit.

Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team