2

I been trying to make out the URL in order to make a REST call which will fetch an image rendition from SP and then grab its value in order to convert it to base 64. I have been playing with the URL. I am working with a picture library. I am using the following URL's but I have not had any success. I have been crawling the web and have not seen any exmples

 var url1 = "https://tentnat.sharepoint.com/sites/*site*/_api/web/GetFileByServerRelativeUrl('*relativeUrl*')/Pictures?select=RenditionID&$ Filter=RenditionID eq 1"; << get 404

 var url2 = "https://tentnat.sharepoint.com/sites/*site*/_api/web/GetFileByServerRelativeUrl('*relativeUrl*?RenditionID=1 '); << get 404

 var url3 = "https://tentnat.sharepoint.com/sites/*site*/_api/web/GetFileByServerRelativeUrl('*relativeUrl*')/?RenditionID=1/$value"; << get 404

 var url4 = "https://tentnat.sharepoint.com/sites/*site*/_api/web/GetFileByServerRelativeUrl('*relativeUrl*')/$value"; << this is valid and does get me the image *200*
4
  • 1
    Did you find a solution to this?
    – sjkp
    Oct 3, 2016 at 15:37
  • Basically opened an SP session with IE and used this authenticated sessions to build out my rendition URL function StartSPSession() { //this will just open a window that has the Sp site Url, // it will authenticate in order to grab image renditions. // quick fix to implement renditions var sharepointSite = window.open("tenant.sharepoint.com/sites/ContentCenter", '_blank', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=5, height=5, visible=none', ''); setTimeout(function () { sharepointSite.close(); }, 8000); };
    – EasyE
    Oct 3, 2016 at 15:59
  • have you found a way to get this to work through Rest api ? @sjkp
    – EasyE
    Oct 3, 2016 at 16:04
  • I have not - which is why I asked. But opening a browser is not an option for me as I only have sharepoint app credentials. But I guess my app will then have to resize the images. Sucks, but seems like the REST API is also incomplete in this area.
    – sjkp
    Oct 3, 2016 at 19:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.