Jump to content
Changes to the Jaspersoft community edition download ×

Error when importing report via REST


tom.beckman

Recommended Posts

Hello,

Running jasperserver 8.02

We can import/export reports without any issue from the Jasper UI, but when trying to publish/import via the REST API we are receiving the error message "import.decode.failed" when checking the status of the job.

We have tried doing the export from the UI with both options on the "Import-Export Key" fields ("Server Key" and "Legacy Key") during the export to no avail. Same message about decoding failing.

There are no custom keys created at this point, so I am at a bit of a loss as to what to use for the REST calls to publish correctly. I've looked at the Jasper docs, and they don't include any example references related to Keys.  Only a generic HTML form example at the bottom of this import/export page...no reference to using encoding.

I'm sure it is something simple that we're missing, so any help is greatly appreciated.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

You should be using the keyalias=deprecatedImportExportEncSecret argument in your RestAPI import/export to exchange resources from different instances with different keystore using RestAPI. See documentation here 

This is an example : 

curl --location --request POST 'http://localhost:8080/jasperserver/rest_v2/import?keyalias=deprecatedImportExportEncSecret' --header 'Accept: application/json' --header 'Content-Type: application/zip' --header 'Authorization: Basic ckljsqdlkjlkqsjd2lkqjscg==' --header 'Cookie: userLocale=en_US; JSESSIONID=10CD33082811F8778C8533F00B0FF405' --form 'file=@"/C:/export.zip"'

 

Link to comment
Share on other sites

Thank you for that info...I was able to get the reports exported from one server into another using the /buildomatic/ scripts with that keyalias, but I am still unable to perform the import using the REST api.

 

I created the same headers/payload that you gave in the example, but every time I check the status of the import process, I get the "import.decode.failed" message.

 

any suggestions?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...