VoIP Number
  • 🎉 Getting started
    • Overview
  • 🔩Components
    • Connection
    • Trunk
    • AI Agent
    • Number
    • Call Flow
  • 🧙‍♂️Tools and Features
    • AI Agent 👨‍🎤
    • Audio codecs 🎚️
    • Real time speech translation 🗣️
    • Elastic SIP trunking 🛫 ✈️
    • HD voice ⚡️
    • Voicemail with audio transcription 📫📝
    • Call Flow Builder 👷🏼🔧
    • Email notifications 📬
    • Storage 📦
  • 👩‍🎤Reporting
    • SMS/MMS
    • Calls
    • Billing
  • 💡Popular use cases
    • AI Agent with Groq LLM
    • Voicemail Trunk
    • Translate speech in a real time
    • Translate speech in a real time back to the caller
    • Making outbound calls to PSTN/mobile
    • Echo 🔊
    • Play text announcement
    • Play audio announcement
    • IVR with user input, bridge and voicemail
    • Voicemail box
    • Calling to voicemail and listening/managing your messages
  • 🐶knowledge
    • Languages supported by real time speech translation 🗣️
  • 🦮Guides
    • Register a Softphone (SIP phone)
    • Register IP desk phone
    • Changing Plan (membership)
    • Removing your account
  • 📖API Reference
    • SMS/MMS
  • 📽️Videos
    • Basics
    • AI Agents
    • Setup a real time speech translation
    • Audio call with real time speech translation
    • Real time speech translation with 841 ms latency
Powered by GitBook
On this page
  • Install API SDK
  • Send SMS
  • Response to Send SMS request
  • Receive SMS
  1. API Reference

SMS/MMS

PreviousRemoving your accountNextBasics

Last updated 1 year ago

With VoIP Number you can send SMS to any number in the world programmatically, straight from your app. Simply follow these steps

Install API SDK

npm i voipnumber

Send SMS

const voipnumber = require('voipnumber')('accountId','apiToken');

const from = '+447445459147';
const to = '+447483866525';

voipnumber.sms.send(from, to, 'Thank you').then((res) => {
    console.log(res);
}).catch((err) => {
    console.log(err);
});
{
  status: 'OK',
  result: {
    status: 'OK',
    result: {
      status: 'queued',
      body: 'Thank you',
      timestamp_s: 1716193717,
      created: '20 May 2024 08:28:37',
      id: 'feefcc83-d6ae-4580-b4dc-6ee16b37ff04'
    }
  }
}

First number (from) must belong to your account on and must have SMS capabilities. You will find your accountId and apiToken on the Settings page at

You can change your API token anytime by clicking GENERATE

Response to Send SMS request

{
  status: 'OK',
  result: {
    status: 'OK',
    result: {
      status: 'queued',
      body: 'Thank you',
      timestamp_s: 1716193717,
      created: '20 May 2024 08:28:37',
      id: 'feefcc83-d6ae-4580-b4dc-6ee16b37ff04'
    }
  }
}
{
  status: 'Error',
  result: { error_code: 'USER_NOT_FOUND', error: 'User not found' }
}

On success response contains

  • status: will be set to queued , you will see when it changes to delivered on your Messaging page at app.voipnumber.net/messaging

  • body: text sent in the SMS

  • timestamp_s: number of seconds which have passed since UNIX epoch (1 January 1970)

  • created: same timestamp but in human-readable format

On error, an error code and error description is returned. These are possible values

Error code
Description

AccountId not set or empty

API token not set or empty

User with this AccountId cannot be found

API token doesn't match AccountId

Number doesn't exist on VoIP Number

Number doesn't belong to this account

Coding syntax error

Receive SMS

Make sure the url you will set can receive a call from public network. Our message is sent to your webhook from api.voipnumber.net in JSON format and contains Host: 'api.voipnumber.net' header that you can use for authorization check

headers: {
    'Content-Type': 'application/json',
    Host: 'api.voipnumber.net',
    'X-Forwarded-Port': '443',
    'X-Forwarded-Proto': 'https'
},

Our message to your webhook contains following data

{
      status: 'received',
      from: '+447445459147',
      to: '+447476553275',
      type: 'sms' | 'mms',
      body: 'text sent in SMS',
      mdr_timestamp_s: 1716204585,
      mdr_created: '20 May 2024 11:29:45',
      mdr_id: 'da84a7b1-1a80-4e96-885e-e719d5ec909c'
}

id: the reference to the SMS that you will also find on Messaging Data Records page on your account at

A number with SMS capability can send and receive SMS. To receive an SMS sent to your Number configure a webhook for that Number at

where mdr_timestamp_s, mdr_created and mdr_id refer to the Messaging Data Record created on receipt of this SMS/MMS message. Every SMS/MMS message is reported on the Messaging Data Records page at (SMS/MMS). You will also see there if your webhook was called and what was the (HTTPs) status code returned by your infrastructure through that call

USER_ACCOUNT_MISSING
API_TOKEN_MISSING
USER_NOT_FOUND
API_TOKEN_INVALID
NUMBER_NOT_FOUND
NUMBER_OWNERSHIP
MESSAGE_INVALID
app.voipnumber.net/messaging
app.voipnumber.net/numbers
app.voipnumber.net/messaging
📖
Page cover image
API SDK
VoIP Number
app.voipnumber.net/settings
Credentials for your API SDK access
SMS logs
Inbound SMS logs