Documentation ¶
Overview ¶
Package endpoint provides API endpoints for Documize.
Index ¶
- Constants
- Variables
- func AcceptSharedFolder(w http.ResponseWriter, r *http.Request)
- func Add(prefix, path string, methods, queries []string, endPtFn RouteFunc) error
- func AddAttachments(w http.ResponseWriter, r *http.Request)
- func AddDocumentPage(w http.ResponseWriter, r *http.Request)
- func AddFolder(w http.ResponseWriter, r *http.Request)
- func AddUser(w http.ResponseWriter, r *http.Request)
- func AttachmentDownload(w http.ResponseWriter, r *http.Request)
- func Authenticate(w http.ResponseWriter, r *http.Request)
- func Authorize(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func ChangeDocumentPageLevel(w http.ResponseWriter, r *http.Request)
- func ChangeDocumentPageSequence(w http.ResponseWriter, r *http.Request)
- func ChangeUserPassword(w http.ResponseWriter, r *http.Request)
- func DeleteAttachment(w http.ResponseWriter, r *http.Request)
- func DeleteDocument(w http.ResponseWriter, r *http.Request)
- func DeleteDocumentPage(w http.ResponseWriter, r *http.Request)
- func DeleteDocumentPages(w http.ResponseWriter, r *http.Request)
- func DeleteUser(w http.ResponseWriter, r *http.Request)
- func ForgotUserPassword(w http.ResponseWriter, r *http.Request)
- func GetAttachments(w http.ResponseWriter, r *http.Request)
- func GetDocument(w http.ResponseWriter, r *http.Request)
- func GetDocumentAsDocx(w http.ResponseWriter, r *http.Request)
- func GetDocumentMeta(w http.ResponseWriter, r *http.Request)
- func GetDocumentPage(w http.ResponseWriter, r *http.Request)
- func GetDocumentPageMeta(w http.ResponseWriter, r *http.Request)
- func GetDocumentPages(w http.ResponseWriter, r *http.Request)
- func GetDocumentPagesBatch(w http.ResponseWriter, r *http.Request)
- func GetDocumentsByFolder(w http.ResponseWriter, r *http.Request)
- func GetDocumentsByTag(w http.ResponseWriter, r *http.Request)
- func GetFolder(w http.ResponseWriter, r *http.Request)
- func GetFolderPermissions(w http.ResponseWriter, r *http.Request)
- func GetFolderUsers(w http.ResponseWriter, r *http.Request)
- func GetFolderVisibility(w http.ResponseWriter, r *http.Request)
- func GetFolders(w http.ResponseWriter, r *http.Request)
- func GetGlobalConfig(w http.ResponseWriter, r *http.Request)
- func GetLinkCandidates(w http.ResponseWriter, r *http.Request)
- func GetMeta(w http.ResponseWriter, r *http.Request)
- func GetOrganization(w http.ResponseWriter, r *http.Request)
- func GetOrganizationUsers(w http.ResponseWriter, r *http.Request)
- func GetRobots(w http.ResponseWriter, r *http.Request)
- func GetSavedTemplates(w http.ResponseWriter, r *http.Request)
- func GetSections(w http.ResponseWriter, r *http.Request)
- func GetSitemap(w http.ResponseWriter, r *http.Request)
- func GetStockTemplates(w http.ResponseWriter, r *http.Request)
- func GetUser(w http.ResponseWriter, r *http.Request)
- func GetUserFolderPermissions(w http.ResponseWriter, r *http.Request)
- func InviteToFolder(w http.ResponseWriter, r *http.Request)
- func RefreshSections(w http.ResponseWriter, r *http.Request)
- func Remove(prefix, path string, methods, queries []string) error
- func RemoveFolder(w http.ResponseWriter, r *http.Request)
- func ResetUserPassword(w http.ResponseWriter, r *http.Request)
- func RunSectionCommand(w http.ResponseWriter, r *http.Request)
- func SaveAsTemplate(w http.ResponseWriter, r *http.Request)
- func SaveGlobalConfig(w http.ResponseWriter, r *http.Request)
- func SearchDocuments(w http.ResponseWriter, r *http.Request)
- func SearchLinkCandidates(w http.ResponseWriter, r *http.Request)
- func Serve(ready chan struct{})
- func SetFolderPermissions(w http.ResponseWriter, r *http.Request)
- func StartDocumentFromSavedTemplate(w http.ResponseWriter, r *http.Request)
- func StartDocumentFromStockTemplate(w http.ResponseWriter, r *http.Request)
- func UpdateDocument(w http.ResponseWriter, r *http.Request)
- func UpdateDocumentPage(w http.ResponseWriter, r *http.Request)
- func UpdateFolder(w http.ResponseWriter, r *http.Request)
- func UpdateOrganization(w http.ResponseWriter, r *http.Request)
- func UpdateUser(w http.ResponseWriter, r *http.Request)
- func UploadConvertDocument(w http.ResponseWriter, r *http.Request)
- func ValidateAuthToken(w http.ResponseWriter, r *http.Request)
- type RouteFunc
Constants ¶
const ( // RoutePrefixPublic used for the unsecured api RoutePrefixPublic = "/api/public/" // RoutePrefixPrivate used for secured api (requiring api) RoutePrefixPrivate = "/api/" // RoutePrefixRoot used for unsecured endpoints at root (e.g. robots.txt) RoutePrefixRoot = "/" )
Variables ¶
var Product core.ProdInfo
Product details app edition and version
Functions ¶
func AcceptSharedFolder ¶
func AcceptSharedFolder(w http.ResponseWriter, r *http.Request)
AcceptSharedFolder records the fact that a user has completed folder onboard process.
func AddAttachments ¶
func AddAttachments(w http.ResponseWriter, r *http.Request)
AddAttachments stores files against a document.
func AddDocumentPage ¶
func AddDocumentPage(w http.ResponseWriter, r *http.Request)
AddDocumentPage inserts new section into document.
func AddFolder ¶
func AddFolder(w http.ResponseWriter, r *http.Request)
AddFolder creates a new folder.
func AddUser ¶
func AddUser(w http.ResponseWriter, r *http.Request)
AddUser is the endpoint that enables an administrator to add a new user for their orgaisation.
func AttachmentDownload ¶
func AttachmentDownload(w http.ResponseWriter, r *http.Request)
AttachmentDownload is the end-point that responds to a request for a particular attachment by sending the requested file to the client.
func Authenticate ¶
func Authenticate(w http.ResponseWriter, r *http.Request)
Authenticate user based up HTTP Authorization header. An encrypted authentication token is issued with an expiry date.
func Authorize ¶
func Authorize(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Authorize secure API calls by inspecting authentication token. request.Context provides caller user information. Site meta sent back as HTTP custom headers.
func ChangeDocumentPageLevel ¶
func ChangeDocumentPageLevel(w http.ResponseWriter, r *http.Request)
ChangeDocumentPageLevel handles page indent/outdent changes.
func ChangeDocumentPageSequence ¶
func ChangeDocumentPageSequence(w http.ResponseWriter, r *http.Request)
ChangeDocumentPageSequence will swap page sequence for a given number of pages.
func ChangeUserPassword ¶
func ChangeUserPassword(w http.ResponseWriter, r *http.Request)
ChangeUserPassword accepts password change from within the app.
func DeleteAttachment ¶
func DeleteAttachment(w http.ResponseWriter, r *http.Request)
DeleteAttachment is an endpoint that deletes a particular document attachment.
func DeleteDocument ¶
func DeleteDocument(w http.ResponseWriter, r *http.Request)
DeleteDocument is an endpoint that deletes a document specified by documentID.
func DeleteDocumentPage ¶
func DeleteDocumentPage(w http.ResponseWriter, r *http.Request)
DeleteDocumentPage deletes a page.
func DeleteDocumentPages ¶
func DeleteDocumentPages(w http.ResponseWriter, r *http.Request)
DeleteDocumentPages batch deletes pages.
func DeleteUser ¶
func DeleteUser(w http.ResponseWriter, r *http.Request)
DeleteUser is the endpoint to delete a user specified by userID, the caller must be an Administrator.
func ForgotUserPassword ¶
func ForgotUserPassword(w http.ResponseWriter, r *http.Request)
ForgotUserPassword initiates the change password procedure. Generates a reset token and sends email to the user. User has to click link in email and then provide a new password.
func GetAttachments ¶
func GetAttachments(w http.ResponseWriter, r *http.Request)
GetAttachments is an end-point that returns all of the attachments of a particular documentID.
func GetDocument ¶
func GetDocument(w http.ResponseWriter, r *http.Request)
GetDocument is an endpoint that returns the document-level information for a given documentID.
func GetDocumentAsDocx ¶
func GetDocumentAsDocx(w http.ResponseWriter, r *http.Request)
GetDocumentAsDocx returns a Word document.
func GetDocumentMeta ¶
func GetDocumentMeta(w http.ResponseWriter, r *http.Request)
GetDocumentMeta is an endpoint returning the metadata for a document.
func GetDocumentPage ¶
func GetDocumentPage(w http.ResponseWriter, r *http.Request)
GetDocumentPage gets specified page for document.
func GetDocumentPageMeta ¶
func GetDocumentPageMeta(w http.ResponseWriter, r *http.Request)
GetDocumentPageMeta gets page meta data for specified document page.
func GetDocumentPages ¶
func GetDocumentPages(w http.ResponseWriter, r *http.Request)
GetDocumentPages gets all pages for document.
func GetDocumentPagesBatch ¶
func GetDocumentPagesBatch(w http.ResponseWriter, r *http.Request)
GetDocumentPagesBatch gets specified pages for document.
func GetDocumentsByFolder ¶
func GetDocumentsByFolder(w http.ResponseWriter, r *http.Request)
GetDocumentsByFolder is an endpoint that returns the documents in a given folder.
func GetDocumentsByTag ¶
func GetDocumentsByTag(w http.ResponseWriter, r *http.Request)
GetDocumentsByTag is an endpoint that returns the documents with a given tag.
func GetFolder ¶
func GetFolder(w http.ResponseWriter, r *http.Request)
GetFolder returns the requested folder.
func GetFolderPermissions ¶
func GetFolderPermissions(w http.ResponseWriter, r *http.Request)
GetFolderPermissions returns user permissions for the requested folder.
func GetFolderUsers ¶
func GetFolderUsers(w http.ResponseWriter, r *http.Request)
GetFolderUsers returns every user within a given space
func GetFolderVisibility ¶
func GetFolderVisibility(w http.ResponseWriter, r *http.Request)
GetFolderVisibility returns the users that can see the shared folders.
func GetFolders ¶
func GetFolders(w http.ResponseWriter, r *http.Request)
GetFolders returns the folders the user can see.
func GetGlobalConfig ¶ added in v0.27.0
func GetGlobalConfig(w http.ResponseWriter, r *http.Request)
GetGlobalConfig returns installation-wide settings
func GetLinkCandidates ¶ added in v0.28.0
func GetLinkCandidates(w http.ResponseWriter, r *http.Request)
GetLinkCandidates returns references to documents/sections/attachments.
func GetMeta ¶
func GetMeta(w http.ResponseWriter, r *http.Request)
GetMeta provides org meta data based upon request domain (e.g. acme.documize.com).
func GetOrganization ¶
func GetOrganization(w http.ResponseWriter, r *http.Request)
GetOrganization returns the requested organization.
func GetOrganizationUsers ¶
func GetOrganizationUsers(w http.ResponseWriter, r *http.Request)
GetOrganizationUsers is the endpoint that allows administrators to view the users in their organisation.
func GetRobots ¶
func GetRobots(w http.ResponseWriter, r *http.Request)
GetRobots returns robots.txt depending on site configuration. Did we allow anonymouse access?
func GetSavedTemplates ¶
func GetSavedTemplates(w http.ResponseWriter, r *http.Request)
GetSavedTemplates returns all templates saved by the user
func GetSections ¶
func GetSections(w http.ResponseWriter, r *http.Request)
GetSections returns available smart sections.
func GetSitemap ¶
func GetSitemap(w http.ResponseWriter, r *http.Request)
GetSitemap returns URLs that can be indexed. We only include public folders and documents (e.g. can be seen by everyone).
func GetStockTemplates ¶
func GetStockTemplates(w http.ResponseWriter, r *http.Request)
GetStockTemplates returns available templates from the public Documize repository.
func GetUser ¶
func GetUser(w http.ResponseWriter, r *http.Request)
GetUser returns user specified by Id
func GetUserFolderPermissions ¶
func GetUserFolderPermissions(w http.ResponseWriter, r *http.Request)
GetUserFolderPermissions returns folder permission for authenticated user.
func InviteToFolder ¶
func InviteToFolder(w http.ResponseWriter, r *http.Request)
InviteToFolder sends users folder invitation emails.
func RefreshSections ¶
func RefreshSections(w http.ResponseWriter, r *http.Request)
RefreshSections updates document sections where the data is externally sourced.
func RemoveFolder ¶
func RemoveFolder(w http.ResponseWriter, r *http.Request)
RemoveFolder moves documents to another folder before deleting it
func ResetUserPassword ¶
func ResetUserPassword(w http.ResponseWriter, r *http.Request)
ResetUserPassword stores the newly chosen password for the user.
func RunSectionCommand ¶
func RunSectionCommand(w http.ResponseWriter, r *http.Request)
RunSectionCommand passes UI request to section handler.
func SaveAsTemplate ¶
func SaveAsTemplate(w http.ResponseWriter, r *http.Request)
SaveAsTemplate saves existing document as a template.
func SaveGlobalConfig ¶ added in v0.27.0
func SaveGlobalConfig(w http.ResponseWriter, r *http.Request)
SaveGlobalConfig persists global configuration.
func SearchDocuments ¶
func SearchDocuments(w http.ResponseWriter, r *http.Request)
SearchDocuments endpoint takes a list of keywords and returns a list of document references matching those keywords.
func SearchLinkCandidates ¶ added in v0.28.0
func SearchLinkCandidates(w http.ResponseWriter, r *http.Request)
SearchLinkCandidates endpoint takes a list of keywords and returns a list of document references matching those keywords.
func SetFolderPermissions ¶
func SetFolderPermissions(w http.ResponseWriter, r *http.Request)
SetFolderPermissions persists specified folder permissions
func StartDocumentFromSavedTemplate ¶
func StartDocumentFromSavedTemplate(w http.ResponseWriter, r *http.Request)
StartDocumentFromSavedTemplate creates new document using a saved document as a template. If template ID is ZERO then we provide an Empty Document as the new document.
func StartDocumentFromStockTemplate ¶
func StartDocumentFromStockTemplate(w http.ResponseWriter, r *http.Request)
StartDocumentFromStockTemplate creates new document using one of the stock templates
func UpdateDocument ¶
func UpdateDocument(w http.ResponseWriter, r *http.Request)
UpdateDocument updates an existing document using the format described in NewDocumentModel() encoded as JSON in the request.
func UpdateDocumentPage ¶
func UpdateDocumentPage(w http.ResponseWriter, r *http.Request)
UpdateDocumentPage will persist changed page and note the fact that this is a new revision. If the page is the first in a document then the corresponding document title will also be changed.
func UpdateFolder ¶
func UpdateFolder(w http.ResponseWriter, r *http.Request)
UpdateFolder processes request to save folder object to the database
func UpdateOrganization ¶
func UpdateOrganization(w http.ResponseWriter, r *http.Request)
UpdateOrganization saves organization amends.
func UpdateUser ¶
func UpdateUser(w http.ResponseWriter, r *http.Request)
UpdateUser is the endpoint to update user information for the given userID. Note that unless they have admin privildges, a user can only update their own information. Also, only admins can update user roles in organisations.
func UploadConvertDocument ¶
func UploadConvertDocument(w http.ResponseWriter, r *http.Request)
UploadConvertDocument is an endpoint to both upload and convert a document
func ValidateAuthToken ¶
func ValidateAuthToken(w http.ResponseWriter, r *http.Request)
ValidateAuthToken checks the auth token and returns the corresponding user.