Docly Developers
Section17 pages

Share functions

Functions to share files and folders, publish them, and send documents and forms by email.

download(file, template, preview?)Produces a file using the specified template (HTML, PDF etc) and initiates the file download in the browser. Runs as the user who published…getFileShares(path)Returns the active shares for a specific file.addFileShare(file, user, access, message?)Creates a new share / overwrites existing for a specific file and user, and sends an invitation email to the specified user.removeFileShare(file, user)Removes / terminates a user's access to a specific file.sendEmail(file, template, receiver, subject, message)Produces a file using the specified template (HTML, PDF etc) and sends the output by email.downloadEmbedded(file, embeddedId, filename?)Downloads an embedded file from a document. The response is always sent as application/octet-stream with Content-Disposition attachment.generateDocument(file, template)Produces a file using the specified template (HTML, PDF etc) and returns it as a byte array. Runs as the user who published the site, not…sendForm(form, subject, options?)Sends a submitted form by email from an API function.addFolderShare(path, user, access, message?)Creates a new share / overwrites existing for a specific folder and user, and sends an invitation email to the specified user.getFolderShares(path)Returns the active shares for a specific folder.removeFolderShare(path, user)Removes / terminates a user's access to a specific folder.getPublications(options?)Lists where the site's own workspace is published — published folders (sites) and published documents — with the same data as the CLI…getDomains()Lists the domains the site can publish folders and documents on: the verified domains on the workspace's subscription. Use it to pick the…publishFolder(path, domain, options?)Publishes a folder inside the site on one of the subscription's domains — for example a customer website the script has created under…publishDocument(path, domain, options?)Publishes one document inside the site with one of its schema's templates, on one of the subscription's domains. Only available in API mode…unpublish(guid)Removes a publication of a folder or document inside the site. Only available in API mode (.js endpoints), and only when the subscription…downloadBytes(data, filename, preview?)A method to trigger a file download from byte data or a base64 encoded string.