Create a Channel
  • 16 Feb 2024
  • 1 Minute to read

    Create a Channel


      Article Summary

      Overview

      The Verify API enables you to generate, send, and verify OTP codes for the SMS channel. In this regard, in order to send OTP codes, you must create a channel for your brand just once. Creating a channel, you will have predefined templates for 10 languages by default.

      Endpoint and Headers

      POST https://verify.useinsider.com/v1/channel/create

      Headers

      HeaderSample ValueDescription
      X-INS-AUTH-KEY1a2b3c4d5e6fThis key is required to authorize your request. Refer to API Authentication Tokens to generate your token.
      Content-Typeapplication/jsonThis header specifies the media type of the resource.

      Body Parameters

      ParameterDescriptionData TypeRequiredRules
      channelChannel that you will send the OTP code. StringYesoneof:sms
      brandNameYour brand name defines your OTP SMS content in pre-defined templates.StringYesmin:3 max:30 characters

      Sample Example

      Sample Request

      Every request made to the request endpoint requires a request body formatted in JSON and containing your parameters. 

      Your title goes here
      Make sure to replace the sample values in the request header(s) and body where required before sending your request.
      curl --location 'https://verify.useinsider.com/v1/channel/create' \
      --header 'Content-Type: application/json' \
      --header 'x-ins-auth-key: 1a2b3c4d5e6f' \
      --data '{
          "channel": "sms",
          "brandName": "YourBrandName"
      }'

      Sample Responses

      201 Created

      {
          "status": "success"
      }

      400 Bad Request

      {
          "errors": [
              {
                  "message": "invalid request payload"
              }
          ]
      }

      400 Bad Request

      {
          "errors": [
              {
                  "message": "this field must be one of these:sms",
                  "field": "channel"
              }
          ]
      }

      401 Unauthorized

      {
          "errors": [
              {
                  "message": "unauthorized"
              }
          ]
      }

      429 Too Many Requests

      {
          "errors": [
              {
                  "message": "rate limit exceeded"
              }
          ]
      }

      500 Internal Server Error

      {
          "errors": [
              {
                  "message": "channel already exists"
              }
          ]
      }

      500 Internal Server Error

      {
          "errors": [
              {
                  "message": "server error"
              }
          ]
      }

      Limitations

      • All functions must be executed with a simple HTTPS POST request.
      • The API Key should be provided as the authorization key on the request header. If the key is incorrect, the operation will not be executed and an authorization error will return in the response.

      Was this article helpful?


      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses