Installation of the xECM Python Module

Install the xECM Python Module to easily access Content Server API.

Console

pip install xecm

Information

Install xECM Python Module

Python version 3.10 or higher
Use with Content Server Rest API
Requires: Python and PIP is installed

Simple call using the xECM Python Module

Get a node using xECM Python Module.

Python

import xecm
import logging

# use logging.ERROR to only log ERRORS - reduce logging
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO)

if __name__ == '__main__':
    deflogger = logging.getLogger("mylogger")
    cshost = 'http://otcs.phil.local'
 
    # get OTCSTicket with username and password
    csapi = xecm.CSRestAPI(xecm.LoginType.OTCS_TICKET, f'{cshost}/otcs/cs.exe', 'myuser', 's#cret', True, deflogger)

    # Get Enterprise Node
    nodeId = 2000
    res = csapi.node_get(f'{cshost}/otcs/cs.exe', nodeId, ['id', 'name'], False, False, False)
    print(res)
    # {
    #   'properties': {'id': 2000, 'name': 'Enterprise'}, 
    #   'categories': [], 
    #   'permissions': {'owner': {}, 'group': {}, 'public': {}, 'custom': []}, 
    #   'classifications': []
    # }

Information

Install xECM Python Module

Python version 3.10 or higher
Use with Content Server Rest API
Requires: Python and PIP is installed

Get List using the xECM Python Module

Get subnodes using xECM Python Module.

Python

import xecm
import logging

# use logging.ERROR to only log ERRORS - reduce logging
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO)

if __name__ == '__main__':
    deflogger = logging.getLogger("mylogger")
    cshost = 'http://otcs.phil.local'
 
    # get OTCSTicket with username and password
    csapi = xecm.CSRestAPI(xecm.LoginType.OTCS_TICKET, f'{cshost}/otcs/cs.exe', 'myuser', 's#cret', True, deflogger)

    # Get Business Workspace Main Folder
    nodeId = 30648
    res = csapi.subnodes_get(f'{cshost}/otcs/cs.exe', nodeId, ['id', 'name'], False, False, False, 1)

    if res and res.get('results', []):
        for node in res['results']:
            print(node['properties']['name'])


    # prints out:
    # Employee Hans Meier
    # Employee Maria Bernasconi
    # Employee Max Mustermann
    # Employee Phil Egger

Information

Install xECM Python Module

Python version 3.10 or higher
Use with Content Server Rest API
Requires: Python and PIP is installed