AnalysisPlace Document Generation API (for Developers)

 

Try Demo

AnalysisPlace Document Generation Service (Template-Based)

Submit JSON-formatted data, receive customized Word or PowerPoint documents.

This is a very easy-to-use, yet powerful API that enables your app to submit data (in standard JSON format) and receive a personalized template-based document. The service is very easy to set up because it uses our popular Office add-in to link the data to your template. It also provides the exact JSON data structure for your app to use.

Flowchart showing how using JSON with the AnalysisPlace Document APi can update Word or PowerPoint documents

Potential Use Cases

The API can be used to improve a wide variety of business processes.  Below are a few:

Key Features

Very powerful and flexible, yet easy to set up.

Updatable content

As with our add-in, you can update essentially any type of content in your template:

How to configure the solution

Other systems are complicated and very time-consuming to set up. Ours is simple.  It leverages our existing add-in to make it substantially easier.

  1. Link your Word and/or PowerPoint templates using our existing add-in. You link it to an Excel document, although Excel is not part of the production system. The Excel document is important for making it easy to visualize sample data and to test the template.
  2. Test your templates with the add-in.
  3. Sign in to the add-in (in Excel) with an authorized account; the “API” tab will appear. Select or paste your API key.
  4. Click “Display JSON Data Structure”. This analyzes linked data in your Excel document, then displays the exact structure of the JSON data that your system needs to provide in the web service request. It also provides the API URL.
  5. Click “Upload Template” to upload your template to our server.
  6. Configure your system/app to submit data in the provided structure. Include the desired template ID and your API key for authentication. AnalysisPlace will provide your API key at sign up.
  7. Our API will return the URL of the updated document. Your system can download the document or provide the URL to your user (e.g. to place in a “Download Report” button).
How to get API permission and API keys

A business account is required to administer and use the API (API access is included in the free business trial). An AnalysisPlace account administer can grant API admin access and create API keys in the Admin Portal. See the "API Administration" section. The user must first have permission to access/use the core features of the add-in (see "User Access Control" section).

To grant "API Administrator" access to a user (which exposes the API tab in the add-in): under "API Administrators" add the email of the user, then "Submit and Apply Changes".

To create an API key: under "API Keys", click "Create New API Key", then edit the description.

When the user signs into the add-in, the "API" tab should appear and at the top of that tab, it will indicate the API keys that the organization can use.


AnalysisPlace Calculation API

A very flexible and powerful calculation service based on logic, formulas, and lookups in your Excel templates. Your application submits inputs; our service calculates and returns results (values and graphs) based on your workbook.

Potential Use Cases

There are a wide variety of use cases, below are a few:

Note: our API services should typically be called from a server, not from a client because the web service request contains your API key. For example, you may not want to call the API directly from JavaScript in a browser (a malicious user could find and use your API key).

Key Features

Very powerful and flexible, yet easy to set up.

Potential Inputs

Potential Outputs (calculated results)

How to Configure the Solution

Set-up is simple because it uses our add-in to define and test inputs/outputs and it provides the JSON format (request and response) that your app can use.

  1. Sign in to the add-in (in Excel) with an authorized account; an “API” tab will appear.
  2. Name items (inputs and outputs) in your workbook. Use the same naming conventions as the add-in (prefixes). This configuration is associated with your workbook, so it is easy to modify over time.
  3. Click “Display JSON Data Structure”. This analyzes the named (linked) content in your Excel document, then displays the exact structure of the JSON data that your system needs to provide in the web service request (the inputs). It also displays the structure of the response JSON data (the results) and it provides the service URL.
  4. Upload your workbook(s) to our secure calculation service via the add-in.
  5. Test the calculation service from the add-in and view the response JSON.
  6. Configure your system/app to submit and receive data in the provided JSON data structure. Include your API key for authentication.
  7. Our API will return the calculated results.

Response times may be 2-6 seconds, so it may not be appropriate for high-volume scenarios.


Combine the 2 APIs:

Submit raw data, let our Calculation API calculate results and create great-looking charts; and then leverage the Document API to create documents based on your templates:

Calculation and Document Automation APIs Combined

 


API DocumentationDocument Automation API Administration Tab

APIs require extensive documentation, right?

Not ours: the “API” tab of the add-in makes it easy to: create and upload calculator and document templates, test your templates, and view request and response JSON.

1. Create Templates

Create your Word and/or PowerPoint templates using the standard features of the AnalysisPlace add-in: link your workbook to your Word or PowerPoint documents. Test your templates using "Submit Content" in the Excel add-in and "Update Document" in the Word or PowerPoint add-in.

The resulting document update of the API should be the same as the add-in “Update Document”.

2. Upload Templates

Upload/manage your Word and/or PowerPoint templates in this section. Uploaded documents will be available to your app via the API.

Each template is assigned a unique "Template ID". Use this ID in your JSON ("templateId" element) to reference the template. You can update your templates at any time by uploading a new version.

3. Test Templates

Test your workbook and/or templates using data in the open workbook.

“Test API” submits JSON to the API (using your API key) based on content in the workbook the same way your app would submit data to the API. When your app submits data in the specified structure, the result should be the same.

The add-in shows the request and response JSON. For document updates, it allows you to download the generated document. 

4. Display Request JSON

Display the JSON data structure based on data in the open workbook. Your app should submit data in the general format displayed (but with your custom data).

The Request JSON is also updated when you test the API.

You can also test your JSON here: API Test

5. Develop Your App

Create/modify your app so it submits data in the JSON structure shown. Use the following endpoint: https://api.analysisplace.com/API/v1.0 . Submit a standard REST-based POST service request using any programming language.

If you are accessing the API from a web client, contact AnalysisPlace so we can allow CORS access to our API from your domain(s).