I want to migrate another site (not BC) to site glide and am writing some code to use APIs to transfer content. Can the APIs be used to create media downloads? The documentation is limited.
Where am I?
In Siteglide Community Forum you can ask and answer questions and share your experience with others!
Hi Rox,
Sure, so you can create any type of modules items (even media downloads!) via the API, however you cannot currently upload any images via the Public API. We have a roadmap request for this here -> https://roadmap.siteglide.com/siteglide-roadmap/p/public-api-images (which you've already voted on, wonderful!).
You can find out more information about the Public API here
Thanks!
Emily, So i can upload a pdf? Is there some sample code?
@Rox Dawson sorry for the incorrect naming on that roadmap request (we’ll get they updated) but it should be support for files in general, not just images.
So unfortunately no, you cannot add files to items via the public api currently
That is unfortunate. I was planning on moving a number of clients with large numbers of PDFs and other documents to SiteGlide because I was hoping to automate that part of it. Will now need to look for another solution :(
If they do not need to be secured then they can be bulk uploaded to the assets area of a site via CLI deploy
Hi @Dean Vizer , for files uploaded in the assets area of the site using siteglide-cli deploy, can they be assigned to a WebApp item with a file custom field? When I try to create a WebApp item with a file it only seems to allow selecting files located in the File Manager area.
Hi @Dan Maitland
That is correct, the File Manager is mapped to the root of the
/assets
folder. So any files you upload in there from the CLI can then be accessed from a file field in a WebApp.If you are finding a use case where that doesn't happen then you can reach out to support and we'll take a closer look at that for you
Thanks Dean. So I could use a webapp to manage. So upload the file as an asset via CLI and create the webapp item pointing to the file via API.
Apologies, I missed this. To point to the file from the WebApp you would have to currently make a string field, you would then lose functionality within Admin such as "select file" and the small preview of the image that is shown