TNZ SMSCLI is a lightweight command-line tool that allows users to send SMS messages.
Whether you need to send one-time passwords (OTP), alerts, or general notifications, TNZ SMSCLI makes it fast and easy from your terminal.
If you don't have an account, head to https://www.tnz.co.nz/Customer/SignUp/ and register.
To use the API, an Auth Token is required in the Authorization HTTP header.
To export your Auth Token:
At any time, you can refresh your Auth Token by clicking the button and exporting your new Auth Token. This action will invalidate any apps using your old Auth Token.
Auth Tokens can be used for multiple use-cases, with SubAccount and Department values helping in tracking reporting and billing.
Call the TNZSMSCLI app from your command line (cmd).
TNZSMSCLI.exe "[Mobile]" "[Message]"
TNZSMSCLI.exe "+642100001" "Your verification code is 789456"
Omitting [Mobile] will prompt the user to enter the mobile number into the console.
Omitting [Message] will send the default message: "From [CompanyName], your OTP Code is: [OTPCode]"
Successfully sent [Mobile] the message: [Message]
Failed to send [Error]
- Invalid VariablesFailed to send [401 Unauthorized]
- Invalid Auth TokenFailed to send [500 Internal Server Error]
- API Server FaultNote:
A "Success" response indicates that the API has accepted your parameters, not that the message has been delivered. For a list of error messages, see TNZ API Errors.
TNZSMSCLI.exe "+642100001" "Hi Aaron, your appointment is scheduled for 3pm on Thursday. Reply Y to confirm."
TNZSMSCLI.exe "+642100001"
TNZSMSCLI.exe
Start-Process -FilePath ".\TNZSMSCLI.exe" -ArgumentList '"+642100001", "Your appointment is scheduled for 3pm on Thursday"'
$numbers = Get-Content ".\List of mobile numbers.txt"
foreach ($number in $numbers) {
Start-Process -FilePath ".\TNZSMSCLI.exe" -ArgumentList "$number", '"System outage: The server at domain.com is down."'
}
"+642100001" "Reminder: Run daily tasks."
The TNZSMSCLI.ini contains configuration options:
Parameter | Description | |
---|---|---|
CompanyName | Sets the 'CompanyName' to display in the default SMS message. | |
Auth | Your TNZ API Auth Token. | |
PromptClose | Prompt the user before closing the app (True/False). | |
ApiURL | The TNZ API version and path. |