Skip to content
Concourse resource to allow interaction with (simple) HTTP API's.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Implement check according to spec. Sep 27, 2018
test Properly test check behaviour. Sep 27, 2018
.travis.yml travis build Feb 1, 2018
Dockerfile Fix test suite, asyncio module deprecation in 3.7 Sep 27, 2018
Dockerfile.tdd Allow recursive interpolation over lists. Jan 20, 2018 add license Jan 20, 2018
Makefile initial Feb 15, 2016 Update Sep 27, 2018
requirements.txt initial Feb 15, 2016
requirements_dev.txt Refactor testing, support posting urlencoded forms with json values (… Mar 10, 2016

HTTP API Resource

Concourse resource to allow interaction with (simple) HTTP (REST/JSON) API's. This resource is useful for API's which have simple one request interactions and will not be a one-size-fits-all solution. If your API is more complex writing your own resource.

Recent changes

  • 09-2018 Fix error on check (reporter: @OvermindDL1)
  • 02-2018 Fix build detail load (@scottasmith, reporter: @pranaysharmadelhi)
  • 02-2018 add support for UTF-8 in JSON (@masaki-takano)
  • 01-2018 fix concourse 3.1.1 compatibility (@hfinucane)
  • 01-2018 added license
  • 01-2017 recursive interpolate over lists as well

Source Configuration

Most of the source options can also be used in params for the specifc actions. This allows to use a different URL path. For example when a POST and GET use different endpoints.

Options set in params take precedence over options in source.

  • uri: Required. The URI to use for the requests. Example:

  • method: Optional Method to use, eg: GET, POST, PATCH (default GET).

  • headers: Optional Object containing headers to pass to the request. Example:

          X-Some-Header: some header content
  • json: Optional JSON to send along with the request, set application/json header.

  • debug: Optional Set debug logging of scripts, takes boolean (default false).

  • ssl_verify: Optional Boolean or SSL CA content (default true).

  • form_data: Optional Dictionary with form field/value pairs to send as data. Values are converted to JSON and URL-encoded.


Currently the only useful action the resource supports is out. The actions in and check will be added later.


All options support interpolation of variables by using Python string formatting.

In short it means variables can be used by using single curly brackets (instead of double for Concourse interpolation). Eg: Build nr. {BUILD_NAME} passed.

Build metadata (BUILD_NAME, BUILD_JOB_NAME, BUILD_PIPELINE_NAME and BUILD_ID) are available as well as the merged source/params objects. Interpolation will happen after merging the two objects.

Be aware that options containing interpolation variables need to be enclosed in double quotes ".

See Hipchat below for usage example.


Post notification on HipChat

This example show use of variable interpolation with build metadata and the params dict.

Also shows how the usage of a authentication header using Concourse variables.

  - name: http-api
    type: docker-image
      repository: aequitas/http-api-resource
      tag: latest

    - name: hipchat
      type: http-api
          method: POST
              Authorization: "Bearer {hipchat_token}"
              color: "{color}"
              message: "Build {BUILD_PIPELINE_NAME}{BUILD_JOB_NAME}, nr: {BUILD_NAME} {message}!"
          hipchat_token: {{HIPCHAT_TOKEN}}

    - name: Test and notify
          - task: build
            file: ci/build.yaml
                put: hipchat
                    color: green
                    message: was a success
                put: hipchat
                    color: red
                    message: failed horribly

Trigger build in Jenkins

Trigger the job job_name with parameter package set to test.

More info:

    - name: jenkins-trigger-job
      type: http-api
          method: POST
                    - name: package
                      value: test

    - name: Test and notify
          - task: build
            file: ci/build.yaml

          - put: jenkins-trigger-job
You can’t perform that action at this time.