URL for images using ContentCanvas

Copper Contributor

I am using a SharePoint API to pull the HTML page content from a page so that I can incorporate into an email.


This is the API that I'm calling to the SharePoint site:

_api/web/lists/getbytitle('Site%20Pages')/items?$select=Title,CanvasContent1,FileLeafRef&$filter=FileLeafRef eq 'Example.aspx'


The problem I'm having is with the images that appear in the page, the HTML from that is returned from the API looks like this:

<img data-sp-prop-name=\"imageSource\" src=\"/sites/test/SiteAssets/SitePages/Example-/76990-Picture-4.png\" data-sp-cust-siteId=\"87626149-fa8e-49f5-a52f-06ef2642e415\" data-sp-cust-webId=\"be52451f-86cc-4e61-aa36-02090d57d019\" data-sp-cust-listId=\"f3fb9d65-9238-4203-b94a-bd9781b1631b\" data-sp-cust-uniqueId=\"bbd5738c-6715-4393-b628-19c97fa40a6a\" data-sp-cust-width=\"358\" data-sp-cust-height=\"941\" />


The src location isn't available


If I look at the location for the image in a browser it is:



This works in a browser, but as soon as I use the same src in an email the image doesn't appear.


Is there a way to get the correct src for the image, it appears that I have all the information required I just need to find a way to reference the image using HTML in an email



0 Replies