API Documentation

Use the Aptly API to programmatically interact with your boards, cards, contacts, and users.

addCard

POST

Create or update a card on a board

Posts a new card to the board. The format of this post is a JSON object that contains key/value pairs where the key is the NAME of the field (not the UUID), and the value is the value you wish to post. If an _id parameter is provided, Aptly will update the existing card that matches the given _id. Note that the JSON key for the field is the name of the field in this endpoint, not the uuid that you can retrieve in the schema. This may be changed in the future.

POST https://app.getaptly.com/api/aptlet/:boardId?x-token=
curl -X POST "https://app.getaptly.com/api/aptlet/:boardId?x-token="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String xToken = "xToken_example"; // Your Aptly API Token
        CardPost data = new CardPost(); // Data for the card to post
        
        try {
            apiInstance.addCard(xToken, data);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#addCard");
            e.printStackTrace();
        }
    }
}
// Android (Java) code example
import com.aptly.api.BoardsApi;

public class MainActivity extends AppCompatActivity {
    private void addCard() {
        BoardsApi apiInstance = new BoardsApi();
        String xToken = "xToken_example"; // Your Aptly API Token
        CardPost data = new CardPost(); // Data for the card to post
        
        apiInstance.addCardAsync(xToken, data, new Callback() {
            @Override
            public void onSuccess(Void result, int statusCode, Map> responseHeaders) {
                // Handle success
            }
            
            @Override
            public void onFailure(Exception e, int statusCode, Map> responseHeaders) {
                // Handle failure
            }
        });
    }
}
// Objective-C code example
#import <SWGApiClient.h>
#import <SWGBoardsApi.h>

SWGBoardsApi *apiInstance = [[SWGBoardsApi alloc] init];
NSString *xToken = @"xToken_example"; // Your Aptly API Token
SWGCardPost *data = [[SWGCardPost alloc] init]; // Data for the card to post

[apiInstance addCardWith:xToken
    data:data
    completionHandler: ^(NSError* error) {
        if (error) {
            NSLog(@"Error: %@", error);
        }
}];
// JavaScript code example
var AptlyApi = require('aptly_api');
var api = new AptlyApi.BoardsApi();
var xToken = "xToken_example"; // Your Aptly API Token

var opts = { 
  'data': new AptlyApi.CardPost() // Data for the card to post
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};

api.addCard(xToken, opts, callback);
// C# code example
using System;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example {
    public class addCardExample {
        public void main() {
            var apiInstance = new BoardsApi();
            var xToken = "xToken_example"; // Your Aptly API Token
            var data = new CardPost(); // Data for the card to post
            
            try {
                // Create or update a card on a board
                apiInstance.addCard(xToken, data);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.addCard: " + e.Message);
            }
        }
    }
}
// PHP code example
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\BoardsApi();
$xToken = "xToken_example"; // Your Aptly API Token
$data = new \Swagger\Client\Model\CardPost(); // Data for the card to post

try {
    $api_instance->addCard($xToken, $data);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->addCard: ', $e->getMessage(), PHP_EOL;
}
?>
# Perl code example
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::BoardsApi;

my $api_instance = WWW::SwaggerClient::BoardsApi->new();
my $xToken = "xToken_example"; # Your Aptly API Token
my $data = WWW::SwaggerClient::Object::CardPost->new(); # Data for the card to post

eval { 
    $api_instance->addCard(xToken => $xToken, data => $data);
};
if ($@) {
    warn "Exception when calling BoardsApi->addCard: $@\n";
}
# Python code example
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException

# Create an instance of the API class
api_instance = swagger_client.BoardsApi()
xToken = 'xToken_example' # Your Aptly API Token
data = swagger_client.CardPost() # Data for the card to post

try: 
    # Create or update a card on a board
    api_instance.add_card(xToken, data=data)
except ApiException as e:
    print("Exception when calling BoardsApi->addCard: %s\n" % e)

Parameters

Body parameters
Name Description
data
{
Required: name
_id: string (uuid)
  example: JShpBxEFgRmZnivTf
name: string
  example: Widget Adapter
Custom Field Name: string
  example: My custom field value
stage: string
  example: To Do
}
Query parameters
Name Description
x-token* String
Your Aptly API Token
Required

Responses

200 Item created
400 Invalid input, object invalid

getCards

GET

Returns a list of cards for a board

Returns cards on a board specified by board id. The URL with the board id is available in the Aptly UI under Card Sources -> API. API access must be turned on by a user with appropriate privileges for each board you wish to enable. When you enable the API, you will also be presented with your API Token/Key. The token must be passed in each request via an x-token query parameter. The token is company wide and can be reused if you are enabling multiple boards to have API access. Data is returned by page and the page size is 200. When there is no more data you will receive an empty array. Data is sorted by the time it was last updated, so if you are syncing data, you should crawl pages until you've got everything modified since your last data pull. A better approach is to use our webhook which will POST changes to a URL you provide whenever a change occurs the board in Aptly.

GET https://app.getaptly.com/api/aptlet/:boardId?x-token=&page=
curl -X GET "https://app.getaptly.com/api/aptlet/:boardId?x-token=&page="
// Java code example for getCards
import io.swagger.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String xToken = "xToken_example"; // Your Aptly API token
        Integer page = 0; // The page of results you want, 0 indexed
        
        try {
            Object result = apiInstance.getCards(xToken, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#getCards");
            e.printStackTrace();
        }
    }
}

Parameters

Query parameters
Name Description
x-token* String
Your Aptly API token
Required
page Integer (int32)
The page of results you want, 0 indexed. Start at 0 and increment until your done receiving results in which case Aptly will send an empty array. Results returned ordered by last modified date. Page size is 200 items per page.

Responses

200

Card results

Schema
[
  undefined
]
400 Bad input parameter

getSchema

GET

Returns the board schema

Returns the field schema for the board.

GET https://app.getaptly.com/api/schema/:boardId?x-token=
curl -X GET "https://app.getaptly.com/api/schema/:boardId?x-token="

Parameters

Query parameters
Name Description
x-token* String
Your Aptly API token
Required

Responses

200

Board schema

Schema
[
  undefined
]
400 Bad input parameter

getCard

GET

Returns the specific card based on the id

Returns the card data

GET https://app.getaptly.com/api/card/:cardId?x-token=
curl -X GET "https://app.getaptly.com/api/card/:cardId?x-token="

Parameters

Query parameters
Name Description
x-token* String
Your Aptly API token
Required

Responses

200

Card data

Schema
[
  undefined
]
400 Bad input parameter

postComment

POST

Posts a comment to a card

Post a comment onto a card instance

POST https://app.getaptly.com/api/card/:cardId/comment?x-token=
curl -X POST "https://app.getaptly.com/api/card/:cardId/comment?x-token="

Parameters

Body parameters
Name Description
data
{
userId: string (uuid)
  example: JShpBxEFgRmZnivTf
id: string (uuid)
  example: JShpBxEFgRmZnivTf
content: string
  example: This is a new comment
}
Query parameters
Name Description
x-token* String
Your Aptly API token
Required

Responses

200

Comment data

Schema
{
id: string (uuid)
  example: 8AA39yrMPHFzWH2YS
userId: string (uuid)
  example: JShpBxEFgRnZnivTf
content: string
  example: Test comment
seenByUsers: [
  string
  example: JShpBxEFgRnZnivTf
]
userName: string
  example: Alan Runyan
createdAt: string
  example: 2022-06-06T20:57:35.665Z
}
400 Bad input parameter

postFile

POST

Posts a file to a card

Post a file to a card instance

POST https://app.getaptly.com/api/card/:cardId/file?x-token=
curl -X POST "https://app.getaptly.com/api/card/:cardId/file?x-token="

Parameters

Body parameters
Name Description
data
{
userId: string (uuid)
  example: JShpBxEFgRmZnivTf
filename: string
  example: myphoto.jpg
base64: string
  example: data:@image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQU...
}
Query parameters
Name Description
x-token* String
Your Aptly API token
Required

Responses

200

File data

Schema
{
fileId: string (uuid)
  example: DNcKJk27qewHTPs6W
}
400 Bad input parameter