Skip to main content

Notifications

Small and medium business | Business Central, N...
Unanswered

Business Central, POST request with BLOB

(1) ShareShare
ReportReport
Posted on by 8

I create custom table with blob field and API for that table.
If I send POST request without blob field (not null, removed key, value pair from json), it creates new record without any problem.

Problem is, if I send it with blob field it returns this error
400:
{

    /error/: {

        /code/: /BadRequest/,

        /message/: /A body must be provided to the request.  CorrelationId:  16a11edd-0c4b-4b11-bd26-be3a072d37c3./

    }

}

I have tried
1. /blobfield/: null
2. /blobfield/: /some base 64 string/
3. /blobfield/: {}
4. /blobfield/: {
/Length/:0, /IsDefault/:true }

How to send blob via POST request to business central? Or is there any better way to save file in business central with API?


How to send blob via API to business central? Or is there any better way to save file in business central with API?

  • JJMc Profile Picture
    JJMc 288 on at
    Business Central, POST request with BLOB
    Good morning.
    I'd create a boundaction in the API page, send the BLOB content as Base64, and in the BoundAction do the code required to convert from base64 and assign it to the BLOB field you need to.

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans