0.0.3 • Published 6 years ago
gatesms-client v0.0.3
Installation
Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:
npm install gatesms-client --save
How to use:
Connect and authorization:
const ApiClient = require('gatesms-client');
const api = new ApiClient({
url: "http://gatesms.org",
client_id: "YOU_LOGIN",
client_secret: "YOU_APIKEY"
});
Sendmessage:
api.Messages.Send('12345678900', 'Hello', 'TEST')
.then(result => {
console.log(result)
})
.catch(error => {
console.log(error)
});
Get message status:
api.Messages.Status(123)
.then(result => {
console.log(result)
})
.catch(error => {
console.log(error)
});
Get messages list:
api.Messages.List(0,10)
.then(result => {
console.log(result)
})
.catch(error => {
console.log(error)
});
Get messages info:
api.Messages.Info(123)
.then(result => {
console.log(result)
})
.catch(error => {
console.log(error)
});
Get phone info:
api.Phones.Info('123123123')
.then(result => {
console.log(result)
})
.catch(error => {
console.log(error)
});
Get message cost by phone:
api.Phones.Cost('123123123')
.then(result => {
console.log(result)
})
.catch(error => {
console.log(error)
});
Use inside URL shorter:
api.Url.Short('http://google.com/query?sdfsfw=efwef')
.then(result => {
console.log(result)
})
.catch(error => {
console.log(error)
});
License
This bundle is released under the MIT license. Free Software, Hell Yeah!