Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Business Central updates!Learn about the key capabilities and features of Dynamics 365 Business Central and experience some of the new features.
Download overview guide | Watch Business Central video
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
In community I saw a couple of times good question about how to get item picture in API response.
OK, challenge accepted.
Lets look at items API:
1. We need to make http request something like that
nav2017 - my server
7048 - OData port
DynamicsNAV110 - NAV instance
68a76662-a198-477b-8097-d9df2116514a - my company ID
For certain item it'll look next way:
a19819f4-6e65-42ee-bbd9-eba4cc3199fc - item ID (field 8000 of item table)
Looks great, isn't it ?
2. Items API is a API-type page 5740 Item Entity based on 27 table Item.
So it's logical try to add Picture field on it and get a image:
Now compile the page and make a request.
Oops, something gone wrong. Now we know that API doesn't understand MediaSet type fields.
So we can try to obtain BLOB by Mediaset ID and paste it into request. But where are BLOBs ? They stores at 2000000184 Tenant Media table:
3. Create a codeunit to get a BLOB in base64 format by MediaSet ID with next steps:
4. Create text variable which gets picture data from your codeunit and paste it on API page with page extension:
5. Publish your extension to database.
6. Run request again and enjoy:
7. To control - copy picture text value to any base64 - image converter:
Hope it was useful for you!
Business Applications communities