File Tools
Open a database file (sqlite), run a query, and return the results. If sql and table are not provided, this will return all rows from all tables in the database.
optional id to track this command, will be returned in the response
Full file path. Also see openFileDialog.
If provided, will return the full content of the table using the same parsing as used by getFileContent.
SQL query to run against the database.
successful operation
bad request
GET /api/command/runDbQuery HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "getFileContent",
"reply": "getFileContent",
"success": false
}
}Takes a supplied string of structured data (xml, csv, other json) and converts it to a JSON object..
optional id to track this command, will be returned in the response
String contents that should be parsed and converted.
<item><child name="hello">world</child></item>type of the input string (xml, csv, json)
xmlboolean value, if true, the data will be flattened into 1 level deep simplified object of key-value pairs.
1successful operation
bad request
GET /api/command/convertToJson HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "convertToJson",
"json": {},
"reply": "convertToJson",
"success": true
}
}Download an image file from the Internet or parse it from a data url and save it to a local temporary file..
optional id to track this command, will be returned in the response
Optional: Full url to the image file
Optional: a "data url" construct like "data:image/jpeg;base64,BASE_64_DATA..."
successful operation
bad request
GET /api/command/downloadImage HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "downloadImage",
"reply": "downloadImage",
"success": true
}
}Encode an image file from the local filesystem into a data url.
Full path to the image file
successful operation
bad request
GET /api/command/encodeImage HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "encodeImage",
"reply": "encodeImage",
"success": true
}
}Gets a list of all entries in the specified directory..
optional id to track this command, will be returned in the response
Full file path. Also see openFileDialog.
successful operation
bad request
GET /api/command/getDirectoryContent HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "getDirectoryContent",
"directory": "",
"reply": "getDirectoryContent",
"success": true
}
}Read a file or url and return its data - especially useful when polling files for data..
optional id to track this command, will be returned in the response
Full file path. Also see openFileDialog.
Url to fetch.
Comma-separated string. Applies multiple parse methods to the data. Options: b64 (returns b64 encoded raw data), text (returns utf-8 encoded string), table (uses our csv, xml, json, Excel, db parser to extract tabular data), json (expects the file content to be XML or json, parses it, and returns a JavaScript object)
boolean value, if true, the data will be flattened into 1 level deep simplified object of key-value pairs.
successful operation
bad request
GET /api/command/getFileContent HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "getFileContent",
"reply": "getFileContent",
"success": true
}
}Open a file browser to select a directory and return its full path along with its file contents..
optional id to track this command, will be returned in the response
Message for the title bar
Select A DirectoryOptional, folder to search
successful operation
bad request
GET /api/command/openDirectoryDialog HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{}Open a file browser to select a file and return its full path..
optional id to track this command, will be returned in the response
Message for the title bar (does not work on all platforms)
Select A FileOptional, folder to search
File format to look for, ie 'Images (*.png *.jpg .jpeg);;XML files (.xml)'. Multiple patterns are separated by ';;'.
Images (*.png *.jpg *.jpeg);;XML files (*.xml)successful operation
bad request
GET /api/command/openFileDialog HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{}Open a url in the system browser..
optional id to track this command, will be returned in the response
Url to open
https://newbluefx.comsuccessful operation
bad request
GET /api/command/openUrl HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "openUrl",
"reply": "openUrl",
"success": true
}
}Write the supplied data to a file..
optional id to track this command, will be returned in the response
Data to write to the file
Full file path. If omitted, will trigger the save dialog to open.
Set to 1 if the content is binary data.
Optional, default name for the save dialog.
Optional, user context to pass back in the notification.
successful operation
bad request
GET /api/command/setFileContent HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
"result": {
"command": "setFileContent",
"error": "Content size is 0",
"reply": "setFileContent",
"setFileContentRequest": "SFCREQ_1",
"success": true,
"userContext": ""
}
}Last updated