
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
An easy way to use Afilnet API services to send SMS, email and voice notifications.
This package is designed to be an easy way to use Afilnet API services. You can send SMS, email and voice notifications using your Afilnet account.
You only need an Afilnet account with enought credits. If you do not have an account, you can create it in a few minutes.
Example
var afilnet = require('afilnet');
afilnet.login(
"account@test.com",
"password",
function(result){
if (result){
console.log("User logged");
}
else {
console.log("Bad credentials");
}
}
);
//You must login correctly or all services will return error bad user/pass
//SEND SIMPLE SMS
afilnet.sms.send(
'to',
'message',
'from',
'scheduledatetime', //Optional, you can set it null
'output', //Optional, you can set it null
function(result){
console.log(result);
}
);
//SEND EMAIL FROM TEMPLATE
afilnet.email.sendFromTemplate(
'to',
'idTemplate',
'params',
'scheduledatetime', //Optional, you can set it as null
'output', //Optional, you can set it as null
function(result){
console.log(result);
}
);
//SEND VOICE TO GROUP
afilnet.voice.sendToGroup(
'countryCode',
'idGroup',
'msg',
'scheduledatetime', //Optional, you can set it as null
'output', //Optional, you can set it as null
function(result){
console.log(result);
},
);
Afilnet is a company dedicated to Cloud Marketing.
With this module we seek to facilitate the use of the services we offer through our API.
We offer support to our clients if they have some trouble with their accounts or our services.
If you notice some error or bugs, feel free to contact us.
We are available in 3 different languages:
ATTENTION: You need an Afilet account with credits to use this module
If you dont have an account, visit our web page and create it.
After that, you will have to buy some credits to be able to send the notifications
We have a promo to test the services which give you 10 credits for free
Once you have an account, we are ready to setup the module in your app:
The first step is require the module.
var afilnet = require('afilnet');
Then login with your account credentials. (You must login correctly or all services will return error bad user/pass)
afilnet.login(
"account@test.com",
"password",
function(result){
if (result){
console.log("User logged");
}
else {
console.log("Bad credentials");
}
}
);
If you have been successfully logged in, we are ready to use the services :)
There are 4 channels availables:
This library use the structure:
afilnet.channel.service(params, callbackFunction);
User has two services:
SMS, Email and Voice have the same services:
If you want to check User parameters you only need to call the object user and the service required.
//GET BALANCE
afilnet.user.getBalance(callback);
//GET USERNAME
var accountUsername = afilnet.user.getUsername();
var accountUsername = afilnet.user.getUsername();
afilnet.user.getBalance(
function(result){
if (result.status=="SUCCESS"){
console.log("I have " + result.result + " credits");
} else { // == "ERROR"
console.log("Error: "+ result.error);
}
}
);
If you want to use SMS you only need to call the object sms and the service required.
//SEND
afilnet.sms.send(
'from',
'to',
'msg',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND FROM TEMPLATE
afilnet.sms.sendFromTemplate(
'to',
'idTemplate',
'params', // (optional)
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND TO GROUP
afilnet.sms.sendToGroup(
'from',
'countryCode',
'idGroup',
'msg',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND TO GROUP FROM TEMPLATE
afilnet.sms.sendToGroupFromTemplate(
'countryCode',
'idGroup',
'idTemplate',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
// GET DELIVERY STATUS
afilnet.sms.getDeliveryStatus('ids', callback);
var to = "34600000000";
var message = "Hey Luke, I want to tell you something... I am your father.";
var from = "Darth Vader";
afilnet.sms.send(
from,
to,
message,
null,
null,
function(result){
if (result.status=="SUCCESS"){
console.log("Nooooo!!!!!11");
} else { // == "ERROR"
console.log("I have not received any sms :(");
}
}
);
If you want to use Email you only need to call the object sms and the service required.
//SEND
afilnet.email.send(
'subject',
'to',
'msg',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND FROM TEMPLATE
afilnet.email.sendFromTemplate(
'to',
'idTemplate',
'params', // (optional)
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND TO GROUP
afilnet.email.sendToGroup(
'subject',
'idGroup',
'msg',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND TO GROUP FROM TEMPLATE
afilnet.email.sendToGroupFromTemplate(
'idGroup',
'idTemplate',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
// GET DELIVERY STATUS
afilnet.email.getDeliveryStatus('ids', callback);
var to = "luke_skywalker@newjediorder.com";
var subject = "I have a surprise for you - Darth Vader";
var message = "<h2>I am your father.</h2><hr><p>Hehehe surprise.</p><p>Best wishes, Darth Vader.</p>";
afilnet.email.send(
subject,
to,
message,
null, // (optional)
null, // (optional)
function(result){
if (result.status=="SUCCESS"){
console.log("Nooooo!!!!!11");
} else { // == "ERROR"
console.log("I have not received any email :(");
}
}
);
If you want to use Voice you only need to call the object sms and the service required.
//SEND
afilnet.voice.send(
'to',
'msg',
'lang', // (optional)
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND FROM TEMPLATE
afilnet.voice.sendFromTemplate(
'to',
'idTemplate',
'params', // (optional)
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND TO GROUP
afilnet.voice.sendToGroup(
'countryCode',
'idGroup',
'msg',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
//SEND TO GROUP FROM TEMPLATE
afilnet.voice.sendToGroupFromTemplate(
'countryCode',
'idGroup',
'idTemplate',
'scheduledatetime', // (optional)
'output', // (optional)
callback
);
// GET DELIVERY STATUS
afilnet.voice.getDeliveryStatus('ids', callback);
var to = "346000000";
var message = "Hey Luke, I want to tell you something... I... am... your father.";
var lang = "EN";
afilnet.voice.send(
to,
message,
null,
null,
lang,
function(result){
if (result.status=="SUCCESS"){
console.log("Wait, what?!... Nooooo!!!!!");
} else { // == "ERROR"
console.log("I have not received any phone call :(");
}
}
);
All services receive similar parameters but all return same JSON object.
The services will return a JSON object with the next structure:
Code | Description --- | --- | --- MISSING_USER | User or email not included MISSING_PASSWORD | Password not included MISSING_CLASS | Class not included MISSING_METHOD | Method not included MISSING_COMPULSORY_PARAM | Compulsory parameter not included INCORRECT_USER_PASSWORD | Incorrect user or password INCORRECT_CLASS | Incorrect class INCORRECT_METHOD | Incorrect method NO_ROUTE_AVAILABLE | There are no available paths for the indicated destination NO_CREDITS | Your balance is insufficient
{"status":"SUCCESS","result":{"messageid":"id_from_message","credits":"credits_spent"}}
{"status":"ERROR","error":"error_message"}
FAQs
An easy way to use Afilnet API services to send SMS, email and voice notifications.
The npm package afilnet receives a total of 3 weekly downloads. As such, afilnet popularity was classified as not popular.
We found that afilnet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.