1.0.3 • Published 5 months ago
pesapress-lookup v1.0.3
PesaPress Lookup
Goal
Make it easy to integrate PesaPress number lookup service into any application to enable number hash decoding. Easy registration with only an email and get your number hash decoded.
Usage
Install
$ npm install pesapress-lookup
Setup
const { PesaPressLookup } = require('pesapress');
const pesapress = new PesaPressLookup();
Register email to get API key
Register a new API key using your email. The API key will only be shown once and should be saved somewhere
const resp = await pesapress.register('myemail@domain.com')
if ( resp ) {
resp.apikey; // api key
resp.dailyCredits; // daily credits
resp.remainingCredits; // remaining daily credits
} else {
// Error that email already exists
}
Check remaining credits
Check the remaining account credits
const resp = await pesapress.status('YOURAPIKEY')
if ( resp ) {
resp.dailyCredits; // daily credits
resp.remainingCredits; // remaining daily credits
} else {
// Error that api key is invalid
}
Get mobile number from hash
Check for a mobile number from a hash.
const resp = await pesapress.search('YOURAPIKEY', 'MOBILENUMBER_HASH')
if ( resp ) {
resp.msisdn; // The decoded number
resp.hashed; // The original hash
} else {
// Error that api key is invalid
}
Contributing
- Fork this repo and make changes in your own fork.
- Commit your changes and push to your fork
git push origin master
- Create a new pull request and submit it back to the project.
Bugs & Issues
To report bugs (or any other issues), use the issues page.