POST /{accountId}

Create a new file under your account, either by uploading a file or by modifying an existing .pptx template.

Request Headers

X-API-Key: {apiKey}
Your API key authorizing you to list files under account {accountId}
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation (.pptx file)
Content-Type: image/png
Content-Type: image/jpeg
Store a .pptx template or an image under your account for use in future tailoring operations. Your request body must contain the binary contents of the file. The response will be a JSON object containing a URL to the newly created file.
Content-Type: application/json
Create a new .pptx presentation by modifying an existing .pptx template according to the JSON instructions in the request body. The new presentation will be either returned immediately or stored under your account, according to theAccept header.
Content-Type: multipart/form
Bundle tailoring instructions, a .pptx template to modify, and/or image assets in a single POST operation.
Accept: application/json (default)
Store the resulting file under your account, and return a JSON object containing its URL.
Accept: application/vnd.openxmlformats-officedocument.presentationml.presentation (.pptx file)
Return the modified .pptx directly in the POST response.
Content-Disposition: attachment; filename="<newfilename>"
Assign a specific name for the newly created file. If you don't send this header, the file will get an auto-generated name.

Request Body

If your Content-Type specifies a .pptx or image file type, your request body should contain the binary contents of the file.

If you send Content-Type:application/json, your request body should contain a JSON object with tailoring instructions.

Response

If your request included an Accept header identifying a .pptx file, the response will have a corresponding Content-Type. Otherwise the response will be a JSON object with information about the newly created file.

{
    "url": "https://api.slide-tailor.com/{accountId}/acme-sales-preso.pptx",
    "filename": "acme-sales-preso.pptx",
    "mediatype": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    "length": 241770
}

Error Codes

409
File already exists. The request specified a file name in its Content-Disposition header, but a file with that name already exists. To resolve the problem supply a unique name, remove the Content-Disposition header to allow an auto-generated name, DELETE the existing file, or use PUT to overwrite it.
415
Bad Content-Type. The request included a Content-Type not on the list above.

Example 1: upload template

Upload a .pptx template

Request

POST https://api.slide-tailor.com/{accountId} HTTP/1.1
X-API-Key: {apiKey}
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation

<binary .pptx file>

Response

HTTP/1.1 201 Created
Content-Type: application/json

{
    "url": "https://api.slide-tailor.com/{accountId}/slides-001.pptx",
    "filename": "slides-001.pptx",
    "mediatype": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    "length": 594228
}

Example 2: tailoring operation

Create a new presentation based on a previously uploaded template.

Request

POST https://api.slide-tailor.com/{accountId} HTTP/1.1
X-API-Key: {apiKey}
Content-Type: application/json
Content-Disposition: attachment; filename="acme-sales-preso.pptx"
Accept: application/json

{
    "url": "https://api.slide-tailor.com/{accountId}/slides-001.pptx",
    "filename": "slides-001.pptx",
    "mediatype": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    "length": 594228
}

Response

HTTP/1.1 201 Created
Content-Type: application/json

{
    "url": "https://api.slide-tailor.com/{accountId}/acme-sales-preso.pptx",
    "filename": "acme-sales-preso.pptx",
    "mediatype": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    "length": 604711
}