Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Rw ui textbox macro
typetip

Example - Get data sets

Code Block
languagebash
$ curl -u user:passw \
http://localhost:9000/api/v1/rowset/0? \
sessionid=vusncl88sjghv7h8nkb0ohja6t

Get Status

Resource path: /status?sessionid=<session id>

HTTP method: GET

This operation returns a status message. It can be used to retrieve active processes and to query the number of available rows, data sets and status of imports and exports. If Last Update feature is enabled, the values stored in the most recent Last Update user and timestamp column will be retrieved as well.

info
Note

Note!

The status is used by the Web UI to lock the interface during an active process. This prevents a user from initiating another operation before the first operation initiated is complete. However, Abort process can be used before an operation is complete. 

Resource path

/status?sessionid=<session id>

HTTP method

GET

Rw ui textbox macro
typetip

Example - Get status

Code Block
languagebash
$ curl -u user:passw \
http://localhost:9000/api/v1/status? \
sessionid=vusncl88sjghv7h8nkb0ohja6t   

Abort process

This operation request the active process to abort.

Resource path

...

/status/abort?sessionid=<session id>

HTTP method

...

This operation request the active process to abort.

...

Example - Abort process

...

GET

Rw ui textbox macro
typetip

Example - Get status

Code Block
languagebash
$ curl -u user:passw \
http://localhost:9000/api/v1/status/abort? \
sessionid=vusncl88sjghv7h8nkb0ohja6t

...

This operation performs a database table export. Input parameters are passed in a JSON format as part of the HTTP message body as a APPLICATION_FORM_URLENCODED string. 

Parameters

Description

Value

Resource path

The path to where the resource is located

/refdatas/<Reference Data profile>/table/<table name>/download?sessionid=<sessionid> 

HTTP method

The HTTP method of the export command.

POST

Basic Auth

This is a required parameter which contains the  username and password. 

user:passw

Body

This is where the exportParams will be included in url encoding. The exportParams format will include these optional options:

  1. opts

    1. textQualifier - designated as double quotes by default.

    2. separator - designated as a comma by default.

    3. extent - designated as all by default.

  2. selectedColumns - allows for specific columns to be selected.

Example format: exportParams={"opts":{"textQualifier":"\'","separator":";","extent":"all"},"selectedColumns":["COLUMN1","COLUMN2"]}

exportParams=%7B%22opts%22%3A%7B%22textQualifier%22%3A%22%5C'\''%22%2C%22separator%22%3A%22%3B%22%2C%22extent%22%3A%22all%22%7D%2C%22selectedColumns%22%3A%5B%22CITY%22%2C%22CUSTOMER_NAME%22%5D%7D

Inforw-ui-textbox-macro
typetip

Example - Table export without options

Code Block
languagebash
## exportParams={}

curl -X POST \
'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/download?sessionid=p3hce86dkb4rmls9peh4e8rps9' \
-u "user:passw" \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'exportParams=%7B%7D' \
> Export.csv
Info
Example - Table export
Rw ui textbox macro
typetip

Example - Table export with options

Code Block
languagebash
## exportParams={"opts":{"textQualifier":"\'","separator":";","extent":"all"},"selectedColumns":["CITY","CUSTOMER_NAME"]}

curl -X POST \
  'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/download?sessionid=p3hce86dkb4rmls9peh4e8rps9' \
  -u "user:passw" \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'exportParams=%7B%22opts%22%3A%7B%22textQualifier%22%3A%22%5C'\''%22%2C%22separator%22%3A%22%3B%22%2C%22extent%22%3A%22all%22%7D%2C%22selectedColumns%22%3A%5B%22CITY%22%2C%22CUSTOMER_NAME%22%5D%7D'
> Export.csv

...

This operation performs a database table import. Input parameters are passed in a JSON format as part of the HTTP message body.

Parameters

Description

Value

Resource path

The path to where the resource is located

/refdatas/<Reference Data profile>/table/<table name>/upload?sessionid=<sessionid> 

HTTP method

The HTTP method of the import command.

POST

Basic Auth

This is a required parameter which contains the  username and password. 

user:passw

File Input

This is where the file input will be included in url encoding. The exportParams format will include these optional opts:

  1. textQualifier - designated as double quotes by default.

  2. separator - designated as a comma by default.

  3. append/truncate - designated as append by default. Changing to truncate will result in the existing data in the table to be truncated before the import is executed.

  4. force - designated as false by default.

Example format: file=@/<path to csv file>/test.csv 'opts={"textQualifier":"\'","separator":",","op":"append","force":false}'

file=@/path/to/import_test.csv 'opts={"textQualifier":"\'","separator":",","op":"append","force":false}'

...

info
Rw ui textbox macro
typetip

Example - Table import without options

Code Block
languagebash
curl -i -u "user:passw" \
  'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/upload?sessionid=rssrh20dcd8lc1j505b3bqnstc' \
  -F file=@/path/to/import_test.csv

Rw ui textbox macro
typetip

Example - Table import with options

Code Block
languagebash
curl -i -u "user:passw" \
  'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/upload?sessionid=p3hce86dkb4rmls9peh4e8rps9' \
  -F file=@/path/to/import_test.csv \
  -F 'opts={"textQualifier":"\'","separator":",","op":"truncate","force":false}'

Save Changes

Resource path: /save?sessionid=<session id> 

HTTP method: PUT

This operation saves data grid edit This operation saves data grid edit modification (post insert/update/delete). Changes are saved within client session. This operation requires JSON payload as input.

...

info
Note

Note!

The save operation is supported either on Oracle (based on ROWID pseudo column) or non-Oracle type tables containing Primary Key constraint. Non-Oracle tables without a Primary Key are not supported for data modifications. 

Resource path

/save?sessionid=<session id> 

HTTP method

PUT

Rw ui textbox macro
typetip

Example - Save changes

Code Block
languagebash
$ curl -X PUT -T="example.json" \
http://user:passw@localhost:9000/api/v1/save? \
sessionid=vusncl88sjghv7h8nkb0ohja6t

example.json:

Code Block
Rw ui textbox macro
typetip

Example json

Code Block
languagejson
{
	"dataEdit": {
		"refProfile": "Default.refTest",
		"tableName": "MZADMIN.REFRENCE_DATA",
		"updates": [{
			"action": "insert",
			"values": [{
				"column": "ID",
				"value": 645
			}, {
				"column": "FIRSTNAME",
				"value": "Roberts"
			}, {
				"column": "LASTNAME",
				"value": "Polis"
			}]
		}]
	}
}

Commit Changes

...

HTTP method: GET

This operation applies saved edits in the database and commits the work in case of success. You can use "force" commit in case of errors. 

...

Example - Commit changes

...

Resource path

/save/commit?force=<true|false>&sessionid=<session id> 

HTTP method

GET

Rw ui textbox macro
typetip

Example - Commit changes

Code Block
languagebash
$ curl -u user:passw \
http://localhost:9000/api/v1/commit? \
force=false&sessionid=vusncl88sjghv7h8nkb0ohja6t

List Changes

Resource path: /save/list?sessionid=<session id>

HTTP method: GET

This operation returns a list of the modifications saved. You can use this operation to reapply changes in the Web UI during a grid refresh.

...

Resource path

/save/list?sessionid=<session id>

HTTP method

GET

Rw ui textbox macro
typetip

Example -

List

Commit changes

Code Block
languagebash
$ curl -u user:passw \
http://localhost:9000/api/v1/save/list?
\sessionid=vusncl88sjghv7h8nkb0ohja6t

Cancel Changes

...

v1/save/

...

list?
\sessionid=

...

vusncl88sjghv7h8nkb0ohja6t

Cancel Changes

This operation cancels the changes made from being saved. As the input, Json payload specifies either all the changes to be canceled or lists the selected Primary Keys to be cancelled. You can cancel the saving of several changes at the same time (one Primary Key per change). The scope is single or all. The format is the same as for the Save changes operation but the ID fields are stored in a root structure. Ids are in a JSON array to hold multiple Primary Keys to be cancelled.

!

The Web UI generates surrogate Primary Keys for inserted rows for the cancel function. 

Note

Note!

The Web UI generates surrogate Primary Keys for inserted rows for the cancel function. 

Info

Example - Cancel changes

Code Block

Resource path

/save/cancel?sessionid=<session id>

HTTP method

PUT

Rw ui textbox macro
typetip

Example - Commit changes

Code Block
languagebash
$ curl -u user:passw \
http://localhost:9000/api/v1/save/cancel? \
sessionid=vusncl88sjghv7h8nkb0ohja6t 

example.json:

code
Rw ui textbox macro
typetip

Example json

Code Block
languagejson
{
	"dataEdit": {
		"scope": "single",
		"ids": [{
			"id": [{
				"column": "ORDER_NUM",
				"value": 10398005
			}]
		}]
	}
}}
Rw ui textbox macro
typetip

Example response

:

Code Block
languagejson
{
	"dataEdit": {
		"updates": [{
			"action": "update",
			"ids": [{
				"column": "ORDER_NUM",
				"value": 10398005
			}],
			"undoRow": [{
					"column": "SHIPPING_DATE",
					"value": "2011 - 05 - 24 00: 00: 00"
				},
				{
					"column": "ORDER_NUM",
					"value": 10398005
				},
				{
					"column": "QUANTITY",
					"value": 100
				}
			],
			"values": [{
				"column": "FREIGHT_COMPANY",
				"value": "Zagreb"
			}],
			"SaveSize": 3
		}]
	}
}

Note

Note!

SaveSize indicates the number of changes remaining. 

Show Demo Query

Resource path: /demo/queryRequestParameters

...

This operation shows the json payload format that applies for a query operation e g , such as rowset/. 

...

Resource path

...

/demo/

...

queryRequestParameters

HTTP method

...

GET

Show Demo Changes

This operation shows the json payload format that applies to edit data via the Web UI e g , such as save/commit. 

Resource path

/demo/dataEditRequestParameters

HTTP method

GET