Lister les templates
Get /settings/templates/list
Paramètres :
Nom | Description | Type | Obligatoire |
---|---|---|---|
page | Numéro de la page | Int | Non |
pageSize | Nombre d'éléments à retourner | Int | Non |
Réponse :
Noeud de templates composé de :
Nom | Description | Type | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
templates |
|
Struct |
Langage de programmation :
Exemple de requête :
{ "page": 1, "pageSize": 10 }
Exemple de réponse :
{ "templates" : [ { "id": "g65r4g64h65tr47h678th11d", "templateName": "description-du-template", "description": "description du template", "from": { "address": "from@example.com" "personalName": "Sender name" }, "subject": "Message subject", "htmlContent": "html content", "textContent": "text content", "createdAt": 1447938089, "updatedAt": 1447938089 }, { "id": "h4tr65h4t65h46h54t6h5trd", "templateName": "description-du-template-2", "description": "description du template 2", "from": { "address": "from@example.com" "personalName": "Sender name" }, "subject": "Message subject 2", "htmlContent": "html content 2", "textContent": "text content 2", "createdAt": 1447938189, "updatedAt": 1447938189 } ] }
Exemple de code :
curl -X GET -H "Content-Type: application/json" -H "X-Tipimail-ApiUser:YOUR_SMTP_USERNAME" -H "X-Tipimail-ApiKey:YOUR_SMTP_KEY" https://api.tipimail.com/v1/settings/templates
require 'vendor/autoload.php'; $tipimail = new Tipimail\Tipimail('YOUR_SMTP_USERNAME', 'YOUR_API_KEY'); try { $page = 1; $pageSize = 12; $result = $tipimail->getSettingsService()->getTemplatesService()->getAll($page, $pageSize); var_dump($result); } catch(Tipimail\Exceptions\TipimailException $e) { echo 'Exception received :', $e->getMessage(), "\n"; }