# JSON to PPTX

## JSON Example

```javascript
{
  "base_settings": {
    "file_name": "test_demo"
  },
  "body": [{
    "table_text": "Demo",
    "question_text": "What is Demo?",
    "base_text": "A Demo is something that is used for presentation!",
    "rows": ["Cardiology", "Endocrinology / Diabetology", "General Practice / Family Medicine", "Internal Medicine", "Other"],
    "columns": [{
      "text": "Total",
      "items": [{
        "text": "Total n=100",
        "base": 100,
        "data": [16, 5, 37, 42, 0]
      }]
    }, {
      "text": "Gender",
      "items": [{
        "text": "Male",
        "base": 100,
        "data": [16, 5, 37, 42, 0]
      }, {
        "text": "Female",
        "base": 100,
        "data": [20, 15, 47, 22, 10]
      }]
    }],
    "view_settings": {
      "slide_master_index": 0,
      "slide_layout_index": 0,
      "placeholder_index": 0,
      "chart_type": "bar"
    }
  }]
}
```

{% hint style="info" %}
This is a minimal example of a `json` data request.
{% endhint %}

#### Python example using [requests](https://requests.readthedocs.io/en/v3.0.0/) library

{% code title="pptx\_request.py" %}

```python
import requests

# preparing body for request
with open('example.json', 'rb') as f:
    body = f.read()

url = 'https://api.pptxbuilder.com/api/v1/convert'
headers = {"content-type": "application/json"}
headers['Authorization'] = 'Bearer ' + '<your-token>'

response = requests.post(url, data=body, headers=headers)
content = response.content
```

{% endcode %}

**Converting request content to pptx with Python**

```python
disposition = response.headers['Content-Disposition']
file_name = disposition.split(';')[-1].strip().split('=')[1]
with open(file_name, 'wb') as w:
    w.write(content)
```


---

# 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.pptxbuilder.com/v1/examples/json-to-pptx.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.
