Jenkins trigger a job from API
<p>I m actually trying to make some API calls to jenkins to trigger a build.</p>

<p>Actually, I m facing two problems :</p>

<p><strong>In a non-restricted</strong> environnement, where I don't need to be connected to trigger a job, I should send a POST request on :</p>

<pre><code>http://address/job/jobId/build?delay=0sec
</code></pre>

<p>When making this, I get the following output telling me that I don't have a token value :</p>

<pre><code>&lt;html&gt;

    &lt;head&gt;

        &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/&gt;

        &lt;title&gt;Error 401 Invalid password/token for user: &lt;/title&gt;

    &lt;/head&gt;

    &lt;body&gt;
        &lt;h2&gt;HTTP ERROR 401&lt;/h2&gt;

        &lt;p&gt;Problem accessing /job/Di%20Injector/build. Reason:

            &lt;pre&gt;    Invalid password/token for user: &lt;/pre&gt;
        &lt;/p&gt;
        &lt;hr /&gt;
        &lt;i&gt;
            &lt;small&gt;Powered by Jetty://&lt;/small&gt;
        &lt;/i&gt;
        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                

        &lt;br/&gt;                                                


    &lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p><em>Where could I get this information ?</em></p>

<p><strong>In a restricted</strong> environnement, I have to login before make any thing like getting job, or trigger new build. The fact is that I don't know, and I can't find the url / verb / params to send to the server to get an access right.</p>

<p>Can you help me with this too ?</p>