Skip to main content
Creating OTP Streams
Updated over a week ago

Streams API in the CommPeak SMS platform provides OTP routes that deliver one-time passwords to users.

To start, select Streams API in the main menu on the left and click Create Streams API

on the page that opens. Then choose OTP in the pop-up window.

The Create New Stream wizard will load. Fill in the necessary information to complete each step.

Step 1: Stream API Details

Start with entering stream details:
​Stream API name - enter a meaningful name to locate the stream quickly.

  • Stream API description - provide more information that will be visible when you open the stream.

  • Add IP - add one or more IP addresses from which you will make API calls. To add an IP, enter it and click Add.

  • Tags - create tags and apply them immediately to categorize your streams and quickly find the ones you need (optional).

  • Default sender - you can use one of the following options:

    • leave it Customized to be able to choose a specific Sender ID from available ones in each request

    • select a specific Sender ID from the dropdown list

    • add a new Sender ID and use it.

Click Save & Next to proceed to the next step.

NOTE
You can save the stream as a draft on each step and then complete the rest at any time later.

Step 2: OTP Code Handling and Generation

Select how you want to proceed with the OTP code generation.

  1. Choose what you want to do about code generation:

    • Under Code handling and generation select I will generate and send the code myself if you generate it yourself.

    • If you want CommPeak to do it for you, select the other option and define the following:

      • OTP code complexity - number of digits in the code

      • Code TTL - code time-to-live

      • Number of failures - the number of mistakes you allow the customer to make before disabling the code

  2. Enable the limit for sending messages using the toggle switch and set the following:

    • Number of messages per recipient - limit for sending messages that will prevent the customer from spamming

    • Cooldown time - if the sending limit is reached, the customer will need to wait this number of minutes before receiving a new message with a code

  3. Click Save & Next to proceed to the next step.

Step 3: Message Content

Create message content for this stream by adding one or more templates dedicated to certain events. Click the plus icon to expand the event creation section.

  1. Enter event data:

    • Event name - create a meaningful name to locate the event quickly.

    • Event key is the key you will use on the request with this specific event template, so the values should be unique on the same stream. Click the information icon for reference on allowed characters.

    • Event message template - enter text that will be sent to subscribers.
      The UTF8 indicator will alert you if you use non-Unicode characters. The single SMS limit will decrease to 70 characters.
      Below the message box, you can see tags. They are pulled from contact fields and used as variables to enable sending personalized messages. For example, you can add name tags, which will include the contact's first or last name in your message.
      ​
      ​IMPORTANT

      OTP CODE tag is required in event message templates.
      ​
      To add a tag, place the cursor in the needed place of your message and click on the tag.

  2. Click Create Template.

  3. Click Next to proceed to the next step.

NOTE

You can add as many event templates as you need to create a different text for each customer. Move the slider to enable or disable a template.

Step 4: Stream Summary

You can review stream details here.

On the right, the API requests' preview is available. You can copy the endpoint or request body right away.

  • OTP Auth Request:

    • code is generated by CommPeak

    • code is generated by you

  • Verification Request

After you click Create Stream, a pop-up appears. You can copy your authorization token here.

Finally, click Done. The new stream will appear at the top of your Streams API table.

Did this answer your question?