
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
This is the mksms API implement in js to make it easy to use.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
You need an API_KEY
and API_HASH
, get them on our website https://mksms.cm
To install the package run
$npm i mksms
To use the package you must first import it. here is an example of import.
const mksms = require('mksms');
or
const {Client, Message, Contact} = require('mksms');
const config = {
api_key:"MY_API_KEY",
api_hash:"MY_API_HASH"
};
let client = new mksms.Client(config.api_key,config.api_hash);
client.send_message({
to:{
number:"+237692392932",
name:"jean"
},
body:"hello"
}).subscribe({
error:(error)=>{
//do any thing
},
next:(data)=>{
//do any thing
},
complete:(rep)=>{
//do any thing
}
});
or
var config = {
api_key:"MY_API_KEY",
api_hash:"MY_API_HASH"
};
var contact = new Contact("+237692392932","jean");
var message = new Message(contact,"hello");
var client = new Client(config.api_key,config.api_hash);
client.send_message(message);
This must be done to test the configurations and the proper functioning of the API.
$npm test
or to view test results in the browser
$npm run test:browser
You can change the test configuration in the ./test/data/data.json
file.
{
"test_config":{
"api_key": "BDCAA0C858",
"api_hash": "f7e88b92f324bdd09d195019053a2d613c3ae6c5b1dcadf988c2b18e75770530"
},
"fake_message":{
"to":{
"number":"697898466f",
"name":"moi"
},
"body":"Salut molah"
},
"good_message" :{
"to":{
"number":"697898466",
"name":"moi"
},
"body":"Salut molah"
}
}
or directly from the command line
$npm run test --key="MY_API_KEY" --hash="MY_API_HASH" --number="number" --name="name" --body="message"
In the console
In the browser
NB: the api test fails if api_key and api_hash are not valid.
Params | Type | Default value | Required |
---|---|---|---|
min_date | Date | null | not required |
direction | number | -1 | not required |
read | boolean | false | not required |
timestamp | Date | null | not required |
[]
Params | Type | Default value | Required |
---|---|---|---|
message | Message | true |
{
"success": true,
"cost": 1
}
or there is an error
{
"success": false,
"message": "Invalid ..."
}
Params | Type | Default value | Required |
---|---|---|---|
number | string | true | |
name | string | true |
{
"success": true
}
or there is an error
{
"success": false,
"message": "Invalid ..."
}
Params | Type | Default value | Required |
---|---|---|---|
number | string | true | |
code | string | true |
{
"success": true
}
or there is an error
{
"success": false,
"message": "Invalid ..."
}
This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details
FAQs
A js lib for mksms Api
We found that mksms 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.