API Reference
The API is accessible via the ECM() factory and is split into the following namespaces:
| Namespace | Description | Reference |
|---|---|---|
|
Folder, register, and document operations |
|
|
User and group management |
|
|
Server metadata and object definitions |
|
|
Direct SQL access via ADO |
1. ECM factory
from ecmind_blue_client.ecm import ECM
from ecmind_blue_client.pool import SyncPoolClient
client = SyncPoolClient(servers="<host>:4000:1", username="<username>", password="<password>")
ecm = ECM(client)
The ECM() function is overloaded: passing a SyncPoolClient returns ECMSync; passing an AsyncPoolClient returns ECMAsync.
2. impersonate()
ecm.impersonate(username: str) -> ECMSync | ECMAsync
Returns a new ECM instance that injects the given user context into every request ($SwitchContextUserName$).
The executing user requires the Context Switch system role.
Supports both direct usage and use as a context manager (with / async with).
-
Sync
-
Async
with ecm.impersonate("john") as ecm_john:
ecm_john.dms.insert(MyFolder(Title="Test"))
async with ecm.impersonate("john") as ecm_john:
await ecm_john.dms.insert(MyFolder(Title="Test"))