The v2/import Service

Use the following service to upload a catalog as a zip file and import it with the given options. Specify options as arguments in the format <argument>=true. Arguments that are omitted are assumed to be false. You must be authenticated as the system admin (superuser) for the import service.

Jaspersoft does not recommend uploading files greater than 2 gigabytes.

Method

URL

POST

http://<host>:<port>/jasperserver[-pro]/rest_v2/import?<arguments>

Argument

Value

Description

update?

true

Resources in the catalog replace those in the repository if their URIs and types match.

skipUserUpdate?

true

When used with update=true, users in the catalog are not imported or updated. Use this option to import catalogs without overwriting currently defined users.

includeAccess
Events?

true

Restores the date, time, and user name of last modification if they are included in the catalog to import.

includeAudit
Events?

true

Imports audit events if they are included in the catalog.

includeMonitoring
Events?

true

Imports audit events if they are included in the catalog.

includeServer
Setting?

true

Imports server settings if they are included in the catalog.

Content-Type

Content

application/zip

The catalog file to import.

Return Value on Success

Typical Return Values on Failure

200 OK – Returns a JSON object that indicates the import was a success.

401 Unauthorized – Import is available only to the system admin user (superuser).

The body of the response contains the ID of the import operation needed to check its status:

<state>
    <id>2cc871ee-4645-4be0-b5b4-7d7c45c561cb</id>
    <message>Import in progress.</message>
    <phase>inprogress</phase>
</state>

To check the status of the import, use its ID in the following method:

Method

URL

GET

http://<host>:<port>/jasperserver[-pro]/rest_v2/import/<import-id>/state

Return Value on Success

Typical Return Values on Failure

200 OK – The body of the response gives the current state of the export operation.

404 Not Found – When the specified import ID is not found.

Feedback
randomness