Set Notification Template
Sets a notification template of the company in the current session. You can check the currently configured value using the Get Notification Template API.
Required Permissions
Requires the Cluster Administrator role.
HTTP Request
POST /api/sonar/push-templates/:type
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d template="$emp_name $emp_title, check your inbox for explanation request email." \
-X POST \
https://HOSTNAME/api/sonar/push-templates/sms_explain_req_msg
Request Parameters
Path Parameters
| Key | Type | Description | Note |
|---|---|---|---|
| type | String | Template type |
Request Body Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| template | No | String | Template content | Maximum 16MB. If not specified, null (initialize). For types whose name ends in _body (except mail_ticket_alarm_body), the content is HTML-sanitized before being saved; other types are saved as is without sanitization. Some types support macro substitution (see below) |
| locale | No | String | Language code | en, ko, ja, zh |
Refer to the below table for available template types:
| Template type | Description |
|---|---|
| explanation_domain | Submission domain. https://DOMAIN format |
| mail_explain_req_subject | Title of explanation request email |
| mail_explain_req_body | Body of explanation request email |
| mail_explain_review_req_subject | Title of review request email |
| mail_explain_review_req_body | Body of review request email |
| sms_explain_req_msg | Explanation request SMS message |
| sms_explain_review_req_msg | Review request SMS message |
| mail_explain_complete_subject | Title of explanation completion email |
| mail_explain_complete_body | Body of explanation completion email |
| mail_user_verification_subject | Title of MFA verification code email |
| mail_user_verification_body | Body of MFA verification code email |
| mail_report_subject | Title of report email |
| mail_report_body | Body of report email |
| mail_default_body | Default mail body (body template used by the sonar-sendmail command, also used as a fallback when the playbook mail body is not configured) |
| mail_playbook_body | Playbook mail body |
| mail_ticket_alarm_subject | Title of ticket alarm email |
| mail_ticket_alarm_body | Body of ticket alarm email |
The following macros apply only to the six mail title/body types mail_explain_req_subject, mail_explain_req_body, mail_explain_review_req_subject, mail_explain_review_req_body, mail_explain_complete_subject, and mail_explain_complete_body, and are substituted with actual values when an explanation request is sent. The macros used by other types depend on the sending logic of the corresponding feature.
| Macro | Description |
|---|---|
| $category | Category |
| $emp_key | Employee number |
| $emp_name | Employee name |
| $emp_title | Employee title |
| $url | Submission URL |
| $expire_date | Submission due date (yyyy-MM-dd) |
| $expire_time | Submission due time (HH:mm:ss) |
| $user_note | User note in case of auto-request |
Success Response
{}
Error Responses
Permission denied
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}
type is not a supported type code
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "type should be one of explanation_domain, mail_explain_req_subject, mail_explain_req_body, mail_explain_review_req_subject, mail_explain_review_req_body, sms_explain_req_msg, sms_explain_review_req_msg, mail_explain_complete_subject, mail_explain_complete_body, mail_user_verification_subject, mail_user_verification_body, mail_report_subject, mail_report_body, mail_default_body, mail_playbook_body, mail_ticket_alarm_subject, mail_ticket_alarm_body."
}
Unsupported locale value
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "'de' is unsupported locale."
}