Set Push Template

Sets a push template of the company in the current session.

HTTP Request

POST /api/sonar/push-templates/:type
Request using cURL
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
KeyRequiredTypeDescriptionNote
typeOStringTemplate type
templateXStringTemplate contentMaximum 16MB. If not specified, null (initialize).

Refer to the below table for available template types:

Template typeDescription
explanation_domainSubmission domain. https://DOMAIN format
mail_explain_req_subjectTitle of explanation request email
mail_explain_req_bodyBoby of explanation request email
mail_explain_review_req_subjectTitle of review request email
mail_explain_review_req_bodyBoby of review request email
sms_explain_req_msgExplanation request SMS message
sms_explain_review_req_msgReview request SMS message

Template content can include the below macros:

MacroDescription
$categoryCategory
$emp_keyEmployee number
$emp_nameEmployee name
$emp_titleEmployee title
$urlSubmission URL
$expire_dateSubmission due date (yyyy-MM-dd)
$expire_timeSubmission due time (HH:mm:ss)
$user_noteUser note in case of auto-request

Success Response

{}

Error Responses

Template format is not supported

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."
}
No privileges to set a template

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "no-permission"
}