|
1 | 1 | # Vonage Verify Package |
2 | 2 |
|
3 | | -This package contains the code to use Vonage's Verify API in Python. There is a more current package to user Vonage's Verify v2 API which is recommended to use for most use cases. The v2 API lets you send messages via multiple channels, including Email, SMS, MMS, WhatsApp, Messenger and others. You can also make Silent Authentication requests with Verify v2 to give an end user a more seamless experience. |
4 | | - |
5 | | -This package includes methods for sending 2-factor authentication (2FA) messages and returns... |
6 | | - |
7 | | - |
8 | | -asdf |
9 | | -asdf |
| 3 | +This package contains the code to use Vonage's Verify API in Python. This package includes methods for working with 2-factor authentication (2FA) messages sent via SMS or TTS. |
10 | 4 |
|
| 5 | +Note: There is a more current package available: [Vonage's Verify v2 API](https://developer.vonage.com/en/verify/overview) which is recommended for most use cases. The v2 API lets you send messages via multiple channels, including Email, SMS, MMS, WhatsApp, Messenger and others. You can also make Silent Authentication requests with Verify v2 to give an end user a more seamless experience. |
11 | 6 |
|
12 | 7 | ## Usage |
13 | 8 |
|
14 | 9 | It is recommended to use this as part of the main `vonage` package. The examples below assume you've created an instance of the `vonage.Vonage` class called `vonage_client`. |
15 | 10 |
|
16 | 11 | ### Make a Verify Request |
17 | 12 |
|
18 | | -<!-- Create an `SmsMessage` object, then pass into the `Sms.send` method. |
| 13 | +```python |
| 14 | +from vonage_verify import VerifyRequest |
| 15 | +params = {'number': '1234567890', 'brand': 'Acme Inc.'} |
| 16 | +request = VerifyRequest(**params) |
| 17 | +response = vonage_client.verify.start_verification(request) |
| 18 | +``` |
| 19 | + |
| 20 | +### Make a PSD2 (Payment Services Directive v2) Request |
| 21 | + |
| 22 | +```python |
| 23 | +from vonage_verify import Psd2Request |
| 24 | +params = {'number': '1234567890', 'payee': 'Acme Inc.', 'amount': 99.99} |
| 25 | +request = VerifyRequest(**params) |
| 26 | +response = vonage_client.verify.start_verification(request) |
| 27 | +``` |
| 28 | + |
| 29 | +### Check a Verification Code |
| 30 | + |
| 31 | +```python |
| 32 | +vonage_client.verify.check_code(request_id='my_request_id', code='1234') |
| 33 | +``` |
| 34 | + |
| 35 | +### Search Verification Requests |
| 36 | + |
| 37 | +```python |
| 38 | +# Search for single request |
| 39 | +response = vonage_client.verify.search('my_request_id') |
| 40 | + |
| 41 | +# Search for multiple requests |
| 42 | +response = vonage_client.verify.search(['my_request_id_1', 'my_request_id_2']) |
| 43 | +``` |
| 44 | + |
| 45 | +### Cancel a Verification |
19 | 46 |
|
20 | 47 | ```python |
21 | | -from vonage_sms import SmsMessage, SmsResponse |
| 48 | +response = vonage_client.verify.cancel_verification('my_request_id') |
| 49 | +``` |
22 | 50 |
|
23 | | -message = SmsMessage(to='1234567890', from_='Acme Inc.', text='Hello, World!') |
24 | | -response: SmsResponse = vonage_client.sms.send(message) |
| 51 | +### Trigger the Next Workflow Event |
25 | 52 |
|
26 | | -print(response.model_dump(exclude_unset=True)) |
27 | | -``` --> |
| 53 | +```python |
| 54 | +response = vonage_client.verify.trigger_next_event('my_request_id') |
| 55 | +``` |
| 56 | + |
| 57 | +### Request a Network Unblock |
| 58 | + |
| 59 | +Note: Network Unblock is switched off by default. Contact Sales to enable the Network Unblock API for your account. |
| 60 | + |
| 61 | +```python |
| 62 | +response = vonage_client.verify.request_network_unblock('23410') |
| 63 | +``` |
0 commit comments