API Endpoints Reference
This is a list of all SlidePack HTTP API Endpoints.
Authentication
All requests to slidepack.io require authentication. Include your API token in the request header to authenticate.
Example request with authentication
curl "https://slidepack.io/sessions" \
-H "Authorization: Bearer {API_TOKEN}" \
-H "Accept: application/json"
You can create your API token in your Dashboard.
A JSON Schema of API responses is available here.
Errors
When a request fails, the API responds with one of the following status codes and a JSON body with a message.
| Status | Meaning |
|---|---|
401 Unauthorized | The API token is missing or invalid. |
403 Forbidden | The Session is not in a state that allows the request, or rendering failed. |
404 Not Found | The Session does not exist. |
429 Too Many Requests | You have exceeded the rate limit. See the Retry-After header and wait accordingly. |
Zip file uploads go directly to Amazon S3, so their errors are returned by S3 in its own XML format.
Response
- Name
message- Type
- string
- Required?
- No
- Description
- Reason for the error.
Error response
{
"message": "Already rendered."
}
Create a Session
Creates a Session and provides AWS S3 Pre-Signed POST parameters that you will need to upload your zip file.
When creating a new Session, any existing Sessions that haven't been rendered yet are deleted.
All Sessions expire 24 hours after creation, including ones that have been rendered.
Response
- Name
session- Type
- object
- Required?
- No
- Description
- The created Session object.
- Name
upload- Type
- object
- Required?
- No
- Description
- Parameters for uploading the input zip file.
Request
curl -X POST "https://slidepack.io/sessions" \
-H 'Authorization: Bearer {API_TOKEN}' \
-H 'Accept: application/json'
Response
{
"session": {
"uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36",
"created_at": "2020-08-13 13:14:32",
"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": "***"
}
}
}
List Sessions
Retrieves a list of Sessions.
Response
- Name
sessions- Type
- object[]
- Required?
- No
- Description
- Array of Session object summary subsets.
Request
curl "https://slidepack.io/sessions" \
-H 'Authorization: Bearer {API_TOKEN}' \
-H 'Accept: application/json'
Response
{
"sessions": [
{
"uuid": "805bcdc8-4782-4673-9d69-47f7ed0696c8",
"created_at": "2020-08-13 15:10:15",
"rendered_at": "2020-08-13 15:10:20",
"render_succeeded": true
},
{
"uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36",
"created_at": "2020-08-13 13:14:32",
"rendered_at": null,
"render_succeeded": null
}
]
}
Retrieve a Session
Retrieves detailed information about a Session.
Response
- Name
session- Type
- object
- Required?
- No
- Description
- The Session object.
- Name
upload- Type
- object
- Required?
- No
- Description
- Parameters for uploading the input zip file.
Request
curl "https://slidepack.io/sessions/{uuid}" \
-H 'Authorization: Bearer {API_TOKEN}' \
-H 'Accept: application/json'
Response
{
"session": {
"uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36",
"created_at": "2020-08-13 13:14:32",
"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": "***"
}
}
}
Upload zip file
Uploads a zip file for a Session to be used for rendering. The upload request goes directly to our private Amazon S3 bucket using pre-signed parameters.
The input zip file must contain at least two files:
template.pptx- The template PPTX file.data.json- Data to populate the template with.
It may also contain images and videos to embed. The zip file can be named anything you like.
Construct a multipart/form-data request so that:
- The URL is
upload.actionfrom POST /sessions. - All key-value pairs from
upload.paramsfrom POST /sessions are included as parameters (form fields). - Append a
filefield at the end that points to your desired input file.
Form-data parameters expire 1 hour after being issued. Send another request to GET /sessions/{uuid} to get a fresh set of parameters.
Response
204 No Content
Request
curl -X POST "{URL}" \
-F "{KEY}={VALUE}" \
-F "{KEY}={VALUE}" \
...
-F "file=@{ZIP_FILE_PATH}"
Response
Render
Renders your session into an output pptx file and returns the download URL.
Replace {uuid} with your session uuid.
You need to have uploaded your input zip file for your session beforehand.
If rendering fails, the response is a 403 Forbidden error with the reason in message.
We are aware that getting a 403 for all rendering errors is misleading and unhelpful. Improvements are planned for future versions.
Response
- Name
session- Type
- object
- Required?
- No
- Description
- The Session object.
- Name
download_url- Type
- string
- Required?
- No
- Description
- Download URL for your rendered PPTX file.
The download URL expires after 5 minutes. Send a request to POST /sessions/{uuid}/download_url to get a fresh download URL.
Request
curl -X POST "https://slidepack.io/sessions/{uuid}/render" \
-H 'Authorization: Bearer {API_TOKEN}' \
-H 'Accept: application/json'
Response
{
"session": {
"uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36",
"created_at": "2020-08-13 13:14:32",
"rendered_at": "2020-08-13 13:16:18",
"render_succeeded": true,
"render_slide_count": 5,
"render_message": null
},
"download_url": "https://slidepack-api.s3.ap-northeast-1.amazonaws.com/..."
}
Response
{
"message": "template slide number 5 does not exist"
}
Re-issue download URL
Issues a fresh download URL for your rendered output file.
Replace {uuid} with your session uuid.
You need to have rendered your session beforehand.
Response
- Name
session- Type
- object
- Required?
- No
- Description
- The Session object.
- Name
download_url- Type
- string
- Required?
- No
- Description
- Download URL for your rendered PPTX file.
The download URL expires after 5 minutes. Use this endpoint again to get a fresh download URL.
Request
curl -X POST "https://slidepack.io/sessions/{uuid}/download_url" \
-H 'Authorization: Bearer {API_TOKEN}' \
-H 'Accept: application/json'
Response
{
"session": {
"uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36",
"created_at": "2020-08-13 13:14:32",
"rendered_at": "2020-08-13 13:16:18",
"render_succeeded": true,
"render_slide_count": 5,
"render_message": null
},
"download_url": "https://slidepack-api.s3.ap-northeast-1.amazonaws.com/..."
}
The Session object
- Name
uuid- Type
- string
- Required?
- No
- Description
- Unique identifier for the object.
- Name
created_at- Type
- string
- Required?
- No
- Description
- Creation timestamp in UTC, formatted as
YYYY-MM-DD HH:MM:SS.
- Name
rendered_at- Type
- string or null
- Required?
- No
- Description
- Render timestamp in UTC, formatted as
YYYY-MM-DD HH:MM:SS.nullif session has not been rendered yet.
- Name
render_succeeded- Type
- boolean or null
- Required?
- No
- Description
trueif render was successful,falseif not.nullif session has not been rendered yet.
- Name
render_slide_count- Type
- integer or null
- Required?
- No
- Description
- Number of slides rendered if render was successful.
nullif session has not been rendered yet.
- Name
render_message- Type
- string or null
- Required?
- No
- Description
- Error message if render was unsuccessful.
nullif session has not been rendered yet, or render was successful.
The Session object
{
"uuid": "f0155f9f-d3f3-4fa9-9f8d-70f8fd2f9c36",
"created_at": "2020-08-13 13:14:32",
"rendered_at": "2020-08-13 14:16:20",
"render_succeeded": true,
"render_slide_count": 5,
"render_message": null
}