|
88 | 88 | "content": {
|
89 | 89 | "application/json": {
|
90 | 90 | "schema": {
|
| 91 | + "required": [ |
| 92 | + "content", |
| 93 | + "format", |
| 94 | + "metadata", |
| 95 | + "schedule", |
| 96 | + "options" |
| 97 | + ], |
91 | 98 | "properties": {
|
92 | 99 | "template_id": {
|
93 | 100 | "type": "integer",
|
94 | 101 | "example": 1
|
95 | 102 | },
|
96 |
| - "message_content": { |
| 103 | + "content": { |
97 | 104 | "$ref": "#/components/schemas/MessageContentRequest"
|
98 | 105 | },
|
99 |
| - "message_format": { |
| 106 | + "format": { |
100 | 107 | "$ref": "#/components/schemas/MessageFormatRequest"
|
101 | 108 | },
|
102 |
| - "message_metadata": { |
| 109 | + "metadata": { |
103 | 110 | "$ref": "#/components/schemas/MessageMetadataRequest"
|
104 | 111 | },
|
105 |
| - "message_schedule": { |
| 112 | + "schedule": { |
106 | 113 | "$ref": "#/components/schemas/MessageScheduleRequest"
|
107 | 114 | },
|
108 |
| - "message_options": { |
| 115 | + "options": { |
109 | 116 | "$ref": "#/components/schemas/MessageOptionsRequest"
|
110 | 117 | }
|
111 | 118 | },
|
|
232 | 239 | "content": {
|
233 | 240 | "application/json": {
|
234 | 241 | "schema": {
|
| 242 | + "required": [ |
| 243 | + "content", |
| 244 | + "format", |
| 245 | + "schedule", |
| 246 | + "options" |
| 247 | + ], |
235 | 248 | "properties": {
|
236 | 249 | "template_id": {
|
237 | 250 | "type": "integer",
|
238 | 251 | "example": 1
|
239 | 252 | },
|
240 |
| - "message_content": { |
| 253 | + "content": { |
241 | 254 | "$ref": "#/components/schemas/MessageContentRequest"
|
242 | 255 | },
|
243 |
| - "message_format": { |
| 256 | + "format": { |
244 | 257 | "$ref": "#/components/schemas/MessageFormatRequest"
|
245 | 258 | },
|
246 |
| - "message_schedule": { |
| 259 | + "schedule": { |
247 | 260 | "$ref": "#/components/schemas/MessageScheduleRequest"
|
248 | 261 | },
|
249 |
| - "message_options": { |
| 262 | + "options": { |
250 | 263 | "$ref": "#/components/schemas/MessageOptionsRequest"
|
251 | 264 | }
|
252 | 265 | },
|
|
1361 | 1374 | }
|
1362 | 1375 | }
|
1363 | 1376 | }
|
| 1377 | + }, |
| 1378 | + "post": { |
| 1379 | + "tags": [ |
| 1380 | + "templates" |
| 1381 | + ], |
| 1382 | + "summary": "Create a new template.", |
| 1383 | + "description": "Returns a JSON response of created template.", |
| 1384 | + "operationId": "9d9ecb46961f9f456b093c7222c1dd5b", |
| 1385 | + "parameters": [ |
| 1386 | + { |
| 1387 | + "name": "session", |
| 1388 | + "in": "header", |
| 1389 | + "description": "Session ID obtained from authentication", |
| 1390 | + "required": true, |
| 1391 | + "schema": { |
| 1392 | + "type": "string" |
| 1393 | + } |
| 1394 | + } |
| 1395 | + ], |
| 1396 | + "requestBody": { |
| 1397 | + "description": "Pass session credentials", |
| 1398 | + "required": true, |
| 1399 | + "content": { |
| 1400 | + "multipart/form-data": { |
| 1401 | + "schema": { |
| 1402 | + "required": [ |
| 1403 | + "title" |
| 1404 | + ], |
| 1405 | + "properties": { |
| 1406 | + "title": { |
| 1407 | + "type": "string", |
| 1408 | + "example": "Newsletter Template" |
| 1409 | + }, |
| 1410 | + "content": { |
| 1411 | + "type": "string", |
| 1412 | + "example": "<html><body>[CONTENT]</body></html>" |
| 1413 | + }, |
| 1414 | + "text": { |
| 1415 | + "type": "string", |
| 1416 | + "example": "[CONTENT]" |
| 1417 | + }, |
| 1418 | + "file": { |
| 1419 | + "description": "Optional file upload for HTML content", |
| 1420 | + "type": "string", |
| 1421 | + "format": "binary" |
| 1422 | + }, |
| 1423 | + "check_links": { |
| 1424 | + "description": "Check that all links have full URLs", |
| 1425 | + "type": "boolean", |
| 1426 | + "example": true |
| 1427 | + }, |
| 1428 | + "check_images": { |
| 1429 | + "description": "Check that all images have full URLs", |
| 1430 | + "type": "boolean", |
| 1431 | + "example": false |
| 1432 | + }, |
| 1433 | + "check_external_images": { |
| 1434 | + "description": "Check that all external images exist", |
| 1435 | + "type": "boolean", |
| 1436 | + "example": true |
| 1437 | + } |
| 1438 | + }, |
| 1439 | + "type": "object" |
| 1440 | + } |
| 1441 | + } |
| 1442 | + } |
| 1443 | + }, |
| 1444 | + "responses": { |
| 1445 | + "201": { |
| 1446 | + "description": "Success", |
| 1447 | + "content": { |
| 1448 | + "application/json": { |
| 1449 | + "schema": { |
| 1450 | + "type": "array", |
| 1451 | + "items": { |
| 1452 | + "$ref": "#/components/schemas/Template" |
| 1453 | + } |
| 1454 | + } |
| 1455 | + } |
| 1456 | + } |
| 1457 | + }, |
| 1458 | + "403": { |
| 1459 | + "description": "Failure", |
| 1460 | + "content": { |
| 1461 | + "application/json": { |
| 1462 | + "schema": { |
| 1463 | + "$ref": "#/components/schemas/UnauthorizedResponse" |
| 1464 | + } |
| 1465 | + } |
| 1466 | + } |
| 1467 | + }, |
| 1468 | + "422": { |
| 1469 | + "description": "Failure", |
| 1470 | + "content": { |
| 1471 | + "application/json": { |
| 1472 | + "schema": { |
| 1473 | + "$ref": "#/components/schemas/ValidationErrorResponse" |
| 1474 | + } |
| 1475 | + } |
| 1476 | + } |
| 1477 | + } |
| 1478 | + } |
1364 | 1479 | }
|
1365 | 1480 | },
|
1366 | 1481 | "/templates/{templateId}": {
|
|
1419 | 1534 | "components": {
|
1420 | 1535 | "schemas": {
|
1421 | 1536 | "MessageContentRequest": {
|
| 1537 | + "required": [ |
| 1538 | + "subject", |
| 1539 | + "text", |
| 1540 | + "text_message", |
| 1541 | + "footer" |
| 1542 | + ], |
1422 | 1543 | "properties": {
|
1423 | 1544 | "subject": {
|
1424 | 1545 | "type": "string",
|
|
1440 | 1561 | "type": "object"
|
1441 | 1562 | },
|
1442 | 1563 | "MessageFormatRequest": {
|
| 1564 | + "required": [ |
| 1565 | + "html_formated", |
| 1566 | + "send_format", |
| 1567 | + "format_options" |
| 1568 | + ], |
1443 | 1569 | "properties": {
|
1444 | 1570 | "html_formated": {
|
1445 | 1571 | "type": "boolean",
|
|
1481 | 1607 | "type": "object"
|
1482 | 1608 | },
|
1483 | 1609 | "MessageScheduleRequest": {
|
| 1610 | + "required": [ |
| 1611 | + "embargo" |
| 1612 | + ], |
1484 | 1613 | "properties": {
|
1485 | 1614 | "embargo": {
|
1486 | 1615 | "type": "string",
|
|
1509 | 1638 | "type": "object"
|
1510 | 1639 | },
|
1511 | 1640 | "MessageOptionsRequest": {
|
| 1641 | + "required": [ |
| 1642 | + "from_field" |
| 1643 | + ], |
1512 | 1644 | "properties": {
|
1513 | 1645 | "from_field": {
|
1514 | 1646 | "type": "string",
|
|
0 commit comments