85

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

Comments

J

This is a critical feature needed in many integration scenarios. Please vote up! I'll bring the beers when implemented.

Category: Development

J

Absolutely great Idea!Its a real pain to work with the API capabilities of Business central if you have to integrate complex solutions like webshops, warehousing software and others.

Category: Development

J

This is absolutely a great idea! Having a json with a complex types where the 3rd party cannot do the escape of the json body is a pain atm.

Category: Development

J

This would be a game changer. The number of times we have to revert to using some sort of base64 wrapper for complex data is growing with almost every integration we do. Json is way too flexible to try and fit it into the confines of a page (numerous same level classes, sub arrays etc. etc.).

Category: Development

J

Totally agree!

Category: Development

J

Great Idea. 100% in agreement.

Category: Development