# Templating your presentation

There are two methods for including your template PowerPoint file for an API request.&#x20;

&#x20;    [Option 1. Include a URL link to your .pptx template file in your API request.](#option-1-include-your-template-file-using-a-url-link)\
&#x20;    [Option 2. Attach the .pptx template file in your API request. ](#option-2-attach-your-template-file-directly)

## Option 1: Include your template file using a URL link

If your template PowerPoint file is large, it may be optimal to use a downloadable URL link to your template presentation.&#x20;

Here's how to share your template PowerPoint file with the API, via a link:

1\. Save your template PowerPoint presentation somewhere you can create an open download link. Here's how to do it with Google Drive:&#x20;

&#x20;    1.1. Upload your template PowerPoint file to Google Drive.

&#x20;    1.2. Right Click on your file and select ‘Get Link’.

&#x20;    1.3. In the Get link window, make sure the section General access is "Anyone with the link".

&#x20;    1.4. Click the ‘Copy Link’.

&#x20;    1.5. Convert your link from a 'Sharing' link to a 'Download' link using this free tool: <https://sites.google.com/site/gdocs2direct/>

![](/files/syCE687hzTNA2Qg13eqi)

2\. Include the download URL link to your template PowerPoint file in your JSON payload:

```javascript
{
  "presentation": {
    "template": "https://drive.google.com/uc?export=download&id=1-9mrTXvFaVSwJTU7F_3eKJzRY3TUR_tE",
    "export_version": "Pptx2010",
      ....
```

Using this method you will only need to refer to the download link, without needing to send the template file.&#x20;

### Creating your first presentation

<mark style="color:green;">`POST`</mark> `https://gen.powerpointgeneratorapi.com/v1.0/generator/create`

#### Headers

<table><thead><tr><th width="238">Name</th><th width="125">Type</th><th>Description</th></tr></thead><tbody><tr><td>Content-Type<mark style="color:red;">*</mark></td><td>string</td><td>application/x-www-form-urlencoded</td></tr><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td>Bearer authorization token</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="243">Name</th><th width="129">Type</th><th>Description</th></tr></thead><tbody><tr><td>jsonData<mark style="color:red;">*</mark></td><td>string</td><td>JSON payload which contains the presentation definition </td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
Success!
```

{% endtab %}

{% tab title="404" %}

```
Not found!
```

{% endtab %}
{% endtabs %}

## Option 2: Attach your template file directly

If your template PowerPoint file is small, or you have concerns over creating an unrestricted download link to your template presentation, you can opt to send it along with every request to the API:&#x20;

1. Include your template PowerPoint file as a "file" with your POST request to the API.&#x20;
2. Include a reference to your template file by name in the JSON payload:

```javascript
{
  "presentation": {
    "template": "slides_as_template.pptx",
    "export_version": "Pptx2010",
    ....
```

### Creating your first presentation

<mark style="color:green;">`POST`</mark> `https://gen.powerpointgeneratorapi.com/v1.0/generator/create`

#### Headers

| Name                                             | Type   | Description                 |
| ------------------------------------------------ | ------ | --------------------------- |
| Content-Type<mark style="color:red;">\*</mark>   | string | multipart/form-data         |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer authentication token |

#### Request Body

| Name                                       | Type   | Description                                             |
| ------------------------------------------ | ------ | ------------------------------------------------------- |
| files                                      | object | PPTX file used as styling and layout template           |
| jsonData<mark style="color:red;">\*</mark> | string | JSON payload which contains the presentation definition |

{% tabs %}
{% tab title="200 " %}

```
Success 
```

{% endtab %}

{% tab title="404" %}

```
Not found!
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerpointgeneratorapi.com/knowledge-base/slide-as-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
