This may happen if you aren't maintaining a session - your request to generate the report stores the report in the session, but your next request is a different session and so it cannot find the report. You must use the login method to authenticate, and retreive the cookie sent with the response, and make sure to include it in all future requests. This will persist your session and your report identifier will be valid.