Codeship

Codeship

Automation

Codeship is a Continuous Integration Platform in the cloud

Visit API

📚 Documentation & Examples

Everything you need to integrate with Codeship

🚀 Quick Start Examples

Codeship Javascript Examplejavascript
// Codeship API Example
const response = await fetch('https://apidocs.codeship.com/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introduction to CodeShip API

CodeShip is a cloud-based continuous integration and delivery platform, that allows development teams to automate their software development processes. The CodeShip API provides a RESTful interface for developers, that allows them to programmatically interact with the CodeShip platform.

This article will provide a brief overview of the CodeShip API, and demonstrate some code examples in JavaScript.

Authentication

Before any requests can be made to the CodeShip API, developers are required to authenticate themselves using a personal access token. This token is generated through the CodeShip dashboard, and is required in the Authorization header of all API requests.

const axios = require('axios');

const authToken = 'YOUR_PERSONAL_ACCESS_TOKEN';

axios.defaults.headers.common['Authorization'] = `Bearer ${authToken}`;

With the authorization header in place, requests can be made to CodeShip API endpoints.

Examples

List projects

To list all projects for a given account, use the GET /v2/organizations/{organization_slug}/projects endpoint.

axios.get('https://api.codeship.com/v2/organizations/{organization_slug}/projects')
  .then(response => console.log(response.data))
  .catch(error => console.log(error));

Get a single project

To retrieve details on a single project, use the GET /v2/organizations/{organization_slug}/projects/{uuid} endpoint.

axios.get('https://api.codeship.com/v2/organizations/{organization_slug}/projects/{uuid}')
  .then(response => console.log(response.data))
  .catch(error => console.log(error));

Trigger a build

To trigger a new build for a specific branch in a project, use the POST /v2/organizations/{organization_slug}/projects/{uuid}/builds endpoint.

const postData = {
  build_request: {
    branch: 'MY_BRANCH_NAME'
  }
}

axios.post('https://api.codeship.com/v2/organizations/{organization_slug}/projects/{uuid}/builds', postData)
  .then(response => console.log(response.data))
  .catch(error => console.log(error));

Conclusion

The CodeShip API provides a powerful set of tools for developers to interact with the CodeShip platform. By integrating with the CodeShip API, developers can streamline their development processes, and automate the deployment of new applications and updates. With the use of JavaScript, the API can be easily consumed and integrated within a variety of different applications and development workflows.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 6Jun 8Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 28Jun 30Jul 2Jul 504008001440Minutes
Online
Offline

Related APIs in Automation