Our API v1

The Doccy API opens up the ability for integrating with our platform with your own or third party software.

Getting started with our API

Users are able to integrate with the Doccy API in 2 ways.

Either directly for themselves or as a Partner giving their users the power of Doccy in their application.

Wrappers

We currently supply wrappers in the following technology


Sections

Authentication

POST https://www.doccyapp.com/api/1/sessions.json?email=YOUR_EMAIL&password=YOUR_PASSWORD
Expected Response
{
    "response": {
        "auth_token": "YOUR_AUTH_TOKEN",
        "account_id": YOUR_ACCOUNT_ID
    }
}

Accounts

To create accounts for the users of your software, become a Doccy Partner. Get in touch at support@doccyapp.com

Templates

View templates

GET https://www.doccyapp.com/api/1/templates.json?auth_token=YOUR_AUTH_TOKEN
Expected Response
{
    "response": [
        {
            "template": {
                "id": YOUR_TEMPLATE_ID,
                "name": "Sample Quote",
                "placeholders": [
                    {
                        "value": "date",
                        "expression": "{{ date }}",
                        "count": 1
                    },
                    {
                        "value": "recipient",
                        "expression": "{{ recipient }}",
                        "count": 2
                    }
                ],
                "description": "A sample quote",
                "no_of_documents": 0,
                "file_type": "docx",
                "document_template_url": "/template/document_template/1/Doccy-Example-Template.docx",
                "created_at": "2013-10-16T04:26:09Z",
                "documents": []
            }
        }
    ],
    "count": 1
}

View a template

GET https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID.json?auth_token=YOUR_AUTH_TOKEN
Expected Response
{
    "response": {
        "id": YOUR_TEMPLATE_ID,
        "name": "Sample Quote",
        "placeholders": [
            {
                "value": "date",
                "expression": "{{ date}}",
                "count": 1
            },
            {
                "value": "recipient",
                "expression": "{{ recipient}}",
                "count": 2
            }
        ],
        "description": "A sample quote",
        "no_of_documents": 0,
        "file_type": "docx",
        "document_template_url": "/template/document_template/1/Doccy-Example-Template.docx",
        "created_at": "2013-10-16T04:26:09Z",
        "documents": []
    }
}

Create a template

POST https://www.doccyapp.com/api/1/templates.json
Example request
Content-Type: application/json
{
    "template": {
        "name": "Quote for Software Development",
        "description": "A template to quote new work",
        "document_template": "YOUR_DOCUMENT_TEMPLATE_FILE"
    }
}
Expected Response
{
    "template": {
        "name": "Quote for Software Development",
        "description": "A template to quote new work",
        "document_template": "YOUR_DOCUMENT_TEMPLATE_FILE"
    }
}

Update a template

PUT https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID.json?auth_token=YOUR_AUTH_TOKEN
Example request
Content-Type: application/json
{
    "template": {
        "name": "Quote for startup clients",
        "description": "A quote tailored for new startup clients"
    }
}
Expected Response
{
    "response": {
        "id": YOUR_TEMPLATE_ID,
        "name": "Quote for startup clients",
        "placeholders": [
            {
                "value": "date",
                "expression": "{{ date}}",
                "count": 1
            },
            {
                "value": "recipient",
                "expression": "{{ recipient}}",
                "count": 2
            }
        ],
        "description": "A quote tailored for new startup clients",
        "no_of_documents": 0,
        "file_type": "docx",
        "document_template_url": "/template/document_template/1/Doccy-Example-Template.docx",
        "created_at": "2013-10-16T04:26:09Z",
        "documents": []
    }
}

Delete a template

DELETE https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID.json?auth_token=YOUR_AUTH_TOKEN
Expected Response
{
    "response": {
        "id": YOUR_TEMPLATE_ID,
        "name": "Sample Quote",
        "placeholders": [
            {
                "value": "date",
                "expression": "{{ date}}",
                "count": 1
            },
            {
                "value": "recipient",
                "expression": "{{ recipient}}",
                "count": 2
            }
        ],
        "description": "A sample quote",
        "no_of_documents": 0,
        "file_type": "docx",
        "document_template_url": "/template/document_template/1/Doccy-Example-Template.docx",
        "created_at": "2013-10-16T04:26:09Z",
        "documents": []
    }
}

Documents

Download a document

GET https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents/YOUR_DOCUMENT_ID/download.json?auth_token=YOUR_AUTH_TOKEN
Expected Response
The response is binary data that makes up your PDF document. If up want to get the file in its original format then simply add &original=true to the end of the call like so GET https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents/YOUR_DOCUMENT_ID/download.json?auth_token=YOUR_AUTH_TOKEN&original=true

View documents

GET https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents.json
Expected Response
{
    "response": [
        {
            "id": 2,
            "name": "sonr.fm Quote",
            "content": {
                "date": "16/9/2013",
                "recipient": "David",
                "title": "Software Developer",
                "company": "Sentia",
                "cost": "1000",
                "completion-date": "30/10/2013",
                "your-name": "Sandra"
            },
            "in_dropbox": false,
            "filename": "1381924295-sonr.fm-Quote",
            "extension": "pdf",
            "created_at": "2013-10-16T11:51:38Z",
            "emails": []
        }
    ],
    "count": 1
}

View a document

GET https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents/YOUR_DOCUMENT_ID.json?auth_token=YOUR_AUTH_TOKEN
Expected Response
{
    "response": {
        "id": 2,
        "name": "sonr.fm Quote",
        "content": {
            "date": "16/9/2013",
            "recipient": "David",
            "title": "Software Developer",
            "company": "Sentia",
            "cost": "1000",
            "completion-date": "30/10/2013",
            "your-name": "Sandra"
        },
        "in_dropbox": false,
        "filename": "1381924295-sonr.fm-Quote",
        "extension": "pdf",
        "created_at": "2013-10-16T11:51:38Z",
        "emails": []
    }
}

Create a document

POST https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents.json
Example request
Content-Type: application/json
{
    "document": {
        "name": "sonr.fm Updated Quote",
        "content": {
            "date": "16/9/2013",
            "recipient": "David",
            "title": "Software Developer",
            "company": "Sentia",
            "cost": "1500",
            "completion-date": "30/10/2013",
            "your-name": "Sandra"
        }
    }
}
Expected Response
{
    "response": {
        "id": 5,
        "name": "sonr.fm Updated Quote",
        "content": {
            "date": "16/9/2013",
            "recipient": "David",
            "title": "Software Developer",
            "company": "Sentia",
            "cost": "1500",
            "completion-date": "30/10/2013",
            "your-name": "Sandra"
        },
        "in_dropbox": false,
        "filename": "1381967371-sonr.fm-Updated-Quote",
        "extension": "pdf",
        "created_at": "2013-10-16T23:49:34Z",
        "emails": []
    }
}

Delete a document

DELETE https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents/YOUR_DOCUMENT_ID.json?auth_token=YOUR_AUTH_TOKEN
Expected Response
{
    "response": {
        "id": 2,
        "name": "sonr.fm Quote",
        "content": {
            "date": "16/9/2013",
            "recipient": "David",
            "title": "Software Developer",
            "company": "Sentia",
            "cost": "1000",
            "completion-date": "30/10/2013",
            "your-name": "Sandra"
        },
        "in_dropbox": false,
        "filename": "1381924295-sonr.fm-Quote",
        "extension": "pdf",
        "created_at": "2013-10-16T11:51:38Z",
        "emails": []
    }
}

Emails

View emails

GET https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents/YOUR_DOCUMENT_ID/emails.json?auth_token=YOUR_AUTH_TOKEN
Expected Response
{
    "response": [
        {
            "id": 1,
            "document_id": 2,
            "subject": "sonr.fm quote",
            "recipients": "david@sonr.fm",
            "message": "Hi David, Please find attached quote.  Sandra",
            "sent_at": "16 Oct, 2013",
            "pdf": true
        }
    ],
    "count": 1
}

Create an email

POST https://www.doccyapp.com/api/1/templates/YOUR_TEMPLATE_ID/documents/YOUR_DOCUMENT_ID/emails.json?auth_token=YOUR_AUTH_TOKEN
Example request
Content-Type: application/json
{
    "email": {
        "subject": "sonr.fm quote",
        "recipients": "david@sonr.fm",
        "message": "Hi David, Please find attached quote.  Sandra",
        "pdf": true
    }
}
Expected Response
{
    "response": {
        "id": 8,
        "document_id": 2,
        "subject": "sonr.fm quote",
        "recipients": "david@sonr.fm",
        "message": "Hi David, Please find attached quote.  Sandra",
        "sent_at": "16 Oct, 2013",
        "pdf": true
    }
}