Saving assets via API



  • Is it possible to send an asset (image) via the API.
    I have 1 report that can use different logos for companies. I would like to save the companies logo to JSReport so I can dynamically render their logo by convention.

    <img src="{#asset {{:Organisation.FranchiseId}}-Logo.jpg @encoding=dataURI}" />

    At the moment I am having to upload manually.



  • Yes, using odata API. See it described in the docs.
    https://jsreport.net/learn/api

    I also recommend to open browser F12 tools and try to upload an asset using jsreport studio. You should see the creation request example. In this case you need to send content and name property where the content is base64 representation of the image.

    0_1540153639233_upload-171aaba5-0494-45f2-bd63-d294e1e1a2d3


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.