title: jenkins pipeline - start a pipeline job with input parameter via url
body: <p>In the old freestyle project days we could simply start a build which had parameters like this:</p>
  
  <pre><code>    curl -X POST JENKINS_URL/job/JOB_NAME/build \
    --data token=TOKEN \
    --data-urlencode json='{"parameter": [{"name":"id", "value":"123"}]}'
  </code></pre>
  
  <p>This does not seem to work with pipeline input plugins</p>
  
  <p>With pipelines i can accomplish this with two steps:</p>
  
  <p>Submit a new job: </p>
  
  <pre><code>curl -X POST JENKINS_URL/job/JOB_NAME/build
  </code></pre>
  
  <p>And then submit the input parameter:</p>
  
  <pre><code>curl -X POST -d json='{"parameter": {"name": "id", "value": "123"}}' 
  JENKINS_URL/job/JOB_NAME/build/BUILD_NUMBER/input/INPUT_NAME/submit
  </code></pre>
  
  <p>But this looks cumbersome, plus i have to somehow retrieve the build_number after start, wait until job kicks in (pending time) and only then submit. And if there is a timeout on input, this complicates things even more.</p>
  
  <p>Can i somehow do this via single API call?</p>