import requests
url = "https://api.pdfshift.io/v3/templates/{slug}"
payload = { "content": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"success": true,
"template": {
"slug": "test-1",
"created": 1734076868000,
"name": "First test for templates"
}
}Update the name or content of a template. Slug cannot be changed.
import requests
url = "https://api.pdfshift.io/v3/templates/{slug}"
payload = { "content": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"success": true,
"template": {
"slug": "test-1",
"created": 1734076868000,
"name": "First test for templates"
}
}