web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

BC integration - get JSON from POST request

(4) ShareShare
ReportReport
Posted on by 16
Hi Community, 
 
I'm trying to integrate BC cloud with a third party partner. The partner can send POST requests with a JSON body to an external endpoint. The JSON is structured and has nested objects. The goal is to fetch the JSON in BC and process it to extract the needed data.

I tried to achieve this using a web service with a procedure that has the JSON elements defined as Text parameters, but it's not working for the nested objects: "An unexpected 'StartObject' node was found for property named 'user' when reading from the JSON reader. A 'PrimitiveValue' node was expected.". 
 
Is there a way to make an endpoint in BC that gets the JSON body from the POST request? Do you have any examples?

Thank you!
I have the same question (1)
  • Suggested answer
    Gerardo Rentería García Profile Picture
    25,555 Most Valuable Professional on at
    Hi
    Are you using JsonObject or JsonArray?
     
    Best
    GR
  • Suggested answer
    YUN ZHU Profile Picture
    99,086 Super User 2026 Season 1 on at
  • CL-03091155-0 Profile Picture
    16 on at
    Hi, 
     
    Thank you both for your valuable information. However, the issue is not that I have troubles processing the JSON request in BC to read data from it, but rather getting the whole JSON payload in BC in order to process it.
     
    The process should be like this:  the external system sends a POST request with a JSON body to a BC endpoint, BC gets the JSON body and loops through its elements using the JSON BC data types to extract the data. Therefore, I'm not making a HTTP request from BC to an external endpoint, but rather I should receive a request in BC from an external system every time a resource was created or updated on their side.
     
    I cannot use an API page because the POST request has many nested elements, and for each element I would have to build a separate API page part. Example of a request: 

    {
        "field1": "value1",
        "field2": "value2",
        "element3": {
                   "field3.1":"value3.1",
                   "element3.2":{
                                          .....
                                         }
        },
        "element4": {
                   "field4.1":"value4.1",
                   "field4.2":"value4.2".....
        }
    .....
    }

    I tried publishing a BC web service having the following procedure and make the POST request to it, but it does not work:
    procedure HandleRequest(field1: Text; field2: Text; element3: JsonObject; element4: JsonObject)

    And making all parameters of type Text gives the mentioned error, because it finds a nested element instead of a string value: "An unexpected 'StartObject' node was found for property named 'element3' when reading from the JSON reader. A 'PrimitiveValue' node was expected.".
    procedure HandleRequest(field1: Text; field2: Text; element3: Text; element4: Text)

    Making any changes to the POST request we get from the external system is not an option in this case.

    Any other ideas would be much appreciated. 

    Thank you,
    CL
  • SG-15041333-0 Profile Picture
    2 on at
    I have the same use case. Did you find any solution?
     
    Thanks,
    Regards

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,005 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,148 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans