Jump to content
Changes to the Jaspersoft community edition download ×

How to determine "Version" of existing report when using REST API

Go to solution Solved by tomhardypants,

Recommended Posts

When trying to update a file resource on the jasper server using the endpoints described here: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v710/working-file-resources#Updating_File_Resources it requires a "version" of the report in order to update it and if you don't have it you will get an error back. I tried using the "overwrite" option but it still requires the version. Is there a way to get the version of a file on the server through the REST API? If so which endpoint, and where in the returned data can I find it?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

Hopefully this helps someone in the future. If you use this endpoint: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v710/resources-service#Searching_the_Repository it will return the attributes of the file, including the version of the existing file. The problem is that it's a search endpoint so you have to be really specific about the file that you are wanting otherwise it will return a list of files. Use fileUri= and q= options to pinpoint to the exact file you want info for.

Note that this endpoint: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v710/resources-service#Viewing_Resource_Details Will return the object that you uploaded. Which, in my experience, if the file is a jrxml file it will return the actual jrxml file and it doesn't actually include the attributes of the file on the server (which is where the version is at).

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...