The Integration section provides APIs for exchanging data with external systems.
It includes operations such as uploading and downloading data, acknowledgements, and related integration flows.
These APIs support reliable communication and synchronization between systems.
downloadList (Android, Windows, iOS) #
Retrieves a list of available files from the specified channel as a JSON array (for example, to display documents available for signing).
The function supports multiple channel types configured in the Signatus settings, including Browse local storage, Browse REST, Browse CMIS, Send to local storage, Upload REST, and Upload CMIS. When used with upload channels, it returns the list of files that are currently pending upload.
For operations that do not require network communication—such as local storage and upload channels—the function can be executed synchronously.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {string} - Returns empty JSON if asynchronous
*/
function downloadList(arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| channel | true / false | string | Download channel name |
| url | true | string | absolute or relative download URL (if relative URL is used, the “channel” parameter is required; if “url” is specified, the processing will be asynchronous) |
| call | true | string | Callback function name |
| cookieToHolder | false | boolean | if true, do not reuse the cookie obtained during login in subsequent REST downloads (repeat login with password instead) – useful if you need to communicate with different servers that do not share the same session ID (cookies), default is false |
| user | false | string | user name for server authentication (if specified, the processing will be asynchronous) |
| password | false | string | password for server authentication |
Example :
const arg = {
"channel": "MyRestDocuments",
"call": "onDownloadList"
}
downloadList(arg);
/**
* callback function for download list
* @param res - result in string format
*/
function onDownloadList (res) {
const result= JSON.parse(res);
}Result example :
If the above conditions for synchronous processing are fulfilled, the result is returned as JSON string. Otherwise, the return value is an empty string and the actual result is returned asynchronously as an argument to the specified callback function. The result is an unparsed JSON string containing one object attribute parameter. The parameter object contains the following attributes: status String attribute (OK / ERROR), Code: 400/650 message String (human-readable text for status), data JSON array – list of documents and subfolders
{
"parameter": {
"status": "OK",
"message": "Download OK",
"code": 200,
"messageDetail": "",
"data": [
{
"date": 1768487075526,
"filename": "28cd41ac-b504-4ac6-96ab-f46e3e8b9577.pdf",
"id": "OyAzj2_jep2hUsTFD5wZycjtO4RNHFvpSIlplz5DNnAcWiGAaK2bfp-BamyyP0hkFo-Wxk1tVzuDSQsKV7Evv6CbeyyDfwg8UtFTAoNAmb4",
"modification": "2026-01-15 15:24:35",
"reuploadState": "signed",
"state": "tosign",
"url": "https://ds-sts.ana.sk/rest/document/OyAzj2_jep2hUsTFD5wZycjtO4RNHFvpSIlplz5DNnAcWiGAaK2bfp-BamyyP0hkFo-Wxk1tVzuDSQsKV7Evv6CbeyyDfwg8UtFTAoNAmb4",
"number": "146",
"name": "Shirley",
"box": "Inbox",
"group": "wiki",
"sid": ""
}
]
}
}download (Android, Windows, iOS) #
Downloads a file from a server using the SIGNATUS REST API.
For operations that do not require network communication (for example, when using local storage channels), the function can be used synchronously. In this case, the parameters call, saveChannel, user and password must be left empty. Only the url, savePath, channel parameters are required.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {string} - Returns empty JSON in string format
*/
function download(arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| channel | true / false | string | Download channel name |
| url | true | string | absolute or relative download URL (if relative URL is used, the channel parameter is required) |
| savePath | true | string | path to the workspace directory where the downloaded file will be saved |
| call | true | string | Callback function name |
| login | false | string | whenused with the value „channel“, the Login URL of the channel will be used to log in before downloading the file |
| cookieToHolder | false | boolean | if true, do not reuse the cookie obtained during login in subsequent REST downloads (repeat login with password instead) – useful if you need to communicate with different servers that do not share the same session ID (cookies), default is false |
| user | false | string | user name for server authentication |
| password | false | string | password for server authentication |
| id | false | string | unique document ID |
| saveChannel | false | string | Local Device Storage channel name, where downloaded file is stored (if saveChannel is set, savePath parameter is ignored) |
| filename | false | string | how to name the downloaded file in the destination |
| data | false | JSON Object | Additional data in JSON format that will be stored in a separate metadata file linked to the downloaded file |
| overwrite | false | boolean | if false (default), avoid overwriting existing files by automatically renaming them in the destination directory |
| useChannelAck | false | boolean | if true, acknowledge download using the ACK URL configured for the channel (default is false) |
| deleteWhenAckFailed | false | boolean | if true and acknowledgement of download (using the ACK URL) fails, the downloaded file is deleted from the device so that only successfully acknowledged files are visible (default is false), code – unique identifier of the download request – this code will be logged in the application log and passed to the asynchronous callback function to identify which download the result belongs to |
| showProgress | false | boolean | if true, shows a progress animation during the download (default is false) |
Example :
const arg = {
"channel": "MyRestDocuments",
"url": "https://ds-sts.ana.sk/rest/document/OyAzj2_jep2hUsTFD5wZycjtO4RNHFvpSIlplz5DNnAcWiGAaK2bfp-BamyyP0hkFo-Wxk1tVzuDSQsKV7Evv6CbeyyDfwg8UtFTAoNAmb4",
"savePath": "/tosign/Test1.pdf",
"call": "onDownloadDocument"
}
download(arg);
/**
* callback function for download
* @param res - result in string format
*/
function onDownloadDocument (res) {
const result= JSON.parse(res);
}Result example :
{
"parameter": {
"status": "OK",
"message": "Download OK",
"savePath": "/tosign/Test1.pdf",
"data": {
"id": "Test1.pdf",
"filename": "Test1.pdf",
"url": "file:/data/user/0/com.anasoft.signatus.app/files/WorkSpace/tosign/Test1.pdf",
"size": 25605,
"lastModified": 1768487975000,
"pwd": ""
},
"transactionCode": "2075700742",
"code": 200
}
}multiDownload (Android) #
Downloads multiple files from a server using the SIGNATUS REST API.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function download(arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| list | true / false | JSON Array | Element has the attributes supported by the download function. Described on download chapter |
| state | false | string | CANCEL – Interrupts the download of all files. The currently downloaded file will be downloaded. |
Example :
const arg = {
"list": [
{
"channel": "MyRestDocuments",
"url": "https://ds-sts.ana.sk/rest/document/OyAzj2_jep2hUsTFD5wZycjtO4RNHFvpSIlplz5DNnAcWiGAaK2bfp-BamyyP0hkFo-Wxk1tVzuDSQsKV7Evv6CbeyyDfwg8UtFTAoNAmb4",
"savePath": "/tosign/Test1.pdf",
"call": "onDownloadDocument"
}, {
"channel": "MyRestDocuments",
"url": "https://ds-sts.ana.sk/rest/document/XYAzj2_jep2hUsTFD5wZycjtO4RNHFvpSIlplz5DNnAcWiGAaK2bfp-BamyyP0hkFo-Wxk1tVzuDSQsKV7Evv6CbeyyDfwg8UtFTAojhjUU",
"savePath": "/tosign/Test2.pdf",
"call": "onDownloadDocument"
}
]
}
multiDownload(arg);
/**
* callback function for download
* @param res - result in string format
*/
function onDownloadDocument (res) {
const result= JSON.parse(res);
}or
const arr = {
"state" : "CANCEL"
}
multiDownload(arg);Result is described in download chapter
isDownloading (Android) #
Checks if the download or multi download of a file is running in the background. Function is suitable for scenarios, when there is an intention to cancel download of a multiple files, to find out if there is a file being downloaded at the moment.
/**
* @param {Object} arg- Parameter Empty JSON object.
* @returns {boolean} - Returns true if downloadis running in background, false otherwise.
*/
function isDownloading (arg);Example :
isDownloading ({});send (Android, Windows, iOS) #
Submits the file to a configured REST upload channel.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function send(arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Name of the file to upload |
| channel | false | string | Name of the upload channel to use for uploading (if not specified and more than one channel has been defined in the settings, it prompts the user with a dialog window) |
| call | true | string | Callback function name |
| saveChannel | false | string | If specified,the uploaded file is read from the directory of the local channel instead of the wizard workspace (avoids the need to copy a file from local channel to workspace for example if signing is done on the server) |
| filename | false | string | Required if “saveChannel” is specified – the name of the file from the local channel to upload |
| data | false | JSON Object | additional data for the uploader in JSON format |
| upload | false | boolean | – true (default value) : file is prepared for upload and uploader is called immediately – false : file is only prepared for upload, the uploader can be started later using the ‘upload’ function |
Example :
const arg = {
"channel" : "SignedDocuments",
"file" : "/signed/Test1.pdf",
"call" : "onSendDocument"
};
send(arg);
/**
* callback function for send function
* @param res - result in string format
*/
function onSendDocument (res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": {
"status": "OK",
"message": ""
}
}multiSend (Android) #
Submits multiple files to a configured REST upload channel..
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function multiSend(arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| list | true | JSON Array | Element has the attributes supported by the send function. Described on send chapter |
Example :
const arg = [
{
"channel": "SignedDocuments",
"file": "/signed/Test1.pdf",
"call": "onSendDocument"
},
{
"channel": "SignedDocuments",
"file": "/signed/Test2.pdf",
"call": "onSendDocument"
}
];
multiSend(arg);
/**
* callback function for send function
* @param res - result in string format
*/
function onSendDocument (res) {
const result = JSON.parse(res);
}Result is described in send chapter
upload (Android, Windows, iOS) #
Starts the file upload service.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function upload(arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| login | false | string | – show (default value) : if authentication is required for upload service, application show native authentication dialog – propagate : propagate authentication required information to callback function |
| call | true | string | Callback function name |
Example :
const arg = {
"login" : "propagate",
"call" : "onUpload"
};
upload(arg);
/**
* callback function for upload function
* @param res - result in string format
*/
function onUpload (res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": {
"status": "OK",
"message": ""
}
}onSystem (Android) #
This is not a function that your JavaScript code should call, on the contrary, this is a function that Signatus calls when some system events occur.
The list of system events:
- a document is successfully uploaded (code 72),
- a document failed to upload (code 73),
- document upload requires authentication (code 74).
If you do not define this function, a default implementation is used that only logs the event to the logs.
function onSystem (res) {
const result = JSON.parse(res);
}Result description :
| Name | Format | Description |
|---|---|---|
| code | int | Type of event |
| data | JSON Object | Detailed information about the event |
Result example :
{
"parameter": {
"code": 72,
"data": {
"action": "uploaded",
"channelName": "LOCAL_0",
"cout": 1726,
"message": "Test1.pdf"
}
}
}sendAck (Android, Windows, iOS) #
Sends metadata about the state of the document (e.g. “signed” in order to acknowledge that the document has been signed and can be removed from the list of documents available for signature).
/**
* @param {Object} arg- Parameter JSON object.
* @returns {string} - Returns "run" string
*/
function sendAck (arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| channel | true | string | Download channel name |
| state | true | string | New document state – download : document has been downloaded – cancel : document signing has been cancelled – open : document has been opened – or some custom state value understood by the server |
| call | true | string | Callback function name |
| id | false | string | Document unique ID |
| data | false | JSON Object | Additional data in JSON format |
| user | false | string | User name for server authentication (if specified, the processing will be asynchronous) |
| password | false | string | Password for server authentication |
Example :
const arg = {
"channel" : "MyRestDocuments",
"state" : "open",
"id": "OyAzj2_jep2hUsTFD5wZycjtO4RNHFvpSIlplz5DNnAcWiGAaK2bfp-BamyyP0hkFo-Wxk1tVzuDSQsKV7Evv6CbeyyDfwg8UtFTAoNAmb4",
"call" : "onAck"
};
sendAck(arg);
/**
* callback function for sendAck
* @param res - result in string format
*/
function onAck (res) {
const result= JSON.parse(res);
}Result example :
{
"parameter": {
"status": "OK",
"message": "",
"data": "{\"message\":\"msg.document.move.success\",\"result\":\"OyAzj2_jep2hUsTFD5wZycjtO4RNHFvpSIlplz5DNnAcWiGAaK2bfp-BamyyP0hkFo-Wxk1tVzuDSQsKV7Evv6CbeyyDfwg8UtFTAoNAmb4\"}",
"code": 200
}
}postRequest (Android) #
Executes an HTTP POST request (with JSON data) to the server specified in an upload channel configuration. Returns server response as a string. The request is encoded as multipart/form-data.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function postRequest (arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| channel | true | string | Upload channel name. |
| id | true | string | String sent as a separate form field of multipart/form-data named “id” |
| data | true | string | String as a form field of multipart/form-data named “data” |
| call | true | string | Callback function name |
Example :
const arg = {
"id" : "123456",
"data" : "reason=clear",
"channell": "Rules",
"call" : "onPostRequest"
};
postRequest (arg);
/**
* callback function for postRequest function
* @param res - result in string format
*/
function onPostRequest(res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": {
"status": "OK",
"message": "Response message from server"
}
}saveAuthentication (Android, Windows, iOS) #
Stores a username and password in the application’s authentication holder for use in subsequent REST requests. The validity period of the stored authentication can be configured in the application settings.
If the function is called with empty credentials, all previously stored authentication data and cookies are cleared. This effectively performs a logout, with an optional logout request sent to the server.
The logout request is sent only if the channel parameter is specified. Logout is performed using an HTTP GET request, where the logout URL is derived from the channel’s configured login URL by replacing the login path segment with logout.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if user name and password are successfully stored, false otherwise
*/
function saveAuthentication (arg);Parameter description :
| Name | Required | Format | Description |
|---|---|---|---|
| channel | true | string | Channel to logout. |
| user | true | string | User name to remember , empty for logout |
| password | true | string | Password to remember, empty for logout |
Example :
const arg = {
"channel" : "MyRestDocuments",
"user" : "wiki",
"password": "secret"
};
saveAuthentication (arg);isAuthentication (Android, Windows, iOS) #
Checks if the authentication stored with the ‘saveAuthentication’ function is valid.
/**
* @param {Object} arg- Parameter Empty JSON object.
* @returns {boolean} - Returns true if authentication is valid. false if the authentication does not exist, or has expired.
*/
function isAuthentication (arg);Example :
isAuthentication({});