Skip to main content

How to build a job using the REST API and cURL?

Comments

8 comments

  • Gus Reiber

    Very helpful. Thx.

    0
  • Miruna Popescu

    Hi,

    Is there any way to remotely build a job using the REST API and to add a custom header in the request? Before the build starts to verify this header and to continue or fail the build according to the value of the header?

    Thanks

    1
  • Denys Digtiar

    Hi Miruna,

    What are you trying to achieve by this?

    Build Parameter support are explained. The endpoint requires authentication and, if enabled, the CSRF token. Therefore, I am not sure what other problem you are trying to solve.

    0
  • Self Learning

    Hi,

    this works fine when we use plain (Without @, _, .) username.

    When use email id as username, it is not working

    any suggestions?

     

    0
  • Denys Digtiar

    You can pass the authentication parameter using the curl's `--user` argument instead of embedding it into the URL, e.g. `--user developer:apiToken` or `--user developer` to get a password prompt see curl documentation for more details.

    1
  • Nagesh Vishtamsetty

    How can I trigger a release build of a project, using cURL approach?

    0
  • Alberto Martín

    I'm trying to achieve the same as Miruna.

    The thing is that, I need to trigger a build using the remote access API but, before starting the build, I need to verify that one of the parameters is the needed one and its value matches what I need. If not, I don't want to trigger the build. Is there a way to achieve this? Can I achieve this somehow configuring and/or defining parameters? 

    0
  • Tomas Bjerre

    The Generic Webhook Trigger Plugin can parse any JSON and contribute variables from it to the build.

    0

Please sign in to leave a comment.

About CloudBees Support

Our Support Engineers are available to help with any questions or problems you may have with any of our products.