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...
Suggested answer

Upload pdf files as attachment documents to Business Central Items using OData Api V4 web services

(0) ShareShare
ReportReport
Posted on by 15

Hello,

I am looking for an OData web service that allows me to upload a pdf document to an Item in Business Central. I was able to get information on documents attached (uploaded from front end) using the below web service:

GET {{BaseURL}}/{{environment}}/AttachedDocuments

Now i need to basically attach or upload document to a specific Item using web services. I have tried several tables and web services but in vain. 

Kindly guide me on how i can achieve this using OData web v4 services.

Thanks.

  • Suggested answer
    Nitin Verma Profile Picture
    21,569 Moderator on at
    RE: Upload pdf files as attachment documents to Business Central Items using OData Api V4 web services

    Hi,

    I will suggest create a New API page and use that API page to insert the attachment and move those attachment to further to other your required table.

    for more info. please refer below link

    https://accelerationeconomy.com/news/demo-business-central-api-for-importing-exporting-attachment/

    Thanks.

  • sina123 Profile Picture
    15 on at
    RE: Upload pdf files as attachment documents to Business Central Items using OData Api V4 web services

    Hi, I tried the suggestion but get an error "Entity does not support insert" while sending a POST to /ImportItem endpoint created using tableid 348 Import Item Pictures.

  • Suggested answer
    divyeshchitte Profile Picture
    950 on at
    RE: Upload pdf files as attachment documents to Business Central Items using OData Api V4 web services

    HI Sina,

    You can use base functionality of Microsoft, which is available on Inventory setup page> Import Item.

    You can create a publish an API page for "Import Item Pictures" Page id 348 and then upload the items through API.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Upload pdf files as attachment documents to Business Central Items using OData Api V4 web services

    Hello,

    If you run this command in Postman:

    api.businesscentral.dynamics.com/.../items eq '1896-S'

    This is for ATHENE Tafel in demo data, you get the following:

    {

       "@odata.context": "<<REMOVED>>/items",

       "value": [

           {

               "@odata.etag": "W/\"JzIwOzEyNjE3ODgwMjUzNzkzNDc1MjExMTswMDsn\"",

               "id": "4d5de349-0fe2-ec11-bb45-000d3a39a433",

               "number": "1896-S",

               "displayName": "ATHENE Tafel",

               "type": "Inventory",

               "itemCategoryId": "3304de4f-0fe2-ec11-bb45-000d3a39a433",

               "itemCategoryCode": "TAFEL",

               "blocked": false,

               "gtin": "",

               "inventory": 4,

               "unitPrice": 1005.8,

               "priceIncludesTax": false,

               "unitCost": 784.6,

               "taxGroupId": "00000000-0000-0000-0000-000000000000",

               "taxGroupCode": "",

               "baseUnitOfMeasureId": "d05de349-0fe2-ec11-bb45-000d3a39a433",

               "baseUnitOfMeasureCode": "STUKS",

               "generalProductPostingGroupId": "0d02de4f-0fe2-ec11-bb45-000d3a39a433",

               "generalProductPostingGroupCode": "DET.HANDEL",

               "inventoryPostingGroupId": "bd5de349-0fe2-ec11-bb45-000d3a39a433",

               "inventoryPostingGroupCode": "WEDERVERK",

               "lastModifiedDateTime": "2022-06-16T07:08:14.613Z"

           }

       ]

    }

    There is no attachment field you can use; therefore you must create a custom API.

    Thanks.

  • sina123 Profile Picture
    15 on at
    RE: Upload pdf files as attachment documents to Business Central Items using OData Api V4 web services

    Thanks for the response, but the documentation is regarding attachments for journallines but i need to attach document to an Item. I have tried the request but doesnt work for an item unfortunately.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Upload pdf files as attachment documents to Business Central Items using OData Api V4 web services

    Hello,

    Hope this helps:

    docs.microsoft.com/.../dynamics_attachment_update

    Thanks.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans