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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

ODATA post returning http error 400

(0) ShareShare
ReportReport
Posted on by 10

Hi all

When posting invalid data via the ODATA API I get the generic http 400 error, bad request!

Well, the data is invalid so I guess it is a bad request but how can I find out what the API is objecting to?

I don't see a meaningful error so it is impossible to diagnose what is wrong; I don't need my data corrected I just need to know how to trap and detect the error so I can deal with errors as they arise.

Thanks

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    That is tough indeed. You may want to debug via Fiddler to see if something does show up. Or you import the data in smaller batches until you find the wrong entry?

    Thanks.

  • Nibbod Profile Picture
    10 on at

    Thanks Marco,  but that is really my question...

    How can I trap the error in code? By returning HTTP error 400 I don't get an error message.

    I will be transferring thousands of customers and invoices across, surely I can sit there passing them field by field until I find where it goes wrong?

    As it happens with my test it was because there was text in a phone number; why return error 400?

    Why not return a status code with an error message so we can report it? Saying bad request for the reason above is just weird!

    How does anyone manage this?

    Sorry but getting frustrated with this API it is the worst one I have ever tried to use.

  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    The following may help and discusses the usage of Fiddler. Yes, if you do have thousands of records to update, the Fiddler trace may become very huge. So limiting the data would be first step.

    docs.microsoft.com/.../troubleshooting-http-400-errors-in-iis

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    Thanks.

  • Nibbod Profile Picture
    10 on at

    Thanks for links Marco but I have been trying to join those forums all weekend, I never get the confirmation email from them; not in my junk or our spam filters!

    Tried a few other also same thing which is weird!

    Is there any useful documentation anywhere; preferably with working examples and ideally downloadable projects?

    My boss is keen on moving to Dynamics and I want to help him but I am close to giving up and recommending we look for something better supported...

     

  • Verified answer
    Community Member Profile Picture
    on at

    I have resoled above issue.

    The problem was in your User has no proper on DEV server Authentication.

    or

    IN SAP Side SAP has not allow that user to update any information.

    I was facing that issue on 320 client and 320 *** was not editable.

    I have done changes on Editable client and transfer to 320 Non-editable client.

    also One More Solution is That.

    Clear Your Browser & SAP Side Cash

    Run SE38

    T-code. Then enter /UI2/PAGE_CACHE_RESET

    click on Execute.

  • Suggested answer
    Marco Mels Profile Picture
    on at

    Thank you for sharing final solution!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans