title: Jasper Rest API, run a report
body: <p>I am currently trying to run a report thanks to Jasper Rest API and get the output (PDF), the interessant part of the doc is <a href="http://www.scribd.com/doc/68405255/2/REST-Web-Services#page=30" rel="nofollow"><strong>here</strong></a></p>
  
  <p>So I tried this : <code>http://localhost:8080/jasperserver/rest/report/reports/samples/report_mongodb_new_basic</code></p>
  
  <p>Knowing that my report is in reports/samples and its Resource ID is : <code>report_mongodb_new_basic</code></p>
  
  <p>So I still tried to run it with nodejs here is my code :
  (request is a nodejs module available <a href="https://github.com/mikeal/request" rel="nofollow">here</a> )</p>
  
  <p>Login :</p>
  
  <pre><code>var request = require("request");   
  request.post({url: "http://localhost:8080/jasperserver/rest/login", 
  qs: {j_username: "jasperadmin", j_password: "jasperadmin"}},
  function(err, res, body) {
      if(err) {
          return console.error(err);
      }
  </code></pre>
  
  <p>After login, as the doc show I need to do a PUT request to run the report :</p>
  
  <pre><code>     request.put("http://localhost:8080/jasperserver/rest
       /report/reports/samples/report_mongodb_new_basic")
  </code></pre>
  
  <p>This isn't working of course, even when i directly go on this url with
  <em>Firefox</em>, it say </p>
  
  <pre><code>"Report not found (uuid not found in session)"
  </code></pre>
  
  <p>The uuid should be created thanks to this PUT request</p>
  
  <p>So what is the good syntax of the URL and the good syntax of a PUT request to get the <strong>uuid</strong> and after if possible the pdf with a get?</p>