VoltBuilder API

The VoltBuilder API lets you submit jobs to VoltBuilder from an app.

Possible uses are:

Complete documentation is here: https://volt.build/api-spec/

The documentation gives samples for

If you have questions or need more information, please let us know.

Step by Step

The overall implementation is very simple. Use your credentials to get a token, then use that to make your request.

1. Get your API Credentials for authentication.

Get these from VoltBuilder’s Pricing page. Log in, then click on Copy API Credentials to Clipboard. You’ll need to be on the Pro Plan to do this.

copyAPICredentials

It will be a string like 895ba4ff-ea4f-4238-8cd3-ea36ef8b7e1d:3oTBJ1tXrxdsH0flN6BHf5UNGRg9+lh9. The part before the colon is the client ID, and the part after the colon is the secret (e.g. client_id:secret).

You can use this credential for as long as you like - it does not expire. You can request additional credentials from the Pricing page if you need them. If your client secret is compromised or exposed in some way, contact support to remove your credential or reset your secret.

2. Request an access_token

Split your credential into a client_id and client_secret and put them in the appropriate request fields.

Here’s Node code to do this. Other samples are here.

const request = require('request');

const options = {
  method: 'POST',
  url: 'https://api.volt.build/v1/authenticate',
  form: {
    grant_type: 'client_credentials',
    client_id: '895ba4ff-ea4f-4238-8cd3-ea36ef8b7e1d',
    client_secret: '3oTBJ1tXrxdsH0flN6BHf5UNGRg9+lh9'
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Here is what gets returned:

{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"token_type": "bearer",
"expires_in": 3600
}

3. Submit an app to VoltBuilder

Put the access_token you got in step 2 into the authorization property of the submit request. Notice the word Bearer needs to be part of that string. An access_token is reusable but it expires after one hour. It’s always a good idea to verify your access_token is not expired before attempting to use it.

const fs = require('fs');
const request = require('request');

const options = {
  method: 'POST',
  url: 'https://api.volt.build/v1/app',
  headers: {
    authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
  },
  formData: {
    platform: 'ios',
    app: {
      value: fs.createReadStream('app.zip'),
      options: {contentType: 'application/zip'}
    }
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

If all goes well, the API will return a status of 202. Then you can check the status of the build using the API.

4. Checking build status

Once you’ve submitted a build you can check the status of it by using the following code:

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.volt.build/v1/app',
  headers: {authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Here is what gets returned:

{
  "status": "Completed",
  "timestamp": 1599670881,
  "name": "MyApp",
  "links": {
    "app": "https://link/to/your/app",
    "log": "https://link/to/your/build/log",
    "qrcode": "https://link/to/your/qrcode"
  }
}

We’re here to help!

We hope this API will be a welcome addition to VoltBuilder. If we can help in any way, please reach out. We’re excited to see what you can build with VoltBuilder!

Interested in a free trial? Sign up today!