Gearset’s Automation API

Julian Wreford on

Share with

LinkedIn
Twitter

Having spoken to thousands of Salesforce teams and helped them to achieve DevOps maturity, we know that there’s no one workflow that suits everyone. Each team has its own requirements that lead them to make different choices and take different approaches to Salesforce DevOps. It’s important to us that Gearset accommodates this range of workflows.

As a complete DevOps solution, Gearset is most commonly used as the one-stop shop for deployments, automation, backups and more. But many teams had also requested that we present an API, allowing them to take advantage of our powerful deployment engine and other analysis tools, but integrate them within a wider DevOps toolchain. Since we could see it would be useful for certain teams with valid approaches to DevOps, we built and recently released Gearset’s Automation API.

Illustration of automation

What can you do with the Automation API?

Using the Automation API, enterprise license holders can now:

  • Start a continuous integration or unit testing job
  • Query the status of the job
  • Cancel a job run

Gearset already has integrations with version control providers such as GitHub and GitLab, work tracking tools such as Jira, and messaging providers such as Slack and Chatter. But the Automation API should mean that even more teams can use Gearset to meet their DevOps needs.

Getting started with the Automation API

The first thing you’ll need to do to use the API is get an access token. Your access token is used for authentication, and it tells the API that you’re authorized to make requests. To create an access token, go to the My account page in Gearset, then find Access token management on the left-hand side. From this page you can create an access token.

Managing access tokens within Gearset

Enter a recognizable name that will help you identify the token in the future. You can also change the expires in value at this point. Click Create new token and you’ll be presented with a dialog like the one below. Take a copy of your token secret and store it somewhere secure. The secret will only be displayed to you once.

Token secret

Now you have a token, you can start using the Automation API. To make your first query, go to our interactive documentation and click Authorize.

Authorize your token

In the popup, enter token {secret} - {secret} should be replaced with the token secret you copied earlier. Then click Authorize.

Enter your token secret

Once you’ve authorized your token, you can use the interactive documentation to both experiment with queries and get commands which can be used to query the API from any external systems you may have.

For example, the simplest endpoint in the API simply checks the status of the CI job to tell you whether it’s currently idle or running.

To use this endpoint, expand the top entry in the list of endpoints with the text Check the status of a CI job.

Get the status of a CI job

Press Try it out and fill in the jobId with the ID of your CI job.

After clicking Execute you’ll see a screen that looks something like this:

The API providing the status of the CI job

This page gives you three pieces of information:

  1. The curl query which was used to query the endpoint. You can use this from anywhere, and integrate Gearset’s CI functionality with different tools.
  2. The response body shows the thing the API returned. In this case it returned Idle because the job wasn’t currently active.
  3. The response headers give information like rate limiting information, and the version of the API which was used.

From this same page you can explore everything the Automation API has to offer and start integrating Gearset with your external tools.

Your feedback shapes our roadmap

At Gearset, we use customer-oriented research to drive product improvements, and our work on the automation API is a good example of this in action. This feature comes off the back of a very popular request in our user feedback forum. We loved researching and listening to customer requirements so we could build a solution that solved their problems.

After the research stage we created a narrow first slice as a pilot feature, then we continued to iterate based on user feedback. Once we were happy that the API delivered what customers wanted, we released it as a fully fledged feature. You can read more about our approach to engineering at Gearset here!

Let us know what you think!

We’re always looking to make further improvements, so please do get in touch with us via the live chat if you have any questions. And if managing a toolchain is becoming a bit of a headache, take a look at Pipelines - our solution for end-to-end management of your Salesforce release process.

Ready to get started with Gearset?