Get API Key

  • Log into SyncSketch Pro to gain access to your API Key.
  • Navigate to your settings page
  • Copy the API Key

Note

If you are logged into SyncSketch Pro, your API Info will automatically appear in the documentation. Nobody else will see your info!

Fetching Data

Using the API Key you can easily make calls to fetch Project information, create a review or upload an Media File. Let’s try accessing the project overview

https://www.syncsketch.com/api/v1/project/?username=YOUR_USERNAME&api_key=YOUR_APIKEY

which will return data as a JSON formatted string. To view JSON in your browser in a formatted way, please use the JSONView plugin. Formatted the data would look like:

{
"meta": {
    "limit": 99,
    "next": null,
    "offset": 0,
    "previous": null,
    "total_count": 12
},
"objects": [
    {
        "active": true,
        "color": "#482a93",
        "created": "2015-05-18T08:44:25Z",
        "creator": {
            "email": "floepi+6@gmail.com",
            "id": 20,
            "username": "floepi+6@gmail.com"
        },
        "description": "asd",
        "id": 20,
        "modified": "2015-05-18T08:44:29Z",
        "name": "asd",
        "resource_uri": "/api/v1/project/20/",
        "reviewCount": 1,
        "users": [
            {
                "email": "floepi+6@gmail.com",
                "id": 20,
                "username": "floepi+6@gmail.com"
            },
            {
                "email": "floepi@gmail.com",
                "id": 1,
                "username": "floepi"
            }
        ]
    },

This is referred to as a list call, which gives you access to a collection of items. Please note the “objects” attribute which contains the resulting records. The meta information contains the page and the overall count of all your accessible records.

If you want to access a single record, use the records ID and create a URL like such

https://www.syncsketch.com/api/v1/project/RECORD_ID?username=YOUR_USERNAME&api_key=YOUR_APIKEY

The result of a single entry looks like this:

{
    "active": true,
    "color": "#482a93",
    "created": "2015-05-18T08:44:25Z",
    "creator": {
        "email": "floepi+6@gmail.com",
        "id": 20,
        "username": "floepi+6@gmail.com"
    },
    "description": "asd",
    "id": 20,
    "modified": "2015-05-18T08:44:29Z",
    "name": "asd",
    "resource_uri": "/api/v1/project/20/",
    "reviewCount": 1,
    "users": [
        {
            "email": "floepi+6@gmail.com",
            "id": 20,
            "username": "floepi+6@gmail.com"
        },
        {
            "email": "floepi@gmail.com",
            "id": 1,
            "username": "floepi"
        }
    ]
}

The Schema

Now that you have made your first API call, lets see what other calls we can make. To access a list of available API endpoints, use the following call:

https://www.syncsketch.com/api/v1/?format=json&username=YOUR_USERNAME&api_key=YOUR_APIKEY

results into:

{
    item: {
        list_endpoint: "/api/v1/item/",
        schema: "/api/v1/item/schema/"
    },
    log: {
        list_endpoint: "/api/v1/log/",
        schema: "/api/v1/log/schema/"
    },
    person: {
        list_endpoint: "/api/v1/person/",
        schema: "/api/v1/person/schema/"
    },
    project: {
        list_endpoint: "/api/v1/project/",
        schema: "/api/v1/project/schema/"
    },
    review: {
        list_endpoint: "/api/v1/review/",
        schema: "/api/v1/review/schema/"
    },
    revision: {
        list_endpoint: "/api/v1/revision/",
        schema: "/api/v1/revision/schema/"
    },
    simpleperson: {
        list_endpoint: "/api/v1/simpleperson/",
        schema: "/api/v1/simpleperson/schema/"
    }
}

from here you can easily explore the various endpoints and their respective fields by following the schema link. For example

https://www.syncsketch.com/api/v1/project/schema/?format=json&username=YOUR_USERNAME&api_key=YOUR_APIKEY

provides information about the entity:

{
    allowed_detail_http_methods: [
        "get",
        "post",
        "put",
        "delete",
        "patch"
    ],
    allowed_list_http_methods: [
        "get",
        "post",
        "put",
        "delete",
        "patch"
    ],
    default_format: "application/json",
    default_limit: 99,
    fields: {
        active: {
            blank: true,
            default: 1,
            help_text: "Boolean data. Ex: True",
            nullable: false,
            readonly: false,
            type: "boolean",
            unique: false
        },
        color: {
            blank: false,
            default: "No default provided.",
            help_text: "Unicode string data. Ex: "
            Hello World "",
            nullable: true,
            readonly: false,
            type: "string",
            unique: false
        },
        .
        .
        .
        users: {
            blank: false,
            default: "No default provided.",
            help_text: "Many related resources. Can be either a list of URIs or list of individually nested resource data.",
            nullable: true,
            readonly: false,
            related_type: "to_many",
            type: "related",
            unique: false
        }
    },
    filtering: {
        active: 1,
        id: 1,
        name: 1,
        users: 2
    }
}