Export Generic Action#

Action

export (instance)

Task

Get a selected [export_format] of the schema and a single instance with [pkid] of <resource_type>/<resource_name>; optionally with tag_version at [version] and Configuration Template as [configtemplate].

Call

GET

URL

/api/<resource_type>/<resource_name>/export/[pkid]/

Parameters

hierarchy=[hierarchy], version=[version], export_format=[raw_xlsx|xlsx|json], schema=, schema_rules=, template_name=[configtemplate]

Response

The response is an attachment: a compressed zip of the JSON file

support_async

false

Class

export

For export_format=raw_xlsx, the response is a “raw” MS Excel spreadsheet with columns corresponding to the JSON format export and response format:

Content-Disposition: attachment;
  filename=<resource_type>_<resource_name>_exportedsheet_CCYY-MM-DD_HH-MM-SS.xlsx
Content-Language:en
Content-Type:
  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

For export_format=xlsx, the response is a MS Excel spreadsheet, formatted to show all columns and response format:

Content-Disposition: attachment;
  filename=<resource_type>_<resource_name>_exportedsheet_formatted_CCYY-MM-DD_HH-MM-SS.xlsx
Content-Language:en
Content-Type:
  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

For export_format=json, the response is a time stamped zip file of data in JSON and a response format:

Content-Disposition: attachment;
  filename=export_CCYY-MM-DD_HH:MM:SS.MS.json.zip
Content-Language:en
Content-Type:application/x-zip

The XLSX format can be used to bulk load instances of the resource and the JSON format can be used to import instances of the resource.

Action

Bulk Export

Title

Get a selected [export_format] the schema and instances [pkid1], [pkid2],… of the resource; optionally with tag_version at [version] and Configuration Template as [configtemplate].

Method

POST

URL

/api/<resource_type>/<resource_name>/export/

Parameters

hierarchy=[hierarchy], version=[version], export_format=[raw_xlsx|xlsx|json], schema=, schema_rules=, template_name=[configtemplate]

Payload

{“hrefs”: [“/api/<resource_type>/<resource_name>/[pkid1]”, “/api/<resource_type>/<resource_name>/[pkid2]”, …]}

support_async

true

Class

export

For export_format=raw_xlsx, the response is a MS Excel spreadsheet and response format:

Content-Disposition: attachment;
  filename=<resource_type>_<resource_name>_exportedsheet_CCYY-MM-DD_HH-MM-SS.xlsx
Content-Language:en
Content-Type:
  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

For export_format=xlsx, the response is a MS Excel spreadsheet and response format:

Content-Disposition: attachment;
  filename=<resource_type>_<resource_name>_exportedsheet_formatted_CCYY-MM-DD_HH-MM-SS.xlsx
Content-Language:en
Content-Type:
  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

For export_format=json, the response is a time stamped export zip file and a response format:

Content-Disposition: attachment;
  filename=export_CCYY-MM-DD_HH:MM:SS.MS.json.zip
Content-Language:en
Content-Type:application/x-zip

The XLSX format can be used to bulk load instances of the resource and the JSON format can be used to import instances of the resource.

To get the list of all instance pkids [pkid1],[pkid2], …, use the List action of the resource:

GET http://<server_address>/api/<resource_type>/<resource_name>/
  ?hierarchy=sys