Mksms
This is the mksms API implement in js to make it easy to use.
Table of contents
- Getting Started
- Prerequisites
- Installing
- Use package
- Import
- Use
- Test
- Documentation of methods
- Authors
- License
Getting Started
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.
Prerequisites
You need an API_KEY
and API_HASH
, get them on our website https://mksms.cm
Installing
To install the package run
$npm i mksms
Use package
To use the package you must first import it. here is an example of import.
Import in nodejs
const mksms = ;
or
const Client Message Contact = ;
Use
const config = api_key:"MY_API_KEY" api_hash:"MY_API_HASH" ; let client = configapi_keyconfigapi_hash; client;
or
var config = api_key:"MY_API_KEY" api_hash:"MY_API_HASH" ; var contact = "+237692392932""jean"; var message = contact"hello"; var client = configapi_keyconfigapi_hash; client;
Test
This must be done to test the configurations and the proper functioning of the API.
Launch the test
$npm test
or to view test results in the browser
$npm run test:browser
Set up the tests
You can change the test configuration in the ./test/data/data.json
file.
or directly from the command line
$npm run test --key="MY_API_KEY" --hash="MY_API_HASH" --number="number" --name="name" --body="message"
Test results
In the console
In the browser
NB: the api test fails if api_key and api_hash are not valid.
Methods docs
Get messages
- name: get_messages
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 |
- return: Promise< Array >
Send messages
- name: send_messages
Params | Type | Default value | Required |
---|---|---|---|
message | Message | true |
- return: Promise< Object >
or there is an error
Start verify
- name: start_verify
Params | Type | Default value | Required |
---|---|---|---|
number | string | true | |
name | string | true |
- return: Promise< Object>
or there is an error
Confirm verify
- name: confirm_verify
Params | Type | Default value | Required |
---|---|---|---|
number | string | true | |
code | string | true |
- return: Promise< Object >
or there is an error
Authors
- Eugene Fezeu - Initial work - @fez2000
License
This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details