Socket
Socket
Sign inDemoInstall

bouygues-sms

Package Overview
Dependencies
47
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bouygues-sms

To use the Bouygues Telecom SMS unofficial API (5 SMS /day limitation)


Version published
Weekly downloads
2
Maintainers
1
Install size
3.72 MB
Created
Weekly downloads
 

Readme

Source

bouygues-sms

npm version npm

Package to use the Bouygues Telecom SMS unofficial API (5 SMS /day limitation)

Uses calls from this page, and based on this php script

  • ES6 (needs Node.JS >= 6.0.0)
  • 5 SMS /day
  • Quota reset at midnight
  • 160 chars limit (message is truncated after the limit)
  • Error(s) management
  • Only ≈125 lines

Usage

Installation

npm install bouygues-sms

Auth + send "Hello World!" to 0600000000

const Bouygues = require("bouygues-sms");
var sms = new Bouygues("bouygueslogin", "bouyguespassword", 1); // 3rd argument is for debug log (1 for enabled, 0 for disabled)

sms.send("Hello World!", "0600000000", (error) => {
  if(error) {
    console.log("An error occured: " + error.code)
  } else {
    console.log("success");
  }
});

Get quota left

Left quota is checked at sms sending, no need to double check it (don't put a sms.send in the getQuota callback)

sms.getQuota((quota, error) => {
  if(error) {
    console.log("An error occured: " + error.code)
  } else {
    console.log(quota + " sms left today");
  }
})

Send to multiple numbers (up to 5)

sms.send("Hello World!", ["0600000001", "0600000002", "0600000003", "0600000004", "0600000005"], (error) => {
  if(error) {
    console.log("An error occured: " + error.code)
  } else {
    console.log("success");
  }
});

Error codes

CodeMeaning
LOGIN_UNKNOWNLogin page has changed or Bouygues services are down
LOGIN_WRONGCredentials are wrong
QUOTA_EXCEEDEDQuota is exceeded and SMS can't be sent
ERROR_GETQUOTAError getting quota, page has changed or Bouygues services are down
SMS_CONFIRMATIONError at SMS confirmation, page has changed or Bouygues services are down
SMS_RESULTError at SMS result, page has changed or Bouygues services are down

Notes

  • I'm NOT affiliated with Bouygues Telecom or one of its branches
  • This module may not work if Bouygues change the service, then please report it by creating an issue
  • Emojis chars are replaced by a "?" by the Bouygues server ...

Keywords

FAQs

Last updated on 08 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc