The Response Templates API provides endpoints to handle records in the Response Templates [sn_templated_snip_note_template] table.

This script include requires the Templated Responses plugin (com.sn_templated_snip), which is activated by default, and runs within the sn_templated_snip namespace.

For additional information on response templates, see Response templates.

Response Templates - POST /response_templates/get_templates

Returns records from the Response Templates [sn_templated_snip_note_template] table.

URL format

Default URL: /api/sn_templated_snip/response_templates/get_templates

Supported request parameters

Table 1. Path parameters
Name Description
None
Table 2. Query parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 4. Request headers
Header Description
Accept Data format of the response body. Only supports application/json.
Content-Type Data format of the request body. Only supports application/json.
Table 5. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Table 6. Status codes
Status code Description
200 Successful. The request was successfully processed.
401 Unauthorized. The user credentials are incorrect or have not been passed.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON or XML)

Example: Sample cURL request

curl "https://instance.service-now.com/api/sn_templated_snip/response_templates/get_templates" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
  \"tableName\": \"sn_hr_core_case_total_rewards\",
  \"recordId\": \"2c9e43320b30220097432da0d5673a9c\"
}" \
--user "username":"password"
{
   "result": [
      {
         "sys_id": "2552c4ec0b03320036e62c7885673a5a",
         "name": "Escalation Notes - Total Rewards",
         "short_name": "Escalation Notes - Total Rewards",
         "template_body": "<p>Dear ${subject_person},<\/p>\n<p>Please note that your case ${number} has been escalated to ${assignment_group}. An agent will be assigned on your case and will keep you updated. If you have more questions please reach out to our team.<\/p>\n<p>Regards,<\/p>\n<p>${sys_updated_by}<\/p>"
      },
      {
         "sys_id": "698388ec0b03320036e62c7885673ab5",
         "name": "Resolution Notes - Phone Inquiry",
         "short_name": "Resolution Notes - Phone Inquiry",
         "template_body": "<p>Thank you ${subject_person} for reaching out to the Global HR Services Team for your inquiry. As discussed over the phone, we have resolved your case ${number}.<\/p>\n<p>We are happy to help if you have more questions for our team. Please reach out and mention the case number ${number} on the call.<\/p>\n<p>Regards,<\/p>\n<p>${assigned_to}<\/p>"
      }
   ]
}