Announcements
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.
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.
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.
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.
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.
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.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156