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
    }
}
JavaScript errors detected

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

If this problem persists, please contact our support.