File: score.rb

package info (click to toggle)
ruby-telesign 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 104 kB
  • sloc: ruby: 254; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'telesign/rest'

SCORE_RESOURCE = '/v1/score/%{phone_number}'

module Telesign

  # Score provides risk information about a specified phone number.
  class ScoreClient < RestClient

    # Score is an API that delivers reputation scoring based on phone number intelligence, traffic patterns, machine
    # learning, and a global data consortium.
    #
    # See https://developer.telesign.com/docs/score-api for detailed API documentation.
    def score(phone_number, account_lifecycle_event, **params)

      self.post(SCORE_RESOURCE % {:phone_number => phone_number},
                account_lifecycle_event: account_lifecycle_event,
                **params)
    end
  end
end