ghasedak-node
v2.0.0
Published
Ghasedak SMS API
Downloads
2
Readme
install
You can simply install and use ghasedak nodejs library from npm:
npm install --save ghasedak-node
or from yarn:
yarn install ghasedak-node
usage
Import ghasedak
package:
const Ghasedak = require("ghasedak");
You need a Ghasedak account. Register and get your API key.
Create an instance from Ghasedak
with your API key:
let ghasedak = Ghasedak(
"3ef8539ba50c06b2a11d674c8a7ded7d7360d7b090b5146ff0761e8d9927bd31"
);
with promise
ghasedak
.send({
message: "Hello World!",
receptor: "09xxxxxxxxx",
linenumber: "300002525"
})
.then(res => {
// ... check documentation for response type
// https://ghasedak.io/docs
})
.catch(error => {});
with async/await
async () => {
try {
await ghasedak.send({
message: "Hello World!",
receptor: "09xxxxxxxxx",
linenumber: "300002525"
});
} catch (e) {}
};