@@ -13,22 +13,29 @@ class NetworkNumberVerification < Namespace
13
13
14
14
self . request_body = JSON
15
15
16
- # Make fraud check requests with a phone number by looking up fraud score and/or by checking sim swap status .
16
+ # Verifies if the specified phone number (plain text or hashed format) matches the one that the user is currently using .
17
17
#
18
18
# @example
19
- # response = client.number_insight_2.fraud_check(type: 'phone', phone: '447900000000', insights: ['fraud_score'])
19
+ # response = client.network_number_verification.verify(
20
+ # phone_number: '+447900000000',
21
+ # auth_data: {
22
+ # oidc_auth_code: '0dadaeb4-7c79-4d39-b4b0-5a6cc08bf537',
23
+ # redirect_uri: 'https://example.com/callback'
24
+ # }
25
+ # )
20
26
#
21
- # @param [required, String] :type The type of number to check.
22
- # Accepted value is “phone” when a phone number is provided.
27
+ # @param [required, String] :phone_number The phone number to check, in the E.164 format, prepended with a `+`.
23
28
#
24
- # @param [required, String] :phone A single phone number that you need insight about in the E.164 format.
29
+ # @param [required, Hash] :auth_data A hash of authentication data required for the client token request. Must contain the following keys:
30
+ # @option auth_data [required, String] :oidc_auth_code The OIDC auth code.
31
+ # @option auth_data [required, String] :redirect_uri The redirect URI.
32
+ # @see https://developer.vonage.com/en/getting-started-network/authentication#client-authentication-flow
25
33
#
26
- # @param [required, Array] :insights An array of strings indicating the fraud check insights required for the number.
27
- # Must be least one of: `fraud_score`, `sim_swap`
34
+ # @param [required, Boolean] :hashed Whether the value of `phone_number` is hashed (true) or not hashed (false, the default).
28
35
#
29
36
# @return [Response]
30
37
#
31
- # @see https://developer.vonage.com/en/api/number-insight.v2#fraud_check
38
+ # @see https://developer.vonage.com/en/api/camara/ number-verification#verifyNumberVerification
32
39
#
33
40
sig { params ( phone_number : String , auth_data : Hash , hashed : T ::Boolean ) . returns ( Vonage ::Response ) }
34
41
def verify ( phone_number :, auth_data :, hashed : false )
@@ -54,6 +61,24 @@ def verify(phone_number:, auth_data:, hashed: false)
54
61
)
55
62
end
56
63
64
+ # Creates a URL for a client-side OIDC request.
65
+ #
66
+ # @example
67
+ # response = client.network_number_verification.generate_oidc_uri(
68
+ # phone_number: '+447900000000',
69
+ # redirect_uri: 'https://example.com/callback'
70
+ # )
71
+ #
72
+ # @param [required, String] :phone_number The phone number that will be checked during the verification request.
73
+ #
74
+ # @param [required, String] :redirect_uri The URI that will receive the callback containing the OIDC auth code.
75
+ #
76
+ # @param [optional, String] :state A string that you can use for tracking.
77
+ # This field is optional, but it is recommended to set a unique identifier for each access token you generate.
78
+ #
79
+ # @return [String]
80
+ #
81
+ # @see https://developer.vonage.com/en/getting-started-network/authentication#1-make-an-oidc-request
57
82
sig { params ( phone_number : String , redirect_uri : String , state : T . nilable ( String ) ) . returns ( String ) }
58
83
def generate_oidc_uri ( phone_number :, redirect_uri :, state : nil )
59
84
params = {
0 commit comments