Connecting to Notifyre via the Twexit API using Node.js
Twilio users can easily make the switch to Notifyre and save on their SMS messaging costs via the Twexit API. The Twexi API allows users to send SMS messages via Notifyre with minimal changes to existing Twilio SMS API code. Sitting on the fence? Read about what makes Notifyre the best SMS API and why switching from Twilio's SMS API can make a huge difference in your business.
Setting up your account
To use the Twexit API, create a Notifyre account and follow the steps below.
Verify your phone number
- Login to the Notifyre dashboard
- If you are a first-time Notifyre user, click on your name in the top right hand corner of the dashboard and select "Profile" from the drop-down menu
- Enter your mobile number into the Phone Number field and click "Verify Number"
- You'll receive an SMS verification code. Enter the SMS code into the pop-up window and click "Verify Number"
Add API Testing Funds
- Add funds to your account to test with. The minimum top up amount is $10.
- While in test mode your account will be able to:
- Send a total of 20 SMS Parts (up to 160 characters per SMS part).
- Send a total of 100 fax pages.
- Our team will call you to verify your details and provide onboarding support. After this call your account limits will be lifted. To have your Notifyre account verified sooner, simply contact our friendly support team and quote your Notifyre account number.
- USA: (866) 620-3220
- AU: 1300 032 936
- Email: support@notifyre.com
Generate an API token
- Navigate to the settings tab on the right side of the Notifyre dashboard and click "Developer" from the drop-down menu
- Select the "API Tokens" tab and click "+New"
See: how to create an API token
Find your account ID
When setting up the Twexit API, you'll need your Notifyre account ID. To find this, simply:
- Navigate to the settings tab on the right side of the Notifyre dashboard and click "Account" from the drop-down menu
- On the "General" tab you'll be able to view your account ID
Using a virtual SMS number
You have the option to use a dedicated virtual mobile number to send and receive SMS via the Twexit API. If you do not setup a virtual mobile number, you will be unable to receive SMS replies.
See: adding a virtual SMS number to your account.
Using a custom SMS sender ID - Only available to Australian customers
You have the option to use a custom alphanumeric sender ID as the sender (from) when sending SMS via the Twexit API. In this case, you will not be able to receive SMS replies from your audience.
See: setting up a custom SMS sender ID on your account.
Sending an SMS message
To start sending SMS via the Twexit API, you must update the Request URL, the account ID and the API token in your existing Twilio API.
1. Update the request URL
To update the request URL, you will need to replace the existing HTTP POST URL:
with Notifyre's Twexit API URL in the Send SMS API endpoint:
2. Update the account ID
To update the account ID, you will need to replace the variable TWILIO_ACCOUNT_SID with your Notifyre account ID. We recommended creating a new variable called NOTIFYRE_ACCOUNT_ID and replacing the Twilio variable with the Notifyre one in the Send SMS API endpoint. Alternatively, you can hardcode your Notifyre account ID.
3. Update the API token
To update the API token, you will need to replace the variable TWILIO_AUTH_TOKEN with your Notifyre API token. We recommend creating a new variable called NOTIFYRE_API_TOKEN and replacing the Twilio variable with the Notifyre one in the Send SMS API endpoint. Alternatively, you can hardcode your Notifyre API token.
Node.js code samples
Sample Node.js Javascript code in the Send SMS API endpoint with Twexit API updated variables: Request URL, Account ID and API token.
Original Twilio Send SMS API call:
Updated Notifyre Twexit SMS API call:
Responses are the same as Twilio's responses. The response should contain:
Current limitations
- The Twexit API does not currently support custom URL Callbacks
- The Twexit API currently only supports the SMS Send API call
- If using a Notifyre system number to send SMS, you will not be able to receive SMS replies (only available when using a dedicated virtual mobile number)