@apifonica/sms-sdk

Apifonica SDK for sending SMS messages

Usage no npm install needed!

<script type="module">
  import apifonicaSmsSdk from 'https://cdn.skypack.dev/@apifonica/sms-sdk';
</script>

README

Example usage:

Initialize
const SMS = require('@apifonica/sms-sdk');

// initialize with your account credentials
const sms = new SMS({
  accountSID: ACCOUNT SID,
  authToken: AUTHORIZATION TOKEN,
});
Send message
// the three required options are "from", "to", and "text"
// other options are "msg_app_sid", "channel", "type", "url", "tag"
const options = {
  from: NUMBER TO SEND FROM,
  to: RECIPIENT NUMBER,
  text: MESSAGE TEXT,
};

// the sendSMS method returns a promise
sms.sendSMS(options)

See detailed API information at https://www.apifonica.com/en/docs/api/rest/send-message/

Get message details
// the getSMS method also returns a promise. 
// It expects the SID of the message you're trying to look up
sms.getSMS(message_sid)

See detailed API information at https://www.apifonica.com/en/docs/api/rest/get-message-info/