Welcome to GatherContent’s API documentation.

Reference

Search results for "{{ search.query }}"

No results found for "{{search.query}}".
View All Results

Welcome to GatherContent’s API documentation.

Our API is a flexible set of tools that you can use to integrate GatherContent to external systems and services. The goal is to make it as easy as possible to get your content wherever you need it. You can also use the API to import content into your account, manage the people and workflow of your projects and interact with various other components of the product.

If you have any questions or feedback on using our API, then please feel free to contact us directly. We’re always happy to work with people on projects and learn about the kind of functionality you would like to see added in the future.

—Looking for the legacy API Documentation? It’s available here.

Suggest Edits

Authentication

 

Authentication for the GatherContent API works by providing an API key that you can generate from your account settings. This API key is unique and should be kept secret, so make sure you keep it somewhere safe! The authentication method uses HTTP Basic Auth, and all requests must be made using the HTTPS protocol.

To generate your API key, you can visit your Personal Settings, like so:

In the API section, you can generate your access tokens:

Suggest Edits

Versioning

 

All requests to the API must provide an Accept header containing the version your application expects to handle the request.

Accept: application/vnd.gathercontent.v0.5+json

Be sure to provide the version of the API on every request – each example contains a version header for you.

What is the latest version of the API?

The current version is v0.5.

Why is the API not v1.0

Prior to the launch of our API, we provided a Plugins API which is still used for integrations with systems such as WordPress. We still maintain the Plugins API, however active development stopped at v0.4. Our integration plugins are currently being updated to use the latest version of our API.

Furthermore, we have also defined a backlog of functionality which constitutes v1.0 officially, so we opted to launch as v0.5.

Is the API ready for production?

Absolutely. In fact, we use the API within the application.

Any changes introduced to the interface will require a version bump in order to be adopted. We will never introduce breaking changes to any supported version of the API.

Which versions are currently supported?

v0.5

When will a version become unsupported?

We have no plans to drop support for any version of our API in the near future, however when we do – we will communicate a timeframe with all our customers still making requests with the version being dropped. We care deeply about our customers and will never intentionally cause any integrations to break.

Suggest Edits

The Config Field

 

Several endpoints accept a config field as part of the request payload. This section describes the structure of the config field which includes tabs, elements, options and content.

Suggest Edits

Request Payload

 

The config field must be pre-processed before it can be sent along with a request. It must be a base64 encoded JSON object.

An example within PHP:

<?php
$config = base64_encode(json_encode($config));

The rules

The config is an array of tabs. It must have at least one tab.

This is an example of a valid config:

[{
    "label": "Content",
    "name": "tab1",
    "hidden": false,
    "elements": [{
        "type": "text",
        "name": "el1",
        "required": false,
        "label": "Blog post",
        "value": "Hello world",
        "microcopy": "",
        "limit_type": "words",
        "limit": 1000,
        "plain_text": false
    }]
}]
Suggest Edits

Tab Structure

 

The structure of a tab must be a valid JSON object. All of the attributes defined in the example below are required and does not allow additional attributes to be defined:

{
    "label": "Content",                  // string, not empty
    "name": "tab1",                      // string, not empty, unique
    "hidden": false,                     // boolean
    "elements": [ /* tab elements */ ]   // array
}
Suggest Edits

Element Structure

 

We currently support 5 element types:

  • text
  • files
  • section
  • choice_radio
  • choice_checkbox

All elements must be valid JSON objects. All attributes used within the examples below are required when the corresponding type is provided. No additional attributes are allowed.

Here are some examples of each element type:

{
    "type": "text",                      // string, must be "text"
    "name": "el1",                       // string, not empty, unique
    "required": false,                   // boolean
    "label": "Blog post",                // string, not empty
    "value": "<p>Hello world</p>",       // string
    "microcopy": "",                     // string
    "limit_type": "words",               // string, either "words" or "chars"
    "limit": 1000,                       // integer, non-negative
    "plain_text": false                  // boolean
}
{
    "type": "files",                     // string, must be "files"
    "name": "el2",                       // string, not empty, unique
    "required": false,                   // boolean
    "label": "Photos",                   // string, not empty
    "microcopy": ""                      // string
}
Suggest Edits

choice_radio

 
{
    "type": "choice_radio",              // string, must be "choice_radio"
    "name": "el4",                       // string, not empty, unique
    "required": false,                   // boolean
    "label": "Label",                    // string, not empty
    "microcopy": "",                     // string
    "other_option": false,               // boolean
    "options": [ /* element options */ ] // array, must have at least one option
}

At least two options are required if other_option is set to true.

Suggest Edits

choice_checkbox

 
{
    "type": "choice_checkbox",           // string, must be "choice_checkbox"
    "name": "el4",                       // string, not empty, unique
    "required": false,                   // boolean
    "label": "Label",                    // string, not empty
    "microcopy": "",                     // string
    "options": [ /* element options */ ] // array, must have at least one option
}

Option structure

All options must be valid JSON objects. Again, all attributes provided within the examples below are required and no additional attributes are allowed.

Most options will look like this:

{
    "name": "op1",                       // string, not empty, unique
    "label": "Option 1",                 // string, not empty
    "selected": false                    // boolean
}

The only exception is the last option for choice_radio element if the other_option attribute is true:

{
    "name": "op1",                       // string, not empty, unique
    "label": "Other",                    // string, not empty
    "selected": true,                    // boolean
    "value": "Something"                 // string
}

The value attribute for “other” option must be empty if the option is not selected.

Also, choice_radio must not have more than one option selected.

 
{
    "type": "section",                   // string, must be "section"
    "name": "el3",                       // string, not empty, unique
    "title": "Title",                    // string, not empty
    "subtitle": "<p>How goes it?</p>"    // string
}
Suggest Edits

GET: /me

You have access to all fields of information about the logged in User such as their avatar url, name, and other fields. Check out the example response.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/me
curl https://api.gathercontent.com/me \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/me');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": {
        "email": "andrew@gathercontent.com",
        "first_name": "Andrew",
        "last_name": "Cairns",
        "timezone": "UTC",
        "language": null,
        "gender": null,
        "avatar": "http://image-url.com"
    }
}
 
Suggest Edits

GET: /accounts

Retrieves a list of all Accounts associated with a specific User in GatherContent

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/accounts
curl https://api.gathercontent.com/accounts \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/accounts');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": [
        {
            "id": "123456",
            "name": "Example",
            "slug": "example",
            "timezone": "UTC"
        }
    ]
}
 
Suggest Edits

GET: /projects

Retrieves a list of all Projects associated with the given Account.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/projects?account_id=account_id
curl https://api.gathercontent.com/projects?account_id=<ACCOUNT_ID> \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';
$account_id = '<ACCOUNT_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/projects?account_id=' . $account_id);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": [
        {
            "id": 123456,
            "name": "Example Project",
            "account_id": 123456,
            "active": true,
            "text_direction": "ltr",
            "overdue": false,
            "statuses": {
                "data": [
                    {
                        "id": "123456",
                        "is_default": true,
                        "position": "1",
                        "color": "#C5C5C5",
                        "name": "Draft",
                        "description": "",
                        "can_edit": true
                    },
                    {
                        "id": "123457",
                        "is_default": false,
                        "position": "2",
                        "color": "#FAA732",
                        "name": "Review",
                        "description": "",
                        "can_edit": true
                    },
                    {
                        "id": "123458",
                        "is_default": false,
                        "position": "3",
                        "color": "#5EB95E",
                        "name": "Final edits",
                        "description": "",
                        "can_edit": true
                    },
                    {
                        "id": "123459",
                        "is_default": false,
                        "position": "4",
                        "color": "#DD4398",
                        "name": "Ready to be published",
                        "description": "",
                        "can_edit": false
                    }
                ]
            }
        }
    ]
}

Path Params

account_id
int32
required

The Account ID

 
Suggest Edits

GET: /projects/:project_id

This retrieves all information for a specific Project.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/projects/project_id
curl https://api.gathercontent.com/projects/<PROJECT_ID> \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';
$project_id = '<PROJECT_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/projects/' . $project_id);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": {
        "id": 123456,
        "name": "Example Project",
        "account_id": 123456,
        "active": true,
        "text_direction": "rtl",
        "overdue": false,
        "statuses": {
            "data": [
                {
                    "id": "123456",
                    "is_default": true,
                    "position": "1",
                    "color": "#C5C5C5",
                    "name": "Draft",
                    "description": "",
                    "can_edit": true
                },
                {
                    "id": "123457",
                    "is_default": false,
                    "position": "2",
                    "color": "#FAA732",
                    "name": "Review",
                    "description": "",
                    "can_edit": true
                },
                {
                    "id": "123458",
                    "is_default": false,
                    "position": "3",
                    "color": "#5EB95E",
                    "name": "Final edits",
                    "description": "",
                    "can_edit": true
                },
                {
                    "id": "123459",
                    "is_default": false,
                    "position": "4",
                    "color": "#DD4398",
                    "name": "Ready to be published",
                    "description": "",
                    "can_edit": false
                }
            ]
        }
    },
    "meta": {
        "templates": 2
    }
}

Path Params

project_id
int32
required

The Project ID

 
Suggest Edits

POST: /projects

Creates a new Project for a specific Account. When you create a Project, a default Workflow containing four Statuses will be created and associated with it. As part of this request a type can be passed as an argument to specify the project type.
Available options for the project types are :-

  • website-build
  • ongoing-website-content
  • marketing-editorial-content
  • email-marketing-content
  • other
 

Authentication

 Authentication is required for this endpoint.
posthttps://api.gathercontent.com/projects
curl https://api.gathercontent.com/projects \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json" \
  -X POST --data "account_id=7258&name=Project Name&type=email-marketing-content"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$data = array(
    'account_id' => '<ACCOUNT_ID>',
    'name' => '<NAME>',
    'type' => '<PROJECT TYPE>'
);

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json', 'Content-Type: application/x-www-form-urlencoded'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/projects');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Body Params

account_id
int32

The ID of the Account

name
string

The name of the Project

type
string

The type of Project

 
Suggest Edits

GET: /projects/:project_id/statuses

Retrieves a list of all the Statuses (what we call the Project’s Workflow) associated with a given Project. This includes their names, descriptions, associated colours and their Due Dates.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/projects/project_id/statuses
curl https://api.gathercontent.com/projects/<PROJECT_ID>/statuses \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';
$project_id = '<PROJECT_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/projects/' . $project_id . '/statuses');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": [
        {
            "id": "123456",
            "is_default": true,
            "position": "1",
            "color": "#C5C5C5",
            "name": "Draft",
            "description": "",
            "can_edit": true
        },
        {
            "id": "123457",
            "is_default": false,
            "position": "2",
            "color": "#FAA732",
            "name": "Review",
            "description": "",
            "can_edit": true
        },
        {
            "id": "123458",
            "is_default": false,
            "position": "3",
            "color": "#5EB95E",
            "name": "Final edits",
            "description": "",
            "can_edit": true
        },
        {
            "id": "123459",
            "is_default": false,
            "position": "4",
            "color": "#DD4398",
            "name": "Ready to be published",
            "description": "",
            "can_edit": false
        }
    ]
}

Path Params

project_id
int32
required

The Project ID

 
Suggest Edits

GET: /projects/:project_id/statuses/:status_id

Retrieves a list of all the Statuses (what we call the Project’s Workflow) associated with a given Project. This includes their names, descriptions, associated colours and their Due Dates.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/projects/project_id/statuses/status_id
curl https://api.gathercontent.com/projects/<PROJECT_ID>/statuses/<STATUS_ID> \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_PRIVATE_KEY>';
$project_id = '<PROJECT_ID>';
$status_id = '<STATUS_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/projects/' . $project_id . '/statuses/' . $status_id);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": {
        "id": "123456",
        "is_default": true,
        "position": "1",
        "color": "#C5C5C5",
        "name": "Draft",
        "description": "",
        "can_edit": true
    }
}

Path Params

project_id
int32
required

The Project ID

status_id
int32
required

The Status ID

 
Suggest Edits

GET: /items

Get a list of all Items that exist on a particular Project.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/items?project_id=project_id
curl https://api.gathercontent.com/items?project_id=<PROJECT_ID> \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';
$project_id = '<YOUR_PROJECT_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/items?project_id=' . $project_id);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": [
        {
            "id": 123456,
            "project_id": 123456,
            "parent_id": 0,
            "template_id": null,
            "position": "11",
            "name": "Home",
            "notes": "",
            "type": "item",
            "overdue": true,
            "created_at": {
                "date": "2015-07-31 10:58:12.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "updated_at": {
                "date": "2015-07-31 10:58:12.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "status": {
                "data": {
                    "id": "123456",
                    "is_default": true,
                    "position": "1",
                    "color": "#C5C5C5",
                    "name": "Draft",
                    "description": "",
                    "can_edit": true
                }
            },
            "due_dates": {
                "data": [
                    {
                        "status_id": 123456,
                        "overdue": true,
                        "due_date": {
                            "date": "2015-07-02 12:00:00.000000",
                            "timezone_type": 3,
                            "timezone": "UTC"
                        }
                    },
                    {
                        "status_id": 123457,
                        "overdue": true,
                        "due_date": {
                            "date": "2015-07-03 16:00:00.000000",
                            "timezone_type": 3,
                            "timezone": "UTC"
                        }
                    }
                ]
            }
        }
    ]
}

Path Params

project_id
int32
required
 
Suggest Edits

GET: /items/{item_id}

Get all data related to a particular Item within a Project. You can access all of its properties, including the content which will be separated by the different fields it contains. Check the sample response to learn how this data is structured.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/items/item_id
curl https://api.gathercontent.com/items/<ITEM_ID> \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';
$item_id = '<ITEM_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/items/' . $item_id);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": {
        "id": 123456,
        "project_id": 123456,
        "parent_id": 0,
        "template_id": null,
        "position": "11",
        "name": "Home",
        "config": [
            {
                "label": "Content",
                "hidden": false,
                "elements": [
                    {
                        "type": "text",
                        "name": "el1429200091126",
                        "required": false,
                        "label": "Page header",
                        "value": "<p>\n    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus leo tortor, vulputate eu leo vel, pharetra mattis sem. Nunc et nisl in ligula elementum rutrum a non mauris.\n<\/p>\n<p>\n    In venenatis, ante eget vestibulum maximus, eros sapien maximus ipsum, nec malesuada massa ante finibus diam. Sed rutrum diam sit amet ligula tempor, non vulputate mauris facilisis. Sed varius lectus mauris, sit amet pulvinar justo condimentum ut. In blandit ipsum lorem, quis tincidunt erat sodales ut.\n<\/p>\n<p>\n    Nunc congue tellus magna, eget hendrerit enim malesuada a. Proin diam lacus, suscipit ut nisl sed, suscipit vulputate ante. Suspendisse sit amet ex sollicitudin, iaculis urna eu, auctor ligula. Fusce consectetur, leo eu tempus fermentum, metus risus fringilla augue, et maximus arcu quam sit amet odio. Nam at commodo ex\n<\/p>",
                        "microcopy": "",
                        "limit_type": "words",
                        "limit": "0",
                        "plain_text": false
                    },
                    {
                        "type": "choice_radio",
                        "name": "Multiple-choice",
                        "required": false,
                        "label": "Multiple choice",
                        "microcopy": "",
                        "other_option": true,
                        "options": [
                            {
                                "label": "Second Choice",
                                "selected": false,
                                "name": "Multiple-choice-op1"
                            },
                            {
                                "label": "Third Choice",
                                "selected": true,
                                "name": "Multiple-choice-op2"
                            },
                            {
                                "label": "Red",
                                "selected": false,
                                "name": "Multiple-choice-op3"
                            },
                            {
                                "label": "Blue",
                                "selected": false,
                                "name": "Multiple-choice-op4"
                            },
                            {
                                "label": "Other",
                                "selected": false,
                                "value": "",
                                "name": "Multiple-choice-op5"
                            }
                        ]
                    },
                    {
                        "type": "files",
                        "name": "File-attachment",
                        "required": false,
                        "label": "File attachment",
                        "microcopy": ""
                    }
                ],
                "name": "tab1"
            }
        ],
        "notes": "",
        "type": "item",
        "overdue": true,
        "updated_at": {
            "date": "2015-08-26 15:16:02.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "created_at": {
            "date": "2015-08-26 15:16:02.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "status": {
            "data": {
                "id": "123456",
                "is_default": true,
                "position": "1",
                "color": "#C5C5C5",
                "name": "Draft",
                "description": "",
                "can_edit": true
            }
        },
        "due_dates": {
            "data": [
                {
                    "status_id": 123456,
                    "overdue": true,
                    "due_date": {
                        "date": "2015-07-02 12:00:00.000000",
                        "timezone_type": 3,
                        "timezone": "UTC"
                    }
                },
                {
                    "status_id": 123457,
                    "overdue": true,
                    "due_date": {
                        "date": "2015-07-03 16:00:00.000000",
                        "timezone_type": 3,
                        "timezone": "UTC"
                    }
                }
            ]
        }
    }
}

Path Params

item_id
string
required

The ID of the Item

 
Suggest Edits

POST: /items

Creates a new Item within a particular Project.

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.gathercontent.com/items
curl https://api.gathercontent.com/items \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json" \ 
  -X POST --data "project_id=123456&name=Page Name"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$data = array(
    'project_id' => '<PROJECT_ID>',
    'name' => '<PROJECT_NAME>',
    'parent_id' => '<PARENT_ID>',
    'template_id' => '<TEMPLATE_ID>'
);

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/items');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Body Params

project_id
int32

The ID for the Project

name
string

The name for the new Item

parent_id
int32

Parent Item ID (Optional)

template_id
int32

Template ID to apply (Optional)

config
mixed type

Config object containing tabs and field information (Optional)

 
Suggest Edits

POST: /items/:item_id/save

Saves an Item with the newly updated data. It expects a valid configuration structure, otherwise the save request will not be accepted by the API.

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.gathercontent.com/items/item_id/save
curl https://api.gathercontent.com/items/<ITEM_ID>/save \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json" \
  -X POST --data "config=<YOUR_UPDATED_CONFIG>"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$data = array(
    'config' => '<YOUR_UPDATED_CONFIG>'
);

$item_id = '<ITEM_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/items/' . $item_id . '/save');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

item_id
int32
required

The ID of the Item

Body Params

config
mixed type

Config object containing tabs and field information (Optional)

 
Suggest Edits

POST: /items/:item_id/apply_template

Applies the structure of a Template to an existing Item.

Beware that, just like within the application, this action will override the existing structure of an Item and may result in loss of content when fields do not match. Ensure you take necessary precautions.

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.gathercontent.com/items/item_id/apply_template
curl https://api.gathercontent.com/items/<ITEM_ID>/apply_template \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json" \
  -X POST --data "template_id=<TEMPLATE_ID>"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$data = array(
    'template_id' => '<TEMPLATE_ID>'
);

$item_id = '<ITEM_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/items/' . $item_id . '/apply_template');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

item_id
int32
required

The ID of the Item to apply a Template to

Body Params

template_id
int32

The ID of the Template to apply

 
Suggest Edits

POST: /items/:item_id/choose_status

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.gathercontent.com/items/item_id/choose_status
curl https://api.gathercontent.com/items/<ITEM_ID>/choose_status \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json" \
  -X POST --data "status_id=<STATUS_ID>"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$data = array(
    'status_id' => '<STATUS_ID>',
);

$item_id = '<ITEM_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/items/' . $item_id . '/choose_status');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

item_id
int32
required

The ID of the Item to apply a Status to

Body Params

status_id
int32

The ID of the Status to apply

 
Suggest Edits

GET: /items/:item_id/files

Get a list of all files related to a particular Item. Check the sample response to learn how this data is structured.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/items/item_id/files
curl https://api.gathercontent.com/items/<ITEM_ID>/files \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';
$item_id = '<ITEM_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/items/' . $item_id . '/files');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "data": [
    {
      "id": 1,
      "user_id": 1,
      "item_id": 1,
      "field": "abc123",
      "type": "1",
      "url": "http://link.to/filename.png",
      "filename": "original.png",
      "size": 123456,
      "created_at": "2015-12-10 18:49:17",
      "updated_at": "2015-12-10 18:49:17"
    }
  ]
}

Path Params

item_id
int32
required

The ID of the Item

 
Suggest Edits

GET: /templates

Retrieves a list of all Templates associated with the given Project.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/templates?project_id=project_id
curl https://api.gathercontent.com/templates?project_id=<PROJECT_ID> \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$project_id = '<PROJECT_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/templates?project_id=' . $project_id);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": [
        {
            "id": 123456,
            "project_id": 123456,
            "created_by": 123456,
            "updated_by": 123456,
            "name": "Blog Theme",
            "description": "Blog theme",
            "used_at": "2015-08-26 17:03:20",
            "created_at": 1440604320,
            "updated_at": 1440608600,
            "usage": {
                "item_count": 1
            }
        }
    [
}

Query Params

project_id
string

The Project ID for the Templates

 
Suggest Edits

GET: /templates/:template_id

This retrieves all data related with a specific Template.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.gathercontent.com/templates/template_id
curl https://api.gathercontent.com/templates/<TEMPLATE_ID> \
  -u you@yourdomain.com:<YOUR_API_KEY> \
  -H "Accept: application/vnd.gathercontent.v0.5+json"
<?php
$username = 'you@yourdomain.com';
$apikey = '<YOUR_API_KEY>';

$template_id = '<TEMPLATE_ID>';

$ch = curl_init();

curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $apikey);
curl_setopt( $ch, CURLOPT_URL, 'https://api.gathercontent.com/templates/' . $template_id);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

$response = json_decode( curl_exec( $ch ) );
curl_close( $ch );
Status: {{ results.statusCode[0] }}
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "data": {
        "id": 123456,
        "project_id": 123456,
        "created_by": 123456,
        "updated_by": 123456,
        "name": "Blog Theme",
        "description": "Blog theme",
        "config": [
            {
                "label": "Content",
                "name": "tab1440604292948",
                "hidden": false,
                "elements": [
                    {
                        "type": "text",
                        "name": "el1440604298968",
                        "required": false,
                        "label": "Title",
                        "value": "<p>\n    \u200b\n<\/p>",
                        "microcopy": "",
                        "limit_type": "words",
                        "limit": "0",
                        "plain_text": false
                    },
                    {
                        "type": "text",
                        "name": "el1440604306459",
                        "required": false,
                        "label": "Main Content",
                        "value": "<p>\n    \u200b\n<\/p>",
                        "microcopy": "",
                        "limit_type": "words",
                        "limit": "0",
                        "plain_text": false
                    },
                    {
                        "type": "files",
                        "name": "el1440604311606",
                        "required": false,
                        "label": "Featured Image",
                        "microcopy": "Microcopy text"
                    }
                ]
            }
        ],
        "used_at": "2015-08-26 17:03:20",
        "created_at": 1440604320,
        "updated_at": 1440608600,
        "usage": {
            "item_count": 1
        }
    }
}

Path Params

template_id
int32
required

The Template ID