> For the complete documentation index, see [llms.txt](https://docs.pptxbuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pptxbuilder.com/v1/examples/json-to-pptx.md).

# 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)
```
