2.4.0 • Published 3 years ago

@reallyuseful/youmail-client v2.4.0

Weekly downloads
78
License
MIT
Repository
github
Last release
3 years ago

@reallyuseful/youmail-client

npm dependencies license node

A Node.js interface for the YouMail Spam Caller API (Unofficial)

Use the YouMail Spam Caller API to determine if an incoming phone call is likely to be a spammer.

const { YouMailClient } = require('@reallyuseful/youmail-client');

async function main() {
  const client = new YouMailClient('your api key', 'your api sid');

  // simple lookup
  let result = await client.lookup('caller phone number');

  // advanced lookup (passing in caller ID and/or callee)
  result = await client.lookup({
    callerNumber: 'caller phone number',
    callerId: 'caller’s caller ID',
    calledNumber: 'callee phone number'
  });

  console.log(result.ok); // true if the request succeeded

  console.log(result.spamRisk);
  // 0 = not a spammer
  // 1 = possible spam
  // 2 = highly likely to be spam
  // undefined = no record found

  console.log(result.raw);
  // the full response from YouMail:
  // {
  //   "statusCode": 10000,
  //   "recordFound": true,
  //   "phoneNumber": 9991002000,
  //   "spamRisk": { "level": 1 },
  //   "timestamp": "2016-10-06T00:31:04.362Z"
  // }
}

main()
  .catch(error => console.error(error))
  .then(() => process.exit());
2.3.0

3 years ago

2.2.0

3 years ago

2.4.0

3 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago