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

Announcements

News and Announcements icon
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.

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

    Hello,

    Hope this helps:

    docs.microsoft.com/.../dynamics_attachment_update

    Thanks.

  • sina123 Profile Picture
    15 on at

    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
    Microsoft Employee on at

    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.

  • Suggested answer
    divyeshchitte Profile Picture
    970 on at

    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.

  • sina123 Profile Picture
    15 on at

    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
    Nitin Verma Profile Picture
    21,812 Moderator on at

    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.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,690 Super User 2026 Season 1

#2
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,091 Super User 2026 Season 1

#3
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans