Register
Forgotten password?

The Docular API

Our API allows you to access the HTML content of your documents.

This means that you can dynamically pull your Docular documents directly into your website. For example, you could create and maintain your website privacy policy and T&Cs using the Docular editor, and any changes you make to the documents in the editor would be reflected on your website.

So, you or your legal team can keep your documents up to date without having to worry about the technical means of transferring the document code to your website.

Our API is in its infancy and at the moment you can ask our server for the HTML, CSS or both, as well as the date it was last modified (that's useful so you don't fetch the contents unless they've changed).

How do I register to use the API key

Add a Client Secret and API Domain Key

You need to register with our website to use our API. If you already have a Docular account and have supplied your name and address details to us, you're almost there. Otherwise, you can log in and go to Edit Account; or register.

You will need an API Domain Key to identify yourself to the API when you make a request.

  1. Go to the Taskwheel (Docular Taskwheel) and click on API Keys  ;
  2. Then, under Get an API Domain Key for a domain enter the domain name or IP address (for example "docular.net" or "123.45.67.89") for the domain on which you'll be using your document and click Add domain.
    (If you're testing on a local domain you must generate a separate key for that, using whatever your SERVER_NAME is in your GET header.)
  3. We have a domain tool to help you find your domain. This is particularly useful if you're on a localhost. Just send this request from the host you will be using: https://docular.net/api/v1/hostinfo/domain. If it returns nothing, try https://docular.net/api/v1/hostinfo/ip.
  4. You now have an API Domain Key - the long, random-looking string that now appears in your advanced settings.

What's an API Document key?

Add an API Document Key

Once you have an API Domain Key you can speak to the API, but you'll also need an API Document Key to let the API know you're allowed to access a specific document. Each instance of a document has its own unique key, so make sure you use the correct one for the document you want.

You can find your document's API Document Key in the online document editor. If you're registered to use the API you'll see the API Document Key in the blue navigation bar on the right, just above the document notes.

How does the API work?

You access the API by sending a GET request to our server. The request takes the following format.

https://docular.net/api/{version}/{object}/{request}/{api-domain-key}/{api-document-key}
{version} v1
Be sure to use the right version for your request or you might not get the result you want.
{object} instance
Currently there is only one object you can access and that's an instance of your document.
{request} html
The HTML contents of the document you requested.
css-full
The CSS styles of the document you requested, including some CSS that improves the look of the document display.
css-min
The CSS styles of the document you requested, but only the bare minimum to get the document to display correctly.
both-full
Both the HTML and CSS contents of the document you requested, including some CSS that improves the look of the document display.
both-min
Both the HTML and CSS contents of the document you requested, but only the bare minimum of CSS to get the document to display correctly.
modified
The modification date of the instance in the format: yyyy-mm-dd hh:mm:ss
{api-domain-key} Your API Domain Key.
{api-document-key} Your API Document Key.
Please note that the API Document Key must belong to a document with the same Docular account as the API Domain Key.

Notes

  • You must use a GET request to access the API.
  • {html} returns only the HTML of the document contents and isn't surrounded by <html>, <head> or <body> tags.
  • {css} returns only the CSS and isn't surrounded by a <style> tag.
  • {html} returns the HTML not surrounded by <html>, <head> or <body> tags, but the CSS is surrounded by a <style> tag.
  • Please always use {modified} first and only make a request if the cached version you keep is older.