sms_templates
Creates, updates, deletes, gets or lists a sms_templates resource.
Overview​
| Name | sms_templates |
| Type | Resource |
| Id | okta.templates.sms_templates |
Fields​
The following fields are returned by SELECT queries:
- get_sms_template
- list_sms_templates
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | Human-readable name of the Template |
created | string (date-time) | |
lastUpdated | string (date-time) | |
template | string | Text of the Template, including any macros |
translations | string | - Template translations are optionally provided when you want to localize the SMS messages. Translations are provided as an object that contains key:value pairs: the language and the translated Template text. The key portion is a two-letter country code that conforms to ISO 639-1. The value is the translated SMS Template. - Just like with regular SMS Templates, the length of the SMS message can't exceed 160 characters. (opaque JSON object) |
type | string | Type of the Template (SMS_VERIFY_CODE) |
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | Human-readable name of the Template |
created | string (date-time) | |
lastUpdated | string (date-time) | |
template | string | Text of the Template, including any macros |
translations | string | - Template translations are optionally provided when you want to localize the SMS messages. Translations are provided as an object that contains key:value pairs: the language and the translated Template text. The key portion is a two-letter country code that conforms to ISO 639-1. The value is the translated SMS Template. - Just like with regular SMS Templates, the length of the SMS message can't exceed 160 characters. (opaque JSON object) |
type | string | Type of the Template (SMS_VERIFY_CODE) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_sms_template | select | templateId, subdomain | Retrieves a specific template by id | |
list_sms_templates | select | subdomain | templateType | Lists all custom SMS templates. A subset of templates can be returned that match a template type. |
create_sms_template | insert | subdomain | Creates a new custom SMS template | |
update_sms_template | update | templateId, subdomain | Updates only some of the SMS Template properties: * All properties within the custom SMS Template that have values are updated. * Any translation that doesn't exist is added. * Any translation with a null or empty value is removed. * Any translation with non-empty/null value is updated. | |
replace_sms_template | replace | templateId, subdomain | Replaces the SMS Template > Notes: You can't update the default SMS Template. | |
delete_sms_template | delete | templateId, subdomain | Deletes an SMS template |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
subdomain | string | (default: my-org) |
templateId | string | id of the Template |
templateType | string |
SELECT examples​
- get_sms_template
- list_sms_templates
Retrieves a specific template by id
SELECT
id,
name,
created,
lastUpdated,
template,
translations,
type
FROM okta.templates.sms_templates
WHERE templateId = '{{ templateId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
Lists all custom SMS templates. A subset of templates can be returned that match a template type.
SELECT
id,
name,
created,
lastUpdated,
template,
translations,
type
FROM okta.templates.sms_templates
WHERE subdomain = '{{ subdomain }}' -- required
AND templateType = '{{ templateType }}'
;
INSERT examples​
- create_sms_template
- Manifest
Creates a new custom SMS template
INSERT INTO okta.templates.sms_templates (
name,
template,
translations,
type,
subdomain
)
SELECT
'{{ name }}',
'{{ template }}',
'{{ translations }}',
'{{ type }}',
'{{ subdomain }}'
RETURNING
id,
name,
created,
lastUpdated,
template,
translations,
type
;
# Description fields are for documentation purposes
- name: sms_templates
props:
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the sms_templates resource.
- name: name
value: "{{ name }}"
description: |
Human-readable name of the Template
- name: template
value: "{{ template }}"
description: |
Text of the Template, including any [macros](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Template/)
- name: translations
value: "{{ translations }}"
description: |
- Template translations are optionally provided when you want to localize the SMS messages. Translations are provided as an object that contains `key:value` pairs: the language and the translated Template text. The key portion is a two-letter country code that conforms to [ISO 639-1](https://www.loc.gov/standards/iso639-2/php/code_list.php). The value is the translated SMS Template.
- Just like with regular SMS Templates, the length of the SMS message can't exceed 160 characters.
(opaque JSON object)
- name: type
value: "{{ type }}"
description: |
Type of the Template
valid_values: ['SMS_VERIFY_CODE']
UPDATE examples​
- update_sms_template
Updates only some of the SMS Template properties:
* All properties within the custom SMS Template that have values are updated.
* Any translation that doesn't exist is added.
* Any translation with a null or empty value is removed.
* Any translation with non-empty/null value is updated.
UPDATE okta.templates.sms_templates
SET
name = '{{ name }}',
template = '{{ template }}',
translations = '{{ translations }}',
type = '{{ type }}'
WHERE
templateId = '{{ templateId }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
created,
lastUpdated,
template,
translations,
type;
REPLACE examples​
- replace_sms_template
Replaces the SMS Template
> Notes: You can't update the default SMS Template.
REPLACE okta.templates.sms_templates
SET
name = '{{ name }}',
template = '{{ template }}',
translations = '{{ translations }}',
type = '{{ type }}'
WHERE
templateId = '{{ templateId }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
created,
lastUpdated,
template,
translations,
type;
DELETE examples​
- delete_sms_template
Deletes an SMS template
DELETE FROM okta.templates.sms_templates
WHERE templateId = '{{ templateId }}' --required
AND subdomain = '{{ subdomain }}' --required
;