
I am the author of the xECM Python Module and a certified xECM for SuccessFactors © consultant / developer / business administrator / analyst.
Check out our useful Python examples that we collected in our OpenText © Extended ECM Content Server projects.
Install the xECM Python Module to easily access Content Server API.
pip install xecm
Install xECM Python Module
Get a node using xECM Python Module.
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': []
# }
Install xECM Python Module
Get subnodes using xECM Python Module.
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
Install xECM Python Module