Skip to main content
Skip table of contents

SysBridge API - Calls

File System

Performing file system operations

ListFiles

ListFiles

Return all files in the given directory.

Params

Key

Type

Default

Description

Path

STRING

-

Absolute path of the directory

Recursive

BOOLEAN OPTIONAL

false

Should include directories in the given path.

Examples

Example 1 - Success Response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "ListFiles",
    "ID": "1"
}
{
    "Params": {
        "Path": "C:\\Pixotope"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": [
            {
                "Path": "C:\\Pixotope\\0.0.0-7150\\Services\\DirectorServices\\_PX_SysBridge.exe",
                "Name": "_PX_SysBridge.exe"
            }
        ]
    }
}
Example 2 - Error Response

Request can be failed for multiple reasons that can be determined from the returned error response.

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "ListFiles",
    "ID": "1"
}
{
    "Params": {
        "Path": "C:\\Pixotope\\INVALID_DIR"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "ERROR",
        "Message": "DirectoryDoesNotExist"
    }
}
FileExist

FileExist

Given path, check if the path exists and resolves to a file.

Params

Key

Type

Default

Description

Path

STRING

-

Absolute path of the file

Examples

Example 1 - Success Response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "FileExist",
    "ID": "1"
}
{
    "Params": {
        "Path": "C:\\Pixotope\\example.txt"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": true // file exist on file system
    }
}
DirExist

DirExist

Given path, check if the path exists and resolves to a directory.

Params

Key

Type

Default

Description

Path

STRING

-

Absolute path of the directory

Examples

Example 1 - Success Response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "DirExist",
    "ID": "1"
}
{
    "Params": {
        "Path": "C:\\Pixotope"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": true // directory exist on file system
    }
}
IsDirEmpty

IsDirEmpty

Given path, check if the path resolves to an empty directory

Params

Key

Type

Default

Description

Path

STRING

-

Absolute path of the directory

Examples

Example 1 - Success Response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "IsDirEmpty",
    "ID": "1"
}
{
    "Params": {
        "Path": "C:\\Pixotope"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": false // directory is not empty
    }
}
CreateDir

CreateDir

Given path, check if the path resolves to an empty directory

Params

Key

Type

Default

Description

Path

STRING

-

Absolute path of the directory to create

Examples

Example 1 - Success Response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "IsDirEmpty",
    "ID": "1"
}
{
    "Params": {
        "Path": "C:\\Pixotope\\MyNewDir"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": false // directory was created successfully
    }
}
MoveDir

MoveDir

Move directories on the file system.

Params

Key

Type

Default

Description

Source

STRING

-

Absolute path of the source directory

Destination

STRING

-

Absolute path to the destination. Destination directory should already exist to avoid error response or include CreateDestination: true

CreateDestination

BOOLEAN OPTIONAL

false

Weather to create the destination folder if does not exist already.

Recursive

BOOLEAN OPTIONAL

false

By default, only files are moved from Source to Destination folder. To include subdirectories, pass this param as true

Mode

STRING OPTIONAL

Copy

Options: Move , Copy

By default, directory is copies to destination. To permanently move source to destination, pass this parameter as Move

Examples

Example 1 - Success Response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "MoveDir",
    "ID": "1"
}
{
    "Params": {
        "Srouce": "C:\\Pixotope\\PathTo\\MySourceDirectory",
        "Destination": "C:\\Pixotope\\PathTo\\MyDestination\\Directory"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": true // move was successful
    }
}
MoveFiles

Moves

Move files from one folder to another.

Params

Params for this request can be passed in any of the given tow formats.

Key

Type

Default

Description

Files

STRING ARRAY

-

Absolute path of the files

Destination

STRING

-

Absolute path to the destination. Destination directory should already exist to avoid error response or include CreateDestination: true

CreateDestination

BOOLEAN OPTIONAL

false

Weather to create the destination folder if does not exist already.

IgnoreMissing

BOOLEAN OPTIONAL

false

By default, an error response will be returned if any of the files in Files array does not exist. To prevent this error, pass this param as true

Mode

STRING OPTIONAL

Copy

Options: Move , Copy

Weather to copy or move permanently.

Key

Type

Default

Description

Files

JSON
{  
  Folder: ,// Path To Folder
  Files: // Array of file names within the `Folder`
}[]

-

-

Destination

STRING

-

Absolute path to the destination. Destination directory should already exist to avoid error response or include CreateDestination: true

CreateDestination

BOOLEAN OPTIONAL

false

Weather to create the destination folder if does not exist already.

IgnoreMissing

BOOLEAN OPTIONAL

false

By default, an error response will be returned if any of the files in Files array does not exist. To prevent this error, pass this param as true

Mode

STRING OPTIONAL

Copy

Options: Move , Copy

Weather to copy or move permanently.

Examples

Example 1 - Params payload format 1

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "MoveDir",
    "ID": "1"
}
{
    "Params": {
        "File": [
          "C:\\Pixotope\\PathTo\\MySourceDirectory\\a.txt",
          "C:\\Pixotope\\PathTo\\MySourceDirectory\\b.txt"
        ],
        "Destination": "C:\\Pixotope\\PathTo\\MyDestination\\MoveFilesHere"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": true // move was successful
    }
}
Example 1 - Params payload format 2

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "MoveDir",
    "ID": "1"
}
{
    "Params": {
      "Files": [
            "Files": [
              "a.txt",
              "b.txt"
            ],
            "Folder": "C:\\Pixotope\\PathTo\\MySourceDirectory"
      ],
      "Destination": "C:\\Pixotope\\PathTo\\MyDestination\\MoveFilesHere"
    }
}

CallResult

JSON
{
    "Result": {
        "Status": "OK",
        "Data": true // move was successful
    }
}

System Dialog API

The System Dialog API provides endpoints for interacting with system-level dialogs, such as file selection, folder selection, and save file dialogs.

AskFileSelection

AskFileSelection

Opens a file selection dialog and returns the selected file(s).

Payload

TYPESCRIPT
{
  "Filter": [
    {
      "Name": string,
      "Extensions": string[]
    }
  ],
  "Title": string,
  "Directory": string,
  "CaptureWindowAsParent": boolean,
  "Multiple": boolean
}

Field Descriptions

Field

Type

Default

Description

Filter

ARRAY OPTIONAL

All file types/extension can be selected

The filters to limit user to only select files of specified type

Title

STRING OPTIONAL

Choose file

The title of the file dialog.

Directory

STRING OPTIONAL

-

The initial directory to open the file dialog in.

CaptureWindowAsParent

BOOLEAN OPTIONAL

false

Whether to capture the current window as the parent of the dialog.

Multiple

BOOLEAN OPTIONAL

false

Whether to allow multiple file selection.

Response

Example 1 - Success response single selectoin

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "AskFileSelection",
    "ID": "1"
}
{
    "Params": {
        "Filter": [
            {
                "Name": "Text Files",
                "Extensions": ["txt", "md"]
            }
        ],
        "Title": "Select a file",
        "Directory": "C:\\Users\\Documents",
        "CaptureWindowAsParent": true,
        "Multiple": false
    }
}

CallResult

JSON
{
    "ExecutedOn": "SERVICE_NAME",
    "ID": "1",
    "Method": "AskFileSelection",
    "Target": "Explorer",
    "Result": {
        "Status": "OK",
        "Data": ["C:\\Users\\Documents\\example.txt"] // only one path in array
    }
}
Example 2 - Success response multiple selections

Call (you send)

JSON
Topic: {
    // ...
}
{
    "Params": {
        // ...
        "Multiple": true
    }
}

CallResult

JSON
{
    "ExecutedOn": "SERVICE_NAME",
    "ID": "1",
    "Method": "AskFileSelection",
    "Target": "Explorer",
    "Result": {
        "Status": "OK",
        "Data": [
            "C:\\Users\\Pictures\\image1.png",
            "C:\\Users\\Pictures\\image2.jpg",
            "C:\\Users\\Pictures\\image3.jpeg"
        ]
    }
}
Example 3 - Failure response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "AB-SysBridge",
    "RespondTo": "AB-Director",
    "Method": "AskFileSelection",
    "ID": "1"
}
{
    "Params": {
        "Directory": "C:\\Pixotope\\24.3.0-7329"
    }
}

CallResult

JSON
Topic: {
    "Type": "CallResult",
    "Target": "AB-Director",
    "ExecutedOn": "AB-SysBridge",
    "Method": "AskFileSelection",
    "ID": "92951333-da33-4a3e-add5-ff6833f0f26b"
}
{
    "Result": {
        "Status": "ERROR",
        "Message": "Cancelled" // Explains what went wrong
    }
}
AskFolderSelection

AskFolderSelection

Opens a folder selection dialog and returns the selected folder(s).

Payload

TYPESCRIPT
{
  "Title": string,
  "Directory": string,
  "CaptureWindowAsParent": boolean,
  "Multiple": boolean
}

Field Descriptions

Field

Type

Default

Description

Title

STRING OPTIONAL

Choose folder

The title of the file dialog.

Directory

STRING OPTIONAL

-

The initial directory to open the file dialog in.

CaptureWindowAsParent

BOOLEAN OPTIONAL

false

Whether to capture the current window as the parent of the dialog.

Multiple

BOOLEAN OPTIONAL

false

Whether to allow multiple file selection.

Response

Example 1 - Success response single selectoin

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "AskFolderSelection",
    "ID": "1"
}
{
    "Params": {
        "Title": "Select a folder",
        "Directory": "C:\\Users",
        "CaptureWindowAsParent": true,
        "Multiple": false
    }
}

CallResult

JSON
{
    "ExecutedOn": "SERVICE_NAME",
    "ID": "1",
    "Method": "AskFolderSelection",
    "Target": "Explorer",
    "Result": {
        "Status": "OK",
        "Data": ["C:\\Users\\Documents"] // only one path in array
    }
}
Example 2 - Success response multiple selections

Call (you send)

JSON
Topic: {
    // ...
}
{
    "Params": {
        // ...
        "Multiple": true
    }
}

CallResult

JSON
{
    "ExecutedOn": "SERVICE_NAME",
    "ID": "1",
    "Method": "AskFolderSelection",
    "Target": "Explorer",
    "Result": {
        "Status": "OK",
        "Data": [
            "C:\\Users\\Documents",
            "C:\\Users\\Pictures",
            "C:\\Users\\Music"
        ]
    }
}
Example 3 - Failure response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "AB-SysBridge",
    "RespondTo": "AB-Director",
    "Method": "AskFileSelection",
    "ID": "1"
}
{
    "Params": {
        "Directory": "C:\\Pixotope\\24.3.0-7329"
    }
}

CallResult

JSON
Topic: {
    "Type": "CallResult",
    "Target": "AB-Director",
    "ExecutedOn": "AB-SysBridge",
    "Method": "AskFileSelection",
    "ID": "92951333-da33-4a3e-add5-ff6833f0f26b"
}
{
    "Result": {
        "Status": "ERROR",
        "Message": "Cancelled" // Explains what went wrong
    }
}
AskSaveFile

AskSaveFile

Opens a save file dialog and returns the selected save path.

Payload

TYPESCRIPT
{
  "Title": string,
  "Directory": string,
  "Filters": [
    {
      "Name": string,
      "Extensions": string[]
    }
  ],
  "FileName": string,
  "CaptureWindowAsParent": boolean
}

Field Descriptions

Field

Type

Default

Description

Title

STRING OPTIONAL

Choose folder

The title of the file dialog.

Directory

STRING OPTIONAL

-

The initial directory to open the file dialog in.

FileName

STRING OPTIONAL

""

Default filled file name

Filters

ARRAY OPTIONAL

All

The filters to limit user to only save files of specified type.

NOTE: If no filter is provided and FileName does not include and extension, user will have to explicitly define file extension.

HINT: Provide one filter or pass FileName with extension in Params

CaptureWindowAsParent

BOOLEAN OPTIONAL

false

Whether to capture the current window as the parent of the dialog.

Multiple

BOOLEAN OPTIONAL

false

Whether to allow multiple file selection.

Response

Example 1 - Success response

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "AskSaveFile",
    "ID": "1"
}
{
    "Params": {
        "Title": "Save your document",
        "Directory": "C:\\Users\\Documents",
        "Filters": [
            {
                "Name": "Text Files",
                "Extensions": ["txt"]
            }
        ],
        "FileName": "mydocument.txt",
        "CaptureWindowAsParent": true
    }
}

CallResult

JSON
{
    "ExecutedOn": "MyMachine-SysBridge",
    "ID": "1",
    "Method": "AskSaveFile",
    "Target": "Explorer",
    "Result": {
        "Status": "OK",
        "Data": "C:\\Users\\Documents\\mydocument.txt"
    }
}
Example 2 - Cancel

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "AB-SysBridge",
    "RespondTo": "AB-Director",
    "Method": "AskFileSelection",
    "ID": "1"
}
{
    "Params": {
        "Directory": "C:\\Pixotope\\24.3.0-7329"
    }
}

CallResult

JSON
Topic: {
    "Type": "CallResult",
    "Target": "AB-Director",
    "ExecutedOn": "AB-SysBridge",
    "Method": "AskFileSelection",
    "ID": "1"
}
{
    "Result": {
        "Status": "Success",
        "Data": null // operation was cancelled
    }
}
RevealPath

RevealPath

Reveals a file or folder in the system's file explorer.

Payload

TYPESCRIPT
{
  "Path": string
}

Field Descriptions

Field

Type

Default

Description

Path

STRING

REQUIRED

The absolute path of the file or folder to reveal.

Response

Example 1 - Success

Call (you send)

JSON
Topic: {
    "Type": "Call",
    "Target": "MyMachine-SysBridge",
    "RespondTo": "Explorer",
    "Method": "RevealPath",
    "ID": "1"
}
{
    "Params": {
        "Path": "C:\\Users\\Documents\\example.txt"
    }
}

CallResult

JSON
{
    "ExecutedOn": "SERVICE_NAME",
    "ID": "1",
    "Method": "RevealPath",
    "Target": "Explorer",
    "Result": {
        "Status": "OK",
        "Data": true // Reveal was successful
    }
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.