DocMGR API Documentation
From DocMGR
Contents |
Usage
All commands must be passed in either a JSON-formatted string, or in XML formatted string. If XML, it must be surrounded by root node tags, like "<data><command>keepalive</command></data>". JSON will look like "{command: keepalive}".
If passed through an http request, the command string must be passed in the apidata variable. For example, an api request may look like:
http://docmgr.mydomain.com/api.php?apidata={"command":"docmgr_object_getinfo","object_id":"5"}
To log into the API, the request needs to pass a login and password using "login" and "password" for the variable names. Browsers will retain the authenticated session, so there will be no need to pass further session information as long as the session doesn't expire. Non-browsers will not retain the session. The session_id is returned during the authentication request. Non-browsers must pass this back using the "PHPSESSID" variable during subsequent connections to prevent the login and password from having to be passed again.
The keepalive command can be passed periodically to keep the server side session alive.
All commands (except keepalive) follow the appname_classname_methodname format. appname must be one of the recognized apps by the API. "classname" must be a valid application class, and "methodname" must exist in that class.
Whenever a command accepts object_id as a parameter, you may also pass the “path” parameter instead, where “path” is the DocMGR path to the object instead of using the database id of the object with object_id. The same applies to the parent_id parameter. parent_path may be passed instead where parent_path is the DocMGR path to the collection which is the parent of the current object.
API Commands
General API Commands
|
Command |
keepalive |
|
Purpose |
Prevents authenticated session from expiring |
|
Input |
none |
|
Returns |
none |
Bookmarks
|
Command |
docmgr_bookmark_get |
|
Purpose |
pulls a list of all bookmarks for the user |
|
Input |
account_id (optional) → passed by admin to retrieve bookmarks for specified user |
|
Returns |
bookmark (array) → properties of bookmark |
|
Command |
docmgr_bookmark_save |
|
Purpose |
saves bookmark information |
|
Input |
bookmark_id → id of the current bookmark if updating name → name of the bookmark expandable → whether or not it can be expanded via a tree on the interface protected → if set, cannot be deleted by user (like for Root or Home directory bookmarks) |
|
Returns |
bookmark_id → id of bookmark created |
|
Command |
docmgr_bookmark_delete |
|
Purpose |
Removes selected bookmark |
|
Input |
bookmark_id → id of bookmark to remove |
|
Returns |
none |
Collections
none → all methods are private and called by OBJECT class
Discussion
|
Command |
docmgr_discussion_getlist |
|
Purpose |
get list of all topics for current object |
|
Input |
object_id → object to get topics for |
|
Returns |
topic (array) → topic information |
|
Command |
docmgr_discussion_getthread |
|
Purpose |
Returns all messages under the current topic |
|
Input |
topic_id → id of topic to return threads for |
|
Returns |
thread_name → name of current thread topic → array of thread information |
|
Command |
docmgr_discussion_newtopic |
|
Purpose |
Saves a new topic |
|
Input |
message_subject → subject of topic editor_content → message body |
|
Returns |
topic_id → id of new topic |
|
Command |
docmgr_discussion_reply |
|
Purpose |
Posts reply to current topic |
|
Input |
message_subject → subject of topic editor_content → message body topic_id → id of topic to post reply under |
|
Returns |
reply_id → id of new message |
|
Command |
docmgr_discussion_edit |
|
Purpose |
To update existing message |
|
Input |
editor_content → message body topic_id → id of message to update |
|
Returns |
none |
|
Command |
docmgr_discussion_delete |
|
Purpose |
To delete a topic and its children |
|
Input |
topic_id → id of topic to delete |
|
Returns |
none |
Document
|
Command |
docmgr_document_get |
|
Purpose |
Return content of DocMGR document |
|
Input
|
object_id → id of object to pull document_id → if passed, pulls the revision using that id. Otherwise pulls latest revision lock → if passed, locks file for editing direct → if passed, outputs file content directly as stream |
|
Returns |
If passed “direct”, outputs file content directly to browser via Header, otherwise returns content → document content |
|
Command |
docmgr_document_gethistory |
|
Purpose |
Returns list of all revisions of document |
|
Input |
object_id → id of object to return revision list |
|
Returns |
History → array of history data |
|
Command |
docmgr_document_save |
|
Purpose |
Updates existing document or saves new one. If the object doesn't exist, it creates it. Otherwise it saves the content. |
|
Input |
If file doesn't exist: name → document name exist_name → rename new document to something else if it exists summary → document summary parent_id → id of collection to create in mkdir → if parent_path doesn't exist, make it Common: unlock → unlock document after saving editor_content → html content of document to save |
|
Returns |
object_path → path of new object object_id → id of new object |
|
Command |
docmgr_document_removerevision |
|
Purpose |
Removes single revision instace of a document |
|
Input |
document_id → dm_document table id of revision to remove |
|
Returns |
none |
|
Command |
docmgr_document_promote |
|
Purpose |
Promotes selected revision to latest revision of document |
|
Input |
document_id → id of revision to promote |
|
Returns |
none |
|
Command |
docmgr_document_createstorage |
|
Purpose |
Creates hidden storage folder for files for the current document |
|
Input |
object_id → id of object being worked on |
|
Returns |
storage_id → id of collection which was created |
|
Command |
docmgr_document_createtemp |
|
Purpose |
Creates hidden temporary storage folder for current user |
|
Input |
none |
|
Returns |
storage_id → id of collection it created |
File
|
Command |
docmgr_file_multisave |
|
Purpose |
Save multiple files to a destination collection |
|
Input |
uploadfile (array) → uploaded files (html file input form) parent_id → id of collection to place saved files |
|
Returns |
“success” if worked. All returns are in xml format so they will work in an iframe |
|
Command |
docmgr_file_import |
|
Purpose |
Saves all files in the specified directory on the server to the desired collection |
|
Input |
parent_id → id of collection to place saved files directory → server filesystem directory with files to import |
|
Returns |
none |
|
Command |
docmgr_file_save |
|
Purpose |
Save uploaded file or specified server file to DocMGR |
|
Input |
Summary → object summary for file filepath (optional) → path to file on server that's being saved uploadfile → html file input form overwrite → overwrite file if it exists as new revision parent_id → id of collection to save file to mkdir → make parent folder if it doesn't exist (works with parent_path) exist_rename → saves file with new name if one already exists with desired name |
|
Returns |
“success” if worked. All returns are in xml format so they will work in an iframe |
|
Command |
docmgr_file_get |
|
Purpose |
Get file for viewing |
|
Input |
object_id → id of file to retrieve lock → lock file if specified to prevent other users from editing changes file_id → pull this revision of the file if specified (id of file in dm_file_history table) |
|
Returns |
Streams file to browser |
|
Command |
docmgr_file_savedsoframer |
|
Purpose |
Saves file submitted from dsoframer activex object |
|
Input |
trackdata → html file input form containing file data name → save file with this name parent_id → id of collection to save file in object_type → “document” or “file” (defaults to file) overwrite → overwrite file if it already exists (as new revision) |
|
Returns |
none |
|
Command |
docmgr_file_removerevision |
|
Purpose |
Removes single revision instace of a file |
|
Input |
object_id → id of object specified file links to file_id → dm_file_history table id of revision to remove |
|
Returns |
none |
|
Command |
docmgr_file_promote |
|
Purpose |
Promotes passed file_id to latest revision |
|
Input |
object_id → id of object revision links to file_id → dm_document table id of revision to remove |
|
Returns |
none |
|
Command |
docmgr_file_gethistory |
|
Purpose |
Returns a list of revisions for file |
|
Input |
object_id → id of object to fetch history list for |
|
Returns |
history (array) → history revision data |
|
Command |
docmgr_file_getashtml |
|
Purpose |
Converts a file to html and returns the html |
|
Input |
object_id → id of object to convert |
|
Returns |
content → HTML Data |
|
Command |
docmgr_file_savefromhtml |
|
Purpose |
Converts submitted html to the file's native format and saves the file with that content |
|
Input |
editor_content → html content to save |
|
Returns |
none |
|
Command |
docmgr_file_rotate |
|
Purpose |
Rotates an image file right or left 90 degrees |
|
Input |
object_id → id of file to rotate direction → “left” or “right”. Direction to rotate file. |
|
Returns |
none |
Intranet
|
Command |
docmgr_intranet_get |
|
Purpose |
Gets data for current intranet page |
|
Input |
object_id → id of object to get data |
|
Returns |
Array → could be page list, url info, or the content of a document. Depends on the type of object you're getting info for |
|
Command |
docmgr_intranet_getchildren |
|
Purpose |
Get all objects under the “pages” folder of the current document object |
|
Input |
object_id → id of object we're going to get children of |
|
Returns |
Array of browse results |
|
Command |
docmgr_intranet_create |
|
Purpose |
Master function for creating a new intranet object |
|
Input |
object_type → collection, url, or document parent_id → id of owning collection name → save page with this name summary → summary of page |
|
Returns |
none |
Keyword
|
Command |
docmgr_keyword_savevalues |
|
Purpose |
Saves an object's specified keyword values |
|
Input |
keyword_id (array) → id of keyword we're saving value form keyword_value (array) → value of keyword object_id → id of object we're saving keyword info |
|
Returns |
none |
|
Command |
docmgr_keyword_getall |
|
Purpose |
Returns all keywords, for admin purposes |
|
Input |
none |
|
Returns |
keyword (array) → list of all keywords in system |
|
Command |
docmgr_keyword_getlist |
|
Purpose |
Returns all global keywords and keywords belonging to the specified collection |
|
Input |
object_id (optional) → current object to fetch values of keywords for parent_id → id of collection to fetch keywords for |
|
Returns |
keyword (array) → list of all keywords in system |
|
Command |
docmgr_keyword_save |
|
Purpose |
Saves a keyword setup entry |
|
Input |
keyword_name → name of keyword to save keyword_type → “text” or “select” required → “t” or “f” - whether or not it must be saved for an object |
|
Returns |
Array → saved info for keyword |
|
Command |
docmgr_keyword_saveoption |
|
Purpose |
Saves a new keyword option (for “select” keywords) |
|
Input |
option_name → name of option keyword_id → if of keyword option belongs to |
|
Returns |
none |
|
Command |
docmgr_keyword_deleteoption |
|
Purpose |
Deletes keyword option |
|
Input |
option_id → id of option to delete |
|
Returns |
none |
|
Command |
docmgr_keyword_getinfo |
|
Purpose |
Returns all setup information for a keyword |
|
Input |
keyword_id → id of keyword to get info for |
|
Returns |
keyword (array) → keyword data |
|
Command |
docmgr_keyword_getoptions |
|
Purpose |
Gets all setup options for “select” keyword |
|
Input |
keyword_id → id of keyword to get options for |
|
Returns |
option (array) → option data |
|
Command |
docmgr_keyword_delete |
|
Purpose |
Removes keyword from the system |
|
Input |
keyword_id → id of keyword to get info for |
|
Returns |
none |
Log
|
Command |
docmgr_log_getlist |
|
Purpose |
Returns system log entries for an object |
|
Input |
object_id → id of object to return logs for filter → search filter option (possible values below) myentries → entries belong to current user virus → virus logs only email → email logs only view → object viewing logs lastten → return last ten entries only all → return all logs |
|
Returns |
log (array) → log data |
Object
|
Command |
docmgr_object_move |
|
Purpose |
Moves and object from one collection to another |
|
Input |
parent_id → id of destination collection |
|
Returns |
none |
|
Command |
docmgr_object_getinfo |
|
Purpose |
Returns general object info |
|
Input |
object_id → id of object to get info for |
|
Returns |
object (array) → object data |
|
Command |
docmgr_object_getid |
|
Purpose |
Returns current object id |
|
Input |
path → path of object to get id for |
|
Returns |
object_id → id of object |
|
Command |
docmgr_object_saveparent |
|
Purpose |
Updates parent for object |
|
Input |
object_id → id of object to update parent parent_id (integer or array) → new parent of object |
|
Returns |
none |
|
Command |
docmgr_object_create |
|
Purpose |
Creates a new object |
|
Input |
parent_id → id of collection to store object in mkdir → make collection if it doesn't already exist (used with parent_path) object_type → type of object we are making (file, document, url, savesearch, collection) name → name of new object summary → object description object_owner (optional) → account owning the object protected → can it be deleted by the user hidden → can it be seen in regular search or browse |
|
Returns |
object_id → id of created object |
|
Command |
docmgr_object_update |
|
Purpose |
Updates an object's properties |
|
Input |
parent_id → collection to store object in parent_path (instead of parent_id) → docmgr path to store object in name → name of object summary → object description keyword_id (array) → id of keyword to update keyword_value (array) → corresponding value of keyword |
|
Returns |
none |
|
Command |
docmgr_object_delete |
|
Purpose |
Deletes an object from the system |
|
Input |
object_id → id of object to delete |
|
Returns |
none |
|
Command |
docmgr_object_convert |
|
Purpose |
Converts a file or document from one type to another |
|
Input |
object_id → id of object to convert to → extension to convert file to content → return content to browser |
|
Returns |
Streams converted file to browser, unless specified to return content |
|
Command |
docmgr_object_savepermissions |
|
Purpose |
Save account and group permissions for the object |
|
Input |
object_id → object to save permissions for reset_perms → reset permissions on all children below the current collection perm (array) → stores following type → “account” or “group” value → “admin”,”manage”,”edit”,”view” id → id of account or group |
|
Returns |
none |
|
Command |
docmgr_object_getperms |
|
Purpose |
Get all group and account permission settings for the object |
|
Input |
object_id → id of object to get permissions for perm_filter → “groups”,”accounts”, or “selected” search_string → pattern matching filter for group or account names |
|
Returns |
entry (array) → permission entry info |
|
Command |
docmgr_object_lock |
|
Purpose |
Locks a file so it can't be edited by others |
|
Input |
object_id → id of object to lock |
|
Returns |
none |
|
Command |
docmgr_object_unlock |
|
Purpose |
Unlocks a file so anyone with proper permissions can edit it |
|
Input |
object_id → id of object to unlock |
|
Returns |
none |
|
Command |
docmgr_object_getsubscription |
|
Purpose |
Get subscription settings for current user and specified object |
|
Input |
object_id → id of object to get user's settings |
|
Returns |
subscribe (array) → subscription data |
|
Command |
docmgr_object_updatesubscription |
|
Purpose |
Updates subscription settings for current user and current object |
|
Input |
send_email → send user email on updates (t or f) send_file → send the file with the email notification (t or f) type → event type to notify on |
|
Returns |
none |
|
Command |
docmgr_object_createlink |
|
Purpose |
Creates a link non-users can use to view a file or document |
|
Input |
object_type → must be document or file expire → time in hours the link will be valid for |
|
Returns |
object_link → link to object |
|
Command |
docmgr_object_getview |
|
Purpose |
Gets current view (thumbnail or list) for the current collection |
|
Input |
object_id → id of collection to get view settings |
|
Returns |
default_view → list or thumbnail account_view → list or thumbnail |
|
Command |
docmgr_object_getalerts |
|
Purpose |
Get all alerts for the current user |
|
Input |
none |
|
Returns |
Array of the alert data |
|
Command |
docmgr_object_getallsubscriptions |
|
Purpose |
Gets all files the user is subscribed to |
|
Input |
none |
|
Returns |
subscribe (array) → subscription data |
|
Command |
docmgr_object_clearalert |
|
Purpose |
Clears specified alert |
|
Input |
alert_id → id of alert to remove |
|
Returns |
none |
|
Command |
docmgr_object_trash |
|
Purpose |
Move file to user's trash folder |
|
Input |
object_id (integer or array) → id of object to get user's settings |
|
Returns |
none |
|
Command |
docmgr_object_emptytrash |
|
Purpose |
Empty user's trash folder |
|
Input |
none |
|
Returns |
none |
|
Command |
docmgr_pdf_merge |
|
Purpose |
Merges multiple pdfs into one |
|
Input |
object_id (array) → object ids to merge |
|
Returns |
none |
|
Command |
docmgr_pdf_advedit |
|
Purpose |
Splits a pdf into individual pages for rotating |
|
Input |
object_id → id of pdf file to split |
|
Returns |
file (array) → files in the temp directory |
|
Command |
docmgr_pdf_rotate |
|
Purpose |
Rotates a pdf page under advanced it |
|
Input |
file → server filesystem path to file to rotate |
|
Returns |
none |
|
Command |
docmgr_pdf_commit |
|
Purpose |
Combines advedit pdf back into one file w/ all changes saved |
|
Input |
saveorder → saves files in new order |
|
Returns |
none |
Savesearch
|
Command |
docmgr_savesearch_get |
|
Purpose |
Gets objects matching the saved search |
|
Input |
object_id → id of savesearch object |
|
Returns |
See “docmgr_search_search” |
Search
|
Command |
docmgr_search_browsecol |
|
Purpose |
Returns a list of collections only |
|
Input |
curval → id or path of current folder (like a selected folder in an expanded tree). Will return all folders in the tree leading to that folder ceiling → folder to use as root of the tree init → return entire folder tree. Otherwise just returns tree under current curval |
|
Returns |
collection (array) → match data |
|
Command |
docmgr_search_browse |
|
Purpose |
Returns all objects under current object |
|
Input |
object_id → id of cllection to return children of mkdir → if path we are browsing doesn't exist, create as a collection sort_field → sort by this column sort_dir → sort by this direction |
|
Returns |
object (array) → match data default_view → default view of browsed collection account_view → account's view of browse collection keyword (array) → keywords that can be used in current collection |
|
Command |
docmgr_search_search |
|||||||||||||||
|
Purpose |
Returns all objects matching specified search parameters |
|||||||||||||||
|
Input |
search_string → search pattern to match against search_option (array) → search in file “name”,”summary”, “content” for search_string limit → return only this many results offset → start at this result number sort_field → sort by this column (name, edit, size, rank) sort_dir → sort in this direction object_filter (array) → only return objects of this type object_id → only return files under current collection reset → requery database. Don't use cached search count filter (array) → filter to match against match (array) → how to match filter value (array) → filter value to search for
|
|||||||||||||||
|
Returns |
object (array) → object data of search matches keyword (array) → keyword list of available keywords count → number of search results on current page totalCount → number of total search results time → time search took to complete |
URL
|
Command |
docmgr_url_get |
|
Purpose |
Fetches url of an url object from the system |
|
Input |
object_id → id of url object |
|
Returns |
url → http address |
|
Command |
docmgr_url_save |
|
Purpose |
Saves a url object |
|
Input |
parent_id → id of collection to store in name → name of object summary → object summary url → url to point object to |
|
Returns |
none |
Workflow
|
Command |
docmgr_workflow_getlist |
|
Purpose |
Gets all available workflows for the object |
|
Input |
object_id → id of object to get workflow for |
|
Returns |
workflow (array) → workflow data |
|
Command |
docmgr_workflow_getinfo |
|
Purpose |
Retrieve info for a specified workflow, including recipients and status |
|
Input |
workflow_id |
|
Returns |
workflow (array) → workflow data |
|
Command |
docmgr_workflow_create |
|
Purpose |
Create a new workflow |
|
Input |
object_id → id of object to create workflow for |
|
Returns |
workflow (array) → workflow data |
|
Command |
docmgr_workflow_getrecips |
|
Purpose |
Get recipients for a workflow |
|
Input |
workflow_id → id of workflow to get recipients for |
|
Returns |
recipient (array) → array of recipient data |
|
Command |
docmgr_workflow_saverecip |
|
Purpose |
Save a workflow task |
|
Input |
route_id → id of task to update (optional) workflow_id → workflow new or existing route lives in account_id → recipient account_id task_type → type of task to perform (“view”,”edit”,”approve”) task_notes → notes for task for recipient to see date_due → date task is due sort_order → route stage task is in |
|
Returns |
none |
|
Command |
docmgr_workflow_deleterecip |
|
Purpose |
Removes a recipient from a route |
|
Input |
route_id → id of route to remove recipient from |
|
Returns |
none |
|
Command |
docmgr_workflow_setopt |
|
Purpose |
Sets general options for workflow |
|
Input |
workflow_id option → “emailcomplete” or “expirenotify” action → “set” or “unset” |
|
Returns |
none |
|
Command |
docmgr_workflow_savetemplate |
|
Purpose |
Saves a workflow as a template |
|
Input |
template_id → template to update if there is one template_name → name of template when saving workflow_id → workflow to save as a template |
|
Returns |
none |
|
Command |
docmgr_workflow_gettemplates |
|
Purpose |
Get all saved workflow templates for the user |
|
Input |
None |
|
Returns |
template (array) → template data |
|
Command |
docmgr_workflow_deletetemplate |
|
Purpose |
Deletes a workflow template |
|
Input |
template_id → id of template to remove |
|
Returns |
none |
|
Command |
docmgr_workflow_getfromtemplate |
|
Purpose |
Creates a new workflow using a template |
|
Input |
template_id → id of template to use workflow_id → existing workflow we are going to apply template to |
|
Returns |
none |
|
Command |
docmgr_workflow_begin |
|
Purpose |
Inits a workflow and sends out initial task notifications |
|
Input |
workflow_id → id of workflow to start |
|
Returns |
none |
|
Command |
docmgr_workflow_forcecomplete |
|
Purpose |
Force a workflow complete. Marks all tasks complete and closed the workflow |
|
Input |
workflow_id → id of workflow to mark complete |
|
Returns |
none |
|
Command |
docmgr_workflow_markcomplete |
|
Purpose |
Marks a particular workflow task complete |
|
Input |
route_id → id of task route to mark complete taskComment → comment for task compl |
|
Returns |
none |
|
Command |
docmgr_workflow_rejectapproval |
|
Purpose |
Rejects and approval task |
|
Input |
route_id → id of route task to reject workflow_id → workflow id of route taskComment → reason for rejection |
|
Returns |
none |
|
Command |
docmgr_workflow_gettasks |
|
Purpose |
Get all tasks for this object |
|
Input |
object_id → id of object to fetch tasks for |
|
Returns |
task (array) → task data |

