Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Business Central Base64 Blob Page field shows up twice on API

(0) ShareShare
ReportReport
Posted on by 82

Hi fellow developers!

We are trying to send .PDF in Base64 format via API to an integration partner. I am able to convert document to Base64 and save it in a BLOB field but when I call the API, the field always show up twice identically on the API Json like below.

I have double checked and there is only one table field and one page field added, and it's the same duplication for both Custom API and WebService Page API. It's confusing and redundant for our business partner. Is there a way to fix this? Seems like a bug to me.

{
    "@odata.context": "xxx/ODataV4/$metadata#Company('TEST')/WarehouseShipmentHeader",
    "value": [
        {
            "@odata.etag": "xxx",
            "Shipment_Label_Base64@odata.mediaEditLink": "https://api.businesscentral.dynamics.com/v2.0/xxx/ODataV4/Company('TEST')/WarehouseShipmentHeader('xxx')/Shipment_Label_Base64",
            "Shipment_Label_Base64@odata.mediaReadLink": "https://api.businesscentral.dynamics.com/v2.0/xxx/ODataV4/Company('TEST')/WarehouseShipmentHeader('xxx')/Shipment_Label_Base64"
        }
    ]
}

I used below code to add the field to table and page:

#table field:
field(12345; "Label In Base64"; Blob)
{
    DataClassification = CustomerContent;
}

#page field:
field("Shipping_Label"; rec."Label In Base64")
{
    ApplicationArea = All;
    Caption = 'Shipping Label Base64';
}


  • selak Profile Picture
    selak 12 on at
    Business Central Base64 Blob Page field shows up twice on API
    @Bilal, but these two Links are the same. Does it make sence?
  • Ginger Frog Profile Picture
    Ginger Frog 82 on at
    RE: Business Central Base64 Blob Page field shows up twice on API

    AHHHH that's it!! Thank you Bilal that removed the editlink Json.

  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 69 on at
    RE: Business Central Base64 Blob Page field shows up twice on API

    Try making this field Editable = false so other can only read and edit link may be removed.

  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 69 on at
    RE: Business Central Base64 Blob Page field shows up twice on API

    Hi Ginger Frog,

    These are not the same one is content@odata.mediaEditLink that is Link to upload data while other is content@odata.mediaReadLink that Link to download data.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans