Commandline API
Function
Receive commands to PaperOffice via CMD description
Description
PaperOffice accepts commands via the command line, automatically creates a POAPI-JSON file and executes the commands in it. The variables are identical to the structure of the POAPI-JSON.
Functionality
Run "C:\PaperOffice\com.paperoffice.launcher.exe" from the terminal with the desired argument parameters.
The argument structure is as follows: "main_command=command sub_command=value" and always starts with "useapi = 1"
Example:
useapi=1 command=open_document document_id=42
POJOB-JSON file
Alternatively, you can add the arguments to a JSON object file and save them under "shellpipe_filename.json" in the PaperOffice root installation folder.
PaperOffice monitors the internal folder for files with the filename "shellpipe_filename.json" and processes the API commands contained inside.
The argument "useapi=1" is not required in the json file.
Example:
{
"command":"open_document",
"document_id":42
}
Search
Usage:useapi=1 command=search searchfor="text to search"
| Command | Type | Description |
|---|---|---|
| search | String | Main command |
| searchfor | String | Sub command Text to search |
|
CMD Example: c:\>C:\PaperOffice\com.paperoffice.launcher.exe useapi=1 command=search searchfor="Invoice 12345"
|
||
JSON File Example:
{
"command":"search",
"searchfor":"Invoice 12345"
}
|
||
Open Document
There are two ways to open documents.-
By entering the document ID directly.
Usage:useapi=1 command=open_document document_id=IDCommand Type Description open_document String Main command document_id Integer Sub command Example: c:\>C:\PaperOffice\com.paperoffice.launcher.exe useapi=1 command=open_document document_id=42JSON File Example: { "command":"open_document", "document_id":42 } -
By searching for a specific field value.
Usage:useapi=1 command=open_document name=field_name value=text to searchBy opening a document via a search, the document will be opened from the first search hit!Advice: You can search for values by using the placeholder "%" together with the argument "querymode=LIKE":querymode=LIKE value="%text_to_search%"Command Type Description open_document String Main command name String Sub command
Field name to searchvalue String Text to search querymode=LIKE String Optional
Use when searching with "%" wildcardExample: c:\>C:\PaperOffice\com.paperoffice.launcher.exe useapi=1 command=open_document name=voucher_number querymode=LIKE value="3456%"JSON File Example: { "command":"open_document", "name":"voucher_number", "querymode":"LIKE", "value":"3456%" }
Opening folders
Usage:useapi=1 command=open_folder category_id=ID
| Command | Type | Description |
|---|---|---|
| open_folder | String | Main command |
| category_id | Integer | Sub command Folder ID to open |
|
Examplee: c:\>C:\PaperOffice\com.paperoffice.launcher.exe useapi=1 command=open_folder category_id=639
|
||
JSON File Examplee:
{
"command":"open_folder",
"category_id":639
}
|
||