Developer Center

Termii provides RESTful API which is based on simple HTTP POST/GET requests.
Our API lets you create, send, and verify messages, as well as, track your delivery statistics.

Step 1

Visit your dashboard to get a Sender or Device ID

Start
Step 2

Visit user console to get your test or live API key

Start
Step 3

Buy units or get a premium plan to go live

Start

SMS

POST /sapp/sms/api

SMS API URL For Text/Plain SMS


        POST STRING
        https://termii.com/sapp/sms/api?action=send-sms&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=
        &to=PhoneNumber&from=SenderID&sms=YourMessage

        PARAMETERS
        action      : send-sms
        to          : (country code) your phone number eg. 2348109477743
        from        : Your registered and approved sender ID
        sms         : Your message (160 characters amounts to 1 page)
        route_id    : Specific route code for sms messages
                      16 (Non-DND route)
                      117 (DND route - works only for customers who have applied)
        api_key     : Insert your API key (to get your key, login and visit your API console)

        SAMPLE RESPONSE
        
        Display status of the sent sms message
        
        {
        code        : ok,
        message     : Status of the sent message,
        balance     : Mobile unit balance eg. 100,
        user        : Your username on Termii
        }
        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }
        {
        "code"        : "105",
        "message"     : "Country Inactive. Contact Administrator to activate country"
        }
        {
        "code"        : "106",
        "message"     : "Invalid Sender id"
        }
        {
        "code"        : "112",
        "message"     : "Invalid API Key"
        }

SMS API URL For Unicode SMS


        POST STRING
        https://termii.com/sapp/sms/api?action=send-sms&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=
        &to=PhoneNumber&from=SenderID&sms=YourMessage&unicode=1

        PARAMETERS
        action      : send-sms
        to          : (country code) your phone number eg. 2348109477743
        from        : Your registered and approved sender ID
        sms         : Your message (160 characters amounts to 1 page)
        route_id    : Specific route code for sms messages
                      16 (Non-DND route)
                      117 (DND route - works only for customers who have applied)
        unicode     : 1
        api_key     : Insert your API key (To get your key login and visit your api console)

        SAMPLE RESPONSE
        
        Display status of the sent sms message
        
        {
        code        : ok,
        message     : Status of the sent message,
        balance     : Mobile unit balance eg. 100,
        user        : Your username on Termii
        }
        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }
        {
        "code"        : "105",
        "message"     : "Country Inactive. Contact Administrator to activate country"
        }
        {
        "code"        : "106",
        "message"     : "Invalid Sender id"
        }
        {
        "code"        : "112",
        "message"     : "Invalid API Key"
        }

SMS API URL For MMS SMS


        POST STRING
        https://termii.com/sapp/sms/api?action=send-sms&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=
        &to=PhoneNumber&from=SenderID&sms=YourMessage&mms=1&media_url=YourMediaUrl

        PARAMETERS
        action      : send-sms
        to          : (country code) your phone number eg. 2348109477743
        from        : Your registered and approved sender ID
        sms         : Your message (160 characters amounts to 1 page)
        route_id    : Specific route code for sms messages
                      16 (Non-DND route)
                      117 (DND route - works only for customers who have applied)
        media_url   : Your media url (eg. https://www.youtube.com/channel/UC9BJ1Kjsun1-L02L9w-Jtqg)
        mms         : 1
        api_key     : Insert your API key (To get your key login and visit your api console)

        SAMPLE RESPONSE
        
        Display status of the sent sms message
        
        {
        code        : ok,
        message     : Status of the sent message,
        balance     : Mobile unit balance eg. 100,
        user        : Your username on Termii
        }
        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }
        {
        "code"        : "105",
        "message"     : "Country Inactive. Contact Administrator to activate country"
        }
        {
        "code"        : "106",
        "message"     : "Invalid Sender id"
        }
        {
        "code"        : "112",
        "message"     : "Invalid API Key"
        }

SMS API URL For Schedule SMS


        POST STRING
        https://termii.com/sapp/sms/api?action=send-sms&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=
        &to=PhoneNumber&from=SenderID&sms=YourMessage&schedule=YourScheduleTime

        PARAMETERS
        action      : send-sms
        to          : (country code) your phone number eg. 2348109477743
        from        : Your registered and approved sender ID
        sms         : Your message (160 characters amounts to 1 page)
        route_id    : Specific route code for sms messages
                      16 (Non-DND route)
                      117 (DND route - works only for customers who have applied)
        schedule    : Time you want the message to go out (eg. 03/01/2019%205:14%20PM)
        api_key     : Insert your API key (To get your key login and visit your api console)

        SAMPLE RESPONSE
        
        Display status of the sent sms message
        
        {
        code        : ok,
        message     : Status of the sent message,
        balance     : Mobile unit balance eg. 100,
        user        : Your username on Termii
        }
        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }
        {
        "code"        : "105",
        "message"     : "Country Inactive. Contact Administrator to activate country"
        }
        {
        "code"        : "106",
        "message"     : "Invalid Sender id"
        }
        {
        "code"        : "112",
        "message"     : "Invalid API Key"
        }

POST /sapp/sms/api

SMS API For Multiple Numbers


        POST STRING
        https://termii.com/sapp/sms/api?

        PARAMETERS
        action      : send-sms
        to          : [destination1, destination2, destinationN]
        from        : Your registered and approved sender ID
        sms         : Your message (160 characters amounts to 1 page)
        route_id    : Specific route code for sms messages
                      16 (Non-DND route)
                      117 (DND route - works only for customers who have applied)
        api_key     : Insert your API key (To get your key login and visit your api console)

        SAMPLE RESPONSE
        
        Display status of the sent sms message
        
        {
        code        : ok,
        message     : Status of the sent message,
        balance     : Mobile unit balance eg. 100,
        user        : Your username on Termii
        }
        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }
        {
        "code"        : "105",
        "message"     : "Country Inactive. Contact Administrator to activate country"
        }
        {
        "code"        : "106",
        "message"     : "Invalid Sender id"
        }
        {
        "code"        : "112",
        "message"     : "Invalid API Key"
        }

POST /sapp/sms/api

SMS API Callback for 2way messaging (We support only long codes)


        POST STRING
        https://termii.com/sapp/sms/api?

        PARAMETERS
        action      : send-sms
        to          : Message destination address
        from        : Represents your Registered sender ID
        sms         : Your message (160 characters amounts to 1 page)
        route_id    : Specific route code for sms messages
                      16 (Non-DND route)
                      117 (DND route - works only for customers who have applied)
        notify_url  : The URL on your callback server on which the Delivery report will be sent
                    (Should Accept application/json).
        notify_id   : The ID that uniquely identifies the messages awaiting feedback.
        api_key     : Your ApiKey

        Note: Ensure you register a unique keyword and apply for a long code (To apply login to your account)

        SAMPLE RESPONSE
        
        Displays Json response
        

POST /sapp/api/sms/otp/send

Generate and verify secure sms tokens (OTP)




        ALL PARAMETERS
        api_key
            1. Type             : string
            2. Description      : Key that uniquely identifies your request on our system
        message_type
            1. Type             : string
            2. Description      : The type of pin of you want to generate
            3. Possible values  :  NUMERIC, ALPHANUMERIC, HEX,ALPHA
        to
            1. Type             : string
            2. Description      : Message destination address. Addresses must be in international format
                                  (Example: 41793026727)
        from
            1. Type             : string
            2. Description      : Represents a sender ID which can be alphanumeric or numeric.
                                  Alphanumeric sender ID length should be between 3 and 11 characters
                                  (Example: CompanyName). Also the sender ID must be registered on termii
        pin_attempts
            1. Type             : integer
            2. Description      : Number of possible PIN attempts.(minimum value: 1)
        pin_time_to_live
            1. Type             : integer
            2. Description      : PIN time to live. (in minutes. Minimum value: 0(lives on), maximum value:60)
        pin_length
            1. Type             : integer
            2. Description      : Pin Length Minimum value: 4, maximum value:8)
        pin_placeholder
            1. Type             : string
            2. Description      : PIN code placeholder. Right before sending SMS, PIN code placeholder
                                  will be replaced with generated PIN code
        message_text
            1. Type             : string
            2. Description      : Text of a message that will be sent. Message text must contain pin_placeholder
        pin
            1. Type             : string
            2. Description      : PIN Code received on phone
        pin_id
            1. Type             : string
            2. Description      : PIN code ID returned in the Send OTP request


        
POST STRING https://termii.com/sapp/api/sms/otp/send REQUEST A TOKEN {JSON} { "api_key" : "Insert your API key (To get your key login and visit your api console)", "message_type" : "NUMERIC", "to" : "(country code) your phone number eg. 2348109477743", "from" : "NUMERIC or ALPHANUMERIC ID assigned to your account", "route_id" : Specific route code for sms messages 16 (Non-DND route) 117 (DND route - works only for customers who have applied) "pin_attempts" : Insert amount of attempts you want eg. 10, "pin_time_to_live" : Insert expiry of pin (this is in minutes) eg. 2, "pin_length" : Insert length of token eg. 6, "pin_placeholder" : "< pin >", "message_text" : "Your pin is < pin >" } SAMPLE RESPONSE Message delivered { pinId : bcc61c4a-33ee-406b-b2ae-b642aba75645, to : 2348109477744, smsStatus : Message Sent } Parameters Required { api_key : ["The api key field is required."], message_type : ["The message type field is required."], to : ["The to field is required."], pin_placeholder : ["The pin placeholder field is required."], message_text : ["The message text field is required."], pin_attempts : ["The pin attempts field is required."], pin_time_to_live : ["The pin time to live field is required."], pin_length : ["The pin length field is required."] }
POST STRING https://termii.com/sapp/api/sms/otp/verify VERIFY A TOKEN {JSON} { "api_key" : "Insert your API key (To get your key login and visit your api console)", "pin" : "Insert PIN Code received on phone", "pin_id" : "Insert PIN code ID returned in the Send OTP request" } SAMPLE RESPONSE PIN Verified { pinId : 4b4a0ed7-7225-45ee-a938-b58f512fec7u, verified : true, msisdn : 2348109477743, attemptsRemaining : 0 } PIN Expired { pinId : 4b4a0ed7-7225-45ee-a938-b58f512fec7u, verified : Expired, msisdn : 2348109477743 } NOTE: To ensure OTPs are sent, under your header set the following to; Content-Type : application/json Accept : application/json

GET /sapp/sms/api

Balance Check


        GET STRING
        https://termii.com/sapp/sms/api?action=check-balance&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=&response=json

        PARAMETERS
        action      : check-balance
        response    : json response

        SAMPLE RESPONSE
        
        Display mobile unit balance
        
        {
        balance     : 100,
        user        : Termii Webtech,
        country     : Nigeria
        }

        NOTE: Ensure under your header, the following are added;
              Content-Type : application/json
              Accept       : application/json
        



VOICE

POST /sapp/sms/api

API URL For Voice Messages


        POST STRING
        https://termii.com/sapp/sms/api?action=send-sms&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=
        &to=PhoneNumber&from=SenderID&sms=YourMessage&voice=1

        PARAMETERS
        action      : send-sms
        to          : (country code) your phone number eg. 2348109477743
        from        : Your registered and approved sender ID
        sms         : Your message (160 characters amounts to 1 page)
        voice       : 1
        api_key     : Insert your API key (To get your key login and visit your api console)

        SAMPLE RESPONSE
        
        Display status of the sent Voice message
        
        {
        code        : ok,
        message     : Status of the sent message,
        balance     : Mobile unit balance eg. 100,
        user        : Your username on Termii
        }
        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }
        {
        "code"        : "105",
        "message"     : "Country Inactive. Contact Administrator to activate" country
        }
        {
        "code"        : "106",
        "message"     : "Invalid Sender id"
        }
        {
        "code"        : "112",
        "message"     : "Invalid API Key"
        }



WHATSAPP

POST /sapp/sms/api

WhatsApp API URL For Text/Plain messages


        POST STRING
        https://termii.com/sapp/sms/api?action=send-sms&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=
        &to=PhoneNumber&from=DeviceID&sms=YourMessage

        PARAMETERS
        action      : send-sms
        to          : (country code) your destination whatsapp enabled phone number eg. 2348109477743
        from        : Your registered and approved Device ID
        sms         : Your message (160 characters amounts to 1 page)
        route_id    : Specific route code for WhatsApp messages
                      119 (WhatsApp - works only for customers on premium plan)
        api_key     : Insert your API key (to get your key, login and visit your API console)

        SAMPLE RESPONSE
        
        Display status of the sent WhatsApp message
        
        {
        code        : ok,
        message     : Status of the sent message,
        balance     : Mobile unit balance eg. 100,
        user        : Your username on Termii
        }

        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }
        {
        "code"        : "105",
        "message"     : "Country Inactive. Contact Administrator to activate" country
        }
        {
        "code"        : "106",
        "message"     : "Invalid Device id"
        }
        {
        "code"        : "112",
        "message"     : "Invalid API Key"
        }

        NOTE: To ensure messages are sent, under your header set the following to;
              Content-Type : application/json
              Accept       : application/json
        

POST /sapp/api/sms/otp/send

WhatsApp OTP API (Generate and verify secure WhatsApp tokens)




        ALL PARAMETERS
        api_key
            1. Type             : string
            2. Description      : Key that uniquely identifies your request on our system
        message_type
            1. Type             : string
            2. Description      : The type of pin of you want to generate
            3. Possible values  :  NUMERIC, ALPHANUMERIC, HEX,ALPHA
        to
            1. Type             : string
            2. Description      : Message destination WhatsApp number. Number must be in international format
                                  (Example: 2348109477744)
        from
            1. Type             : string
            2. Description      : Represents a Device ID which is numeric.
                                  (Note: Device ID is assigned only to premium customers)
        pin_attempts
            1. Type             : integer
            2. Description      : Number of possible PIN attempts.(minimum value: 1)
        pin_time_to_live
            1. Type             : integer
            2. Description      : PIN time to live. (in minutes. Minimum value: 0(lives on), maximum value:60)
        pin_length
            1. Type             : integer
            2. Description      : Pin Length Minimum value: 4, maximum value:8)
        pin_placeholder
            1. Type             : string
            2. Description      : PIN code placeholder. Right before sending SMS, PIN code placeholder
                                  will be replaced with generated PIN code
        message_text
            1. Type             : string
            2. Description      : Text of a message that will be sent. Message text must contain pin_placeholder
        pin
            1. Type             : string
            2. Description      : PIN Code received on phone
        pin_id
            1. Type             : string
            2. Description      : PIN code ID returned in the Send OTP request
        
POST STRING https://termii.com/sapp/api/sms/otp/send 1. REQUEST A TOKEN {JSON} { "api_key" : "Insert your API key (To get your key login and visit your api console)", "message_type" : "NUMERIC", "to" : "(country code) your WhatsApp enabled phone number eg. 2348109477743", "from" : "NUMERIC ID assigned to your account", "route_id" : Specific route code for WhatsApp messages 119 (WhatsApp - works only for premium customers) "pin_attempts" : Insert amount of attempts you want eg. 10, "pin_time_to_live" : Insert expiry of pin (this is in minutes) eg. 2, "pin_length" : Insert length of token eg. 6, "pin_placeholder" : "< pin >", "message_text" : "Your pin is < pin >" } SAMPLE RESPONSE Message delivered { pinId : bcc61c4a-33ee-406b-b2ae-b642aba73745, to : 2348109477744, smsStatus : Message Sent } Parameters Required { api_key : ["The api key field is required."], message_type : ["The message type field is required."], to : ["The to field is required."], pin_placeholder : ["The pin placeholder field is required."], message_text : ["The message text field is required."], pin_attempts : ["The pin attempts field is required."], pin_time_to_live : ["The pin time to live field is required."], pin_length : ["The pin length field is required."] }
POST STRING https://termii.com/sapp/api/sms/otp/verify 2. VERIFY A TOKEN {JSON} { "api_key" : "Insert your API key (To get your key login and visit your api console)", "pin" : "Insert PIN Code received on WhatsApp", "pin_id" : "Insert PIN code ID returned in the Send OTP request" } SAMPLE RESPONSE PIN Verified { pinId : 4b4a0ed7-7225-45ee-a938-b58f512fec7u, verified : true, msisdn : 2348109477743, attemptsRemaining : 0 } PIN Expired { pinId : 4b4a0ed7-7225-45ee-a938-b58f512fec7u, verified : Expired, msisdn : 2348109477743 } NOTE: To ensure OTPs are sent, under your header set the following to; Content-Type : application/json Accept : application/json



ANALYTICS

GET /sapp/sms/api

SMS API For Delivery Report (All updated sms history)


        GET STRING
        https://termii.com/sapp/sms/api?

        PARAMETERS
        action      : get-inbox
        api_key     : Insert your API key (To get your key login and visit your api console)

        SAMPLE RESPONSE
        
        Display status of all messages sent on your account
        
        {
        id                 : Specific message ID eg. 322307,
        from               : Unique sender ID for sms or device ID for WhatsApp,
        phone              : Your recipient phone number,
        sms                : Message sent to this customer,
        segments           : 1,
        status             : Delivery Status,
        type               : Sms type eg. plain, unicode, etc.
        }

        NOTE: Ensure under your header, the following are added;
              Content-Type : application/json
              Accept       : application/json
        



AUDIENCE

POST /sapp/sms/api

Insert mobile phone contacts into a phone book


        POST STRING
        https://termii.com/sapp/contacts/api?action=&subscribe-us&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSEs=
        &phone_book=YourPhoneBook&phone_number=CustomerPhoneNumber

        PARAMETERS
        action      : subscribe-us
        phone_book  : The name of the phone book you have created
                      on your account (Visit https://termii.com/sapp/user/phone-book to create yours)
        phone_number: (country code) your phone number eg. 2348109477743
        api_key     : Your ApiKey

        SAMPLE RESPONSE
        
        Display status of added phone contacts
        
        {
        code        : ok,
        message     : Subscription successfully done
        }
        
        Error Codes
        
        {
        "code"        : "103",
        "message"     : "Invalid Phone Number"
        }
        {
        "code"        : "104",
        "message"     : "Subscription list not found"
        }
        {
        "code"        : "105",
        "message"     : "You already subscribed"
        }

        NOTE: Ensure under your header, the following are added;
              Content-Type : application/json
              Accept       : application/json
        


SENDER ID

POST /sapp/sms/api

Request for a sms sender ID


https://termii.com/sapp/sms/api?action=register-sender-id&api_key=S2ZCbGZBdERNTmthZ3VxG2JhSE&sender_id=YourSenderID

        PARAMETERS
        action      : register-sender-id
        sender_id   : Input your preferred sender ID (eg. Termii)
        api_key     : Insert your API key (To get your key login and visit your api console)

        SAMPLE RESPONSE
        
        Display status of registered sender ID
        
        {
        code        : 200,
        message     : Sender Id Registration in Progress
        }
        
        Error Codes
        
        {
        "code"        : "100",
        "message"     : "Bad gateway requested"
        }
        {
        "code"        : "101",
        "message"     : "Wrong action"
        }

        NOTE: Ensure under your header, the following are added;
              Content-Type : application/json
              Accept       : application/json