This class holds the communication context.
Note that after logging in to the ISDS server the server will shut the connection after a period of inactivity. You may use a timer which will periodically call isds_ctx.ping() to keep the connection alive.
The isds_ctx does not provide any means of thread safety. If you want to share a single isds_ctx instance between multiple threads then you have to explicitly protect it against simultaneous access.
Find boxes suiting given criteria.
Parameters: | criteria (isds_db_owner_info) – Filter criteria, You should fill in at least some members. Following entries are ignored:
|
---|---|
Returns: | Tuple containing (isds_error, list of isds_db_owner_info). Returns None instead of list on error.
Usual return codes are:
|
Find boxes matching a given full-text criteria.
Parameters: |
|
---|---|
Returns: | Tuple containing (isds_error, isds_fulltext_result_meta). Returns None instead of isds_fulltext_result_meta on error. Usual return codes are:
|
Download information about the message author.
Parameters: | dmID (string) – Message identifier (see isds_envelope.dmID). |
---|---|
Returns: | Tuple containing (isds_error, isds_message_author). Returns None instead of isds_message_author on error. |
Get list of received messages.
Parameters: |
|
---|---|
Returns: | Tuple containing (isds_error, list of isds_message). Returns None instead of list on error. |
Get list of sent messages.
Parameters: |
|
---|---|
Returns: | Tuple containing (isds_error, list of isds_message). Returns None instead of list on error. |
Download signed delivery info.
Note: | The obtained isds_message will miss isds_message.documents. Use isds_ctx.get_signed_sent_message() or isds_ctx.get_signed_received_message() if you are interested in the documents (i.e. message attachments). On the other hand only this method can get the event list which the message has gone through. |
---|---|
Parameters: | dmID (string) – Message identifier (see isds_envelope.dmID). You can use isds_ctx.get_sent_messages() or isds_ctx.get_received_messages() to obtain a list of message identifiers. |
Returns: | Tuple containing (isds_error, isds_message). Returns None instead of isds_message on error. |
Download signed received message.
Note: | The isds_message.raw of the returned isds_message will be filled with PKCS#7 data in DER format. |
---|---|
Parameters: | dmID (string) – Message identifier (see isds_envelope.dmID). You can use isds_ctx.get_received_messages() to obtain a list of message identifiers. |
Returns: | Tuple containing (isds_error, isds_message). Returns None instead of isds_message on error. |
Download signed sent message.
Note: | The isds_message.raw of the returned isds_message will be filled with PKCS#7 data in DER format. |
---|---|
Parameters: | dmID (string) – Message identifier (see isds_envelope.dmID). You can use isds_ctx.get_sent_messages() to obtain a list of message identifiers. |
Returns: | Tuple containing (isds_error, isds_message). Returns None instead of isds_message on error. |
Determine type of raw message or delivery info according some heuristics.
Note: | It does not validate the raw blob. |
---|---|
Parameters: | raw (bytes, bytearray) – Raw message or delivery info data. |
Returns: | Tuple containing (isds_error, isds_raw_type). Returns None instead of isds_raw_type on error. |
Load delivery info of given format.
Parameters: |
|
---|---|
Returns: | Tuple containing (isds_error, isds_message). Returns None instead of isds_message on error. |
Load message of given format.
Parameters: |
|
---|---|
Returns: | Tuple containing (isds_error, isds_message). Returns None instead of isds_message on error. |
Connect and log in to the ISDS server using the supplied username, password and certificate data.
Parameters: |
|
---|---|
Returns: | (isds_error) Error state. |
Connect and log in to the ISDS server using the supplied username, password and HMAC-based OTP method code.
Parameters: |
|
---|---|
Returns: | Tuple containing (isds_error, isds_otp_resolution). |
Connect and log in to the ISDS server using the supplied username and password.
Parameters: |
|
---|---|
Returns: | (isds_error) Error state. |
Connect and log in to the ISDS server using the supplied username, password and time-based OTP method code (SMS code).
Parameters: |
|
---|---|
Returns: | Tuple containing (isds_error, isds_otp_resolution). The returned isds_error usually contains:
|
Log out from ISDS and close connection.
Returns: | (isds_error) Error state. |
---|
Return long message text produced by the library (e.g. detailed error message).
Returns: | (string) Error message. |
---|
Test whether connection to ISDS is alive. Sends a dummy request and expects a dummy response.
Returns: | (isds_error) Error state. |
---|
Send message.
Parameters: | message (isds_message) – Message to be sent. Some members (e.g. dbIDRecipient) are mandatory, some are optional an some are ignored (e.g. data about the sender.) The document list must contain al least one document of the type FILEMETATYPE_MAIN. |
---|---|
Throws TypeError: | |
When message of non-isds_message type. | |
Returns: | Tuple containing (isds_error, dmID). Returns None instead of dmID on error. |
Sets timeout in ms. This value applies for every network-related operation (e.g. connecting to the server or sending a message). Use 0 to disable the timeout limit.
Parameters: | timeout_ms (int) – Timeout in ms. |
---|