Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pitops/infobip-js
This is a javascript client that covers partially the API of Infobip for sending SMS.
https://github.com/pitops/infobip-js
infobip-api infobip-api-wrapper sms-api sms-messages
Last synced: about 1 month ago
JSON representation
This is a javascript client that covers partially the API of Infobip for sending SMS.
- Host: GitHub
- URL: https://github.com/pitops/infobip-js
- Owner: pitops
- Created: 2020-03-20T14:07:58.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-20T14:13:17.000Z (almost 5 years ago)
- Last Synced: 2024-11-13T06:43:04.294Z (about 2 months ago)
- Topics: infobip-api, infobip-api-wrapper, sms-api, sms-messages
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Infobip-JS
This is a javascript client that covers **partially** the API of [Infobip](https://infobip.com) for sending SMS.
### Features
- Send single message to single number
- Send single message to multiple numbers
- Preview SMS cost and count
- Support for transliteration
- Supports **only** username/password authentication mechanism### Install
```javascript
npm install @pitops/infobip-js
```### How to use
```javascript
const InfobipAPI = require('infobip-js')// generate client
const InfoBip = new InfobipAPI({
username: 'username',
password: 'password'
})try {
// ** Send single message
// SENDER_ID is not supported in all countries
const res = await InfoBip.from('SENDER_ID')
.to('99812723737')
.message('Test')
.send()
console.log(res)
} catch (err) {
console.error(err)
}try {
// ** Send message to multiple destinations
const res = await InfoBip.from('SENDER_ID')
.to(['99812723737', '9999383883'])
.message('Test')
.send('sms-multi')
console.log(res)
} catch (err) {
console.error(err)
}try {
// ** Get cost estimation on a transliterated message
const res = await InfoBip.message('Test 2')
.transliteration('GREEK')
.preview()
console.log(res)
} catch (err) {
console.error(err)
}
```### Contributions Welcome