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.

    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.


Log in to reply

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