NodeJS
The NodeJS library is compatible with our HTTP and REST messaging APIs to interact with the Clickatell SMS Gateway. The NodeJS library below allows you to send one-way and two-way SMS messages using Clickatell’s SMS Platform.
Inside the test.js file is an example implementation of the REST and HTTP API. Simply use the Clickatell platform package and use one of the methods to send. Add the message you want to send, the number you’re sending to, and the API key.
var clickatell = require( "clickatell-platform" ); //clickatell.sendMessageRest("Hello testing message", ["27XXXXX-NUMBER"], "APIKEY-HERE"); clickatell.sendMessageHttp( "Hello testing message" , [ "27XXXXX-NUMBER" ], "APIKEY-HERE" ); |
Run the code
Simply create a file called test.js and add the code above. Trigger the sending by running “node test.js” in your terminal. Remember to add the number you are sending to and your API Key to be able to send successfully.
node test.js |
Handling API callbacks
Create a file called server.js, paste the code below into it, and save. It has an express post method pointing to yourdomain.com/sms that you will use to send the callback posts to your platform API in order to read the callback information.
Run the code by typing “node server.js.” It will start to run on port 80. Make sure it’s working correctly by navigating to yourdomain.com.
node server.js" |
const express = require( 'express' ) const bodyParser = require( 'body-parser' ) const app = express() const http = require( 'http' ) const port = 80 const server = http.createServer(app) app.use(bodyParser.urlencoded({ // to support URL-encoded bodies extended: true })); app.use( bodyParser.json() ); // to support JSON-encoded bodies app.use(express.json()); // to support JSON-encoded bodies app.use(express.urlencoded()); // to support URL-encoded bodies server.listen(port, (err) => { if (err) { return console.log( 'something bad happened' , err) } console.log(`server is listening on ${port}`); app.get( '/' , function (req, res) { res.send( 'It' s working ') }) app.post(' /sms ', function (req, res) { const body = req.body console.log(body); res.set(' Content-Type ', ' text/plain') res.send(`You sent: ${body}`) }) }) |
Once you’ve sent an SMS, the following data will be returned in the callback:
DELIVERED_TO_GATEWAY:
- integrationName
- messageId
- requestId
- clientMessageId
- to
- from
- statusCode
- status
- statusDescription
- timestamp
RECEIVED_BY_RECIPIENT:
- integrationName
- messageId
- requestId
- clientMessageId
- to
- from
- statusCode
- status
- statusDescription
- timestamp
Channels
Find the most up-to-date information about the channels available to communicate with your clients.

SMS
Enable any application, website or system to facilitate local or international one- or two-way SMS communication via an easy one-step integration with our HTTP API.
Documentation

One API
Communicate with your mobile customers via multiple communication channels with a single integration. You can send and receive messages on both WhatsApp and SMS without the overhead of programming individual channels.
Documentation

As an authorized WhatsApp Business Solution Provider, we assist you in applying for a WhatsApp Business account and number. Integrate with other powerful features available on our platform via our One API.
Documentation
Products
Find the most up-to-date information about the products we offer and how to elevate your engagement with customers.

Chat 2 Pay
Send payment requests to customers via chat for secure, contactless payment experiences.
Documentation

Chat Desk
An easy-to-use web-based application that enables real-time communication with your customers via a single web interface.
Documentation

Chat Flow
A web-based application that allows you to quickly and collaboratively design and deploy conversational experiences across multiple chat applications and connect it to your organization's core functional APIs.
Documentation

Campaign Manager
An online tool that allows you to create a custom SMS campaign within minutes - no coding or developers required.
Documentation
Marketplace
Find the most up-to-date information about Clickatell's Marketplace and how you can utilize it for the distribution and payment acceptance of digital products.
Bank Interfaces API
An explanation of the way Clickatell and banks interact with one another when dealing with purchases.
Documentation
Transact Result API
Initiates the delivery of the transaction result for a purchase that was made through Clickatell after Clickatell facilitated the dispensing of the product.
Documentation
Reserve and Transact API
Initiates a purchase and fund reservation request to Clickatell.
Documentation
Security Service API
Request authentication tokens to use in all other Clickatell API calls.
Documentation
Transact
A cloud-based platform that allows for the distribution and payment acceptance of multiple digital products.
Documentation
In-Flight Transaction Check API
Used prior to a purchase instruction to confirm that no similar transaction is in progress.
Documentation
User Transaction Lookup API
Identify if a new transaction is similar to one of the user's recent transactions so the response details can be used to pre-emptively complete the current transaction details.
Documentation
Customer Account Validation API
Validate a customer's bill payment account number prior to submitting the bill payment purchase request to the vendor.
Documentation
MNO Lookup API
Derive the specific mobile network operator (MNO) for the specified MSISDN.
Documentation
Token Lookup API
Look up tokens/vouchers to present back to the buyer/customer who purchased token-related products via Clickatell's platform.
Documentation
Notifications API
Send notifications to buyer/recipient using different channels.
Documentation
Transaction Lookup API
Used after a purchase to confirm the transaction status.
Documentation
Financial Terms Lookup API
Display the correct fee and settlement amounts as per the contractual agreement for the SKU being purchased.
Documentation
Other Resources
Ask the Community
Visit Stack Overflow to join our community of developers and find the answer you need
Contact Support
Contact our support team and one of our agents will be in touch with you to answer any questions you have