Back to Top

Get Deployment Statuses By Package Number Through the Release & Package Deployment API

There are times when a third-party tool may be interested in retrieving the status of a build in BuildMaster, generally to be consumed by a custom tool that you have written. Starting with BuildMaster v5, the Release & Package Deployment API offers a simpler mechanism for retrieving build statuses.

Step 1: Create an API Key

To enable the API, you must create an API key within BuildMaster. Simply navigate to “Administration” > “API Keys & Access Logs” and create an API key. Make sure to enable “Grant access to Release & Deployment API” so the key you create has access to the required API endpoint.

Step 2: Get the Deployment Details

Once you have an API key, you can perform a Get Deployments request. There are several filters you can apply. In this example, we’ll apply the Application, Release, and Package filters.

GET /api/releases/packages/deployments?applicationName=HDARS&releaseNumber=1.8.3&packageNumber=1&key=hLJA9IFeV7MKzVfeaaSktg==

The response will look something like this. In this case, we can see that the deployment failed!

        "id": 1179,
        "plan": "Deploy HDARS",
        "status": "failed",
        "started": "2017-03-17T17:09:13.2170000",
        "ended": "2017-03-17T17:09:53.3800000",
        "createdBy": "Admin",
        "createdOn": "2017-03-17T17:09:11.5270000",
        "pipelineId": 8,
        "pipelineName": "HDARS",
        "pipelineStageName": "Testing",
        "environmentId": 2,
        "environmentName": "Testing",
        "applicationId": 8,
        "applicationName": "HDARS",
        "releaseId": 10,
        "releaseNumber": "1.8.3",
        "releaseName": "1.8.3",
        "packageId": 81,
        "packageNumber": "1"