[Yandex Cloud documentation](../index.md) > [Yandex Cloud Notification Service](index.md) > Getting started > Getting started with SMS

# Getting started with SMS in Yandex Cloud Notification Service

{% note info %}

The service is at the [preview stage](../overview/concepts/launch-stages.md).

{% endnote %}

To enable Cloud Notification Service, request access to the service from your account manager or [technical support](https://center.yandex.cloud/support).

Cloud Notification Service (CNS) is a service for multichannel notifications of users. The service's HTTP API is compatible with the [Amazon SNS API](https://docs.aws.amazon.com/sns/latest/api/welcome.html).

With Cloud Notification Service, you can send [text messages (SMS)](https://en.wikipedia.org/wiki/SMS) using _SMS notification channels_. Russian phone numbers in [E.164](https://en.wikipedia.org/wiki/E.164) format are supported, e.g., `+79991112233`. SMS messages are signed with sender text names. The maximum length of one SMS is 160 Latin characters or 70 Cyrillic characters. Longer texts are sent using multiple SMS messages.


To get started with SMS:
1. [Get your cloud ready](#before-you-begin).
1. [Create an SMS notification channel with a common sender](#create-common-channel).
1. [Add a test phone number](#add-test-number).
1. [Send a test SMS](#send-test-sms).
1. [Create a notification channel with an individual sender](#create-individual-channel).
1. [Create an SMS template](#create-template).
1. [Exit the sandbox](#quit-from-sandbox).

## Get your cloud ready {#before-you-begin}

Sign up for Yandex Cloud and create a [billing account](../billing/concepts/billing-account.md):
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or create a new account.
1. On the **[Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts)** page, make sure you have a billing account linked and it has the `ACTIVE` or `TRIAL_ACTIVE` [status](../billing/concepts/billing-account-statuses.md). If you do not have a billing account, [create one](../billing/quickstart/index.md) and [link](../billing/operations/pin-cloud.md) a cloud to it.

If you have an active billing account, you can create or select a [folder](../resource-manager/concepts/resources-hierarchy.md#folder) for your infrastructure on the [cloud page](https://console.yandex.cloud/cloud).

[Learn more about clouds and folders here](../resource-manager/concepts/resources-hierarchy.md).

## Create an SMS notification channel with a common sender {#create-common-channel}

In Cloud Notification Service, messages to end users are sent through [notification channels](concepts/index.md#channels).

An SMS notification channel with a _shared sender_ is a good option for testing the service's features and has the following advantages:
* You do not have to register the sender's name with the telecom operator.
* No monthly subscription fee is charged.

There are restrictions in place for this type of sender:
* All SMS messages are signed with a shared service name.
* Promotional SMS messages are not allowed.
* A [cloud](../resource-manager/concepts/resources-hierarchy.md#cloud) can contain only one SMS notification channel with a shared sender.
* A channel can only operate in a [sandbox](concepts/sms.md#sandbox) with a limited number of test phone numbers.

To create a channel with a common sender:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder you want to create a notification channel in.
  1. Navigate to **Cloud Notification Service**.
  1. Click **Create notifications channel**.
  1. In the **SMS** tab, select the **Common sender** [sender type](concepts/sms.md#senders) and click **Create**.

{% endlist %}


## Add a test phone number {#add-test-number}.

A _sandbox_ is a test environment, in which you can send SMS messages only to _test phone numbers_.

Each test phone number is registered in a channel using a confirmation code from an SMS. By adding a number, you agree to receive messages to it.

To add a test phone number:

{% list tabs group=instructions %}

- Management console {#console}

  1. Select the notification channel you previously created.
  1. Navigate to the ![image](../_assets/console-icons/handset-arrow-in.svg) **Test numbers** tab.
  1. Click **Add a test phone number**.
  1. In the window that opens, enter a phone number and click **Get code**. An SMS with a confirmation code will be sent to the specified phone number.

      Russian phone numbers in [E.164](https://en.wikipedia.org/wiki/E.164) format are supported, e.g., `+79991112233`.

  1. Enter the code from the SMS and click **Confirm**.

{% endlist %}

## Send a test SMS {#send-test-sms}

{% list tabs group=instructions %}

- Management console {#console}

  1. Next to the test phone number you previously added, click ![image](../_assets/console-icons/ellipsis.svg) and select ![image](../_assets/console-icons/comment.svg) **Send**.
  1. In the window that opens, enter the message text and click **Send**.

{% endlist %}

## Create a notification channel with an individual sender {#create-individual-channel}

{% note info %}

Businesses and individual entrepreneurs can register an individual sender name.

{% endnote %}

After practicing on a channel with a common sender, you can register an SMS notification channel with an individual sender.

An SMS notification channel with an _individual sender_ is suitable for the product environment and has the following advantages:
* All SMS messages are signed with the sender's unique text name.
* After leaving the [sandbox](#sandbox) you can send SMS to any Russian phone numbers in [E.164](https://en.wikipedia.org/wiki/E.164) format.

There are restrictions and rules in place for this type of sender:
* The sender's text name will be registered with the service provider.
* You will be charged a monthly subscription fee for using the sender's text name.
* In the [cloud](../resource-manager/concepts/resources-hierarchy.md#cloud), one sender's text name can correspond to one SMS notification channel.

To create a channel with an individual sender:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder you want to create a notification channel in.
  1. Navigate to **Cloud Notification Service**.
  1. Click **Create notifications channel**.
  1. In the **SMS** tab, select the **Individual sender** sender type.
  1. Specify the sender’s text name of your choice and click **Create**.

{% endlist %}

With that done, a tech support ticket to register the sender's text name will be automatically generated.

{% note info %}

Registering a sender's text name may take from 2 to 4 weeks.

{% endnote %}

When your registration is complete, you will be notified by tech support that you now have access to an individual sender channel.


## Create an SMS template {#create-template}

[SMS templates](concepts/sms.md#templates) allow you to divide SMS notifications into different types, each with its own sending [cost](pricing.md), thus enabling more efficient expense management.

To create an SMS template:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you want to create the template.
  1. Navigate to **Cloud Notification Service**.
  1. In the left-hand panel, select ![route](../_assets/console-icons/route.svg) **Notification channels** and select a channel with an [individual sender](concepts/sms.md#individual-sender) you want to create a template in.
  1. In the left-hand menu, select ![square-chart-bar](../_assets/console-icons/square-chart-bar.svg) **Templates** and click **Create template**. In the window that opens:

      1. In the **Name** field, enter a name for the template.
      1. In the **Type** field, select the type of your new template:

          * `Transaction`: Used to notify about financial transactions, e.g., crediting, debiting, transfer, and reservation of funds, accrual of interest on deposit, etc.
          * `Service`: Used to notify users about the status of services, maintenance works, terms of service updates, etc.
          * `Authorization`: Used to send data required for various authorization procedures, verifications, confirmations of actions/transactions, or consents.
          
          If an SMS notification does not fall under any of these types, it is treated as _advertising_ by default.

      1. In the **Template** field, specify the template body.

          The text of SMS notifications must exactly match the template: the character case as well as the number and type of spaces must match, and the text must not contain any undefined special characters.

          Learn more about template requirements [here](concepts/sms.md#template-contents).
      1. In the **Example message** field, enter a sample text for the SMS notification you intend to send. This notification must match the template you are creating.

          You cannot create a template if the sample message does not match the template specified above.
      1. Click **Create**.

{% endlist %}

Once created, the SMS template will switch to the `Registering` [status](concepts/sms.md#template-status) and will be sent for registration on the telecom provider side. At the same time, a [support](https://center.yandex.cloud/support) ticket will be created. Registering a template takes two to four weeks. Once all telecom providers complete template registration, the template will switch to the `Active` status and be available for use.

## Exit the sandbox {#quit-from-sandbox}

The SMS notification channel with an individual sender is originally created in the [sandbox](concepts/sms.md#sandbox).

After practicing on test phone numbers, you can apply to exit the sandbox mode:

{% list tabs group=instructions %}

- Management console {#console}

  1. Select the individual sender notification channel you created earlier.
  1. Click **Leave sandbox**.

      With that done, a tech support ticket to exit the sandbox will be automatically generated.

      You can also request an increase in the service quotas together with your request to exit the sandbox mode.

{% endlist %}

Once the ticket is approved, you will be able to send SMS messages to any Russian phone numbers in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., `+79991112233`.

## Useful links {#see-also}

* [Getting started with push notifications](quickstart-sms.md)
* [Getting started with the service via the AWS CLI](tools/aws-cli.md)
* [Service overview](concepts/index.md)
* [SMS notification channel](concepts/sms.md)