For a full single-file documentation, see: https://docs.slidepack.io/md/full.md # SlidePack API Documentation SlidePack API generates PowerPoint files from pptx templates and JSON data. [See our service introduction](https://slidepack.io/) # Getting Started SlidePack is an HTTP API service, but you can give it a spin from your [Dashboard](https://slidepack.io/app). This document will guide you through HTTP API usage. You will need an API token to interact with SlidePack through the HTTP API. If you don't have an API token, please sign up / sign in to your Dashboard and create one. [Create your API token](https://slidepack.io/app) # Next Up Once you have your API token, proceed to [Quickstart](/md/guides/quickstart.md) to make your first API request. --- # Table of Contents ## Guides - [Quickstart](/md/guides/quickstart.md) - [Template and Data](/md/guides/template-and-data.md) - [API Limits](/md/guides/limits.md) - [Render from Excel](/md/guides/excel.md) ## Reference - [API Endpoints](/md/reference/endpoints.md) - [data.json](/md/reference/data-json.md) ## Recipes - [Repeating template slides](/md/recipes/001-repeat-slides/doc.md) - [Text](/md/recipes/010-text/doc.md) - [Text with options](/md/recipes/011-text-options/doc.md) - [Text styles](/md/recipes/012-text-styles/doc.md) - [Lists](/md/recipes/013-list/doc.md) - [Tables](/md/recipes/020-table/doc.md) - [Table with options](/md/recipes/021-table-options/doc.md) - [Table auto-resize](/md/recipes/022-table-size/doc.md) - [Table data bars](/md/recipes/023-table-databars/doc.md) - [Charts](/md/recipes/030-chart/doc.md) - [Dynamic chart series](/md/recipes/031-chart-dynamic-series/doc.md) - [Chart data point styles](/md/recipes/032-chart-data-point-styles/doc.md) - [Chart label interval](/md/recipes/033-chart-label-interval/doc.md) - [Various types of charts](/md/recipes/034-charts/doc.md) - [Scatter charts](/md/recipes/035-scatter-chart/doc.md) - [Images](/md/recipes/040-image/doc.md) - [Image scaling](/md/recipes/041-image-scaling/doc.md) - [Video](/md/recipes/050-video/doc.md) - [Changing theme colors](/md/recipes/060-theme/doc.md) - [Analytics report](/md/recipes/100-analytics-report/doc.md) - [Product catalog](/md/recipes/101-product-catalog/doc.md) The latest version of this document is available at https://docs.slidepack.io # Quickstart This page will guide you through your first SlidePack render using the HTTP API. You will need an API token to interact with the SlidePack API. If you don't have one, please sign up / sign in to your Dashboard and create your token. [Create your API token](https://slidepack.io/app) ### 1. Prepare your template and data Input to SlidePack is a zip file that contains two things: - `template.pptx` - A PowerPoint presentation with **\{placeholder}** s that will get replaced with the supplied data values. ![A minimal PowerPoint slide that says {title}](/en/images/quickstart-template.png) - `data.json` - Data to populate the template with. For the above template, a minimal data.json looks like: ```json { "slides": [ { "template": 1, "title": "Hello, World!" } ] } ``` Put these two files into a zip archive, and you are ready to start interacting with the API. You can also download and try out one of the [recipes](/md/recipes/index.md). ### 2. Create a Session A Session holds state for a single rendering session. Request to create a session: ```shell curl -X POST "https://slidepack.io/sessions" \ -H 'Authorization: Bearer {API_TOKEN}' ``` Example data returned from POST /sessions: ```json { "session": { "uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36", "created_at": "2020-08-13T13:14:32.000000Z", "rendered_at": null, "render_succeeded": null, "render_slide_count": null, "render_message": null }, "upload": { "action": "https://slidepack-api.s3.ap-northeast-1.amazonaws.com", "method": "POST", "enctype": "multipart/form-data", "params": { "acl": "private", "key": "sessions/zip/f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36.zip", "Content-Type": "application/zip", "X-Amz-Security-Token": "***", "X-Amz-Credential": "***", "X-Amz-Algorithm": "AWS4-HMAC-SHA256", "X-Amz-Date": "20200813T131432Z", "Policy": "***", "X-Amz-Signature": "***" } } } ``` The response includes parameters you need for the next step. ### 3. Upload input zip file You'll be uploading your input zip file directly to SlidePack's S3 bucket. Construct a POST request using values returned from the previous `POST /sessions` request. - Enctype is `multipart/form-data`. - POST URL should equal `upload.action`. - All entries from `upload.params` should be included as form fields. - `file` should be the last form field, pointing to your desired input file. Example request to upload input file: ```shell curl -X POST "https://slidepack-api.s3.ap-northeast-1.amazonaws.com/" \ -F "acl=private" \ -F "key=sessions/zip/{uuid}.zip" \ -F "Content-Type=application/zip" \ -F "X-Amz-Security-Token=***" \ -F "X-Amz-Credential=***" \ -F "X-Amz-Algorithm=AWS4-HMAC-SHA256" \ -F "X-Amz-Date=***" \ -F "Policy=***" \ -F "X-Amz-Signature=***" \ -F "file=@/path/to/your/data.zip" ``` If successful, you'll get a `204 No Content` response. ### 4. Render and download the output We request a render of this session by POSTing to `/render`: Example request to render the output: ```shell curl -X POST "https://slidepack.io/sessions/{uuid}/render" \ -H 'Authorization: Bearer {API_TOKEN}' ``` Example render response: ```shell { "session": { "uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36", "created_at": "2020-08-13T13:14:32.000000Z", "rendered_at": "2020-08-13T13:16:18.000000Z", "render_succeeded": true, "render_slide_count": 5, "render_message": null }, "download_url": "https://slidepack-api.s3.ap-northeast-1.amazonaws.com/..." } ``` Access the `download_url` to retrieve your rendered output file: ```shell curl "https://slidepack-api.s3.ap-northeast-1.amazonaws.com/..." -o output.pptx ``` If you used the minimal example, this is what your output will look like: ![Render output](/en/images/quickstart-output.png) ### Next steps - [Learn more about composing templates and data](/md/guides/template-and-data.md) - [Browse the recipes to get an idea of what's possible with SlidePack](/md/recipes/index.md) - [See the API endpoints reference](/md/reference/endpoints.md) - [Take a look at code samples](https://github.com/qitar/slidepack-examples) The latest version of this document is available at https://docs.slidepack.io