Skip to content

Commit 781f359

Browse files
committed
Merge branch 'v251-patch' of github.com:Vonage/vonage-python-sdk into v251-patch
2 parents 3038644 + 3e5dadc commit 781f359

File tree

2 files changed

+126
-16
lines changed

2 files changed

+126
-16
lines changed

README.md

Lines changed: 125 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
This is the Python client library for Nexmo's API. To use it you'll
1010
need a Nexmo account. Sign up [for free at nexmo.com][signup].
1111

12-
- [Installation](#installation)
13-
- [Usage](#usage)
14-
- [SMS API](#sms-api)
15-
- [Voice API](#voice-api)
16-
- [Verify API](#verify-api)
17-
- [Number Insight API](#number-insight-api)
18-
- [Number Management API](#number-management-api)
19-
- [Managing Secrets](#managing-secrets)
20-
- [Application API](#application-api)
21-
- [Overriding API Attributes](#overriding-api-attributes)
22-
- [Frequently Asked Questions](#frequently-asked-questions)
23-
- [License](#license)
12+
* [Installation](#installation)
13+
* [Usage](#usage)
14+
* [SMS API](#sms-api)
15+
* [Voice API](#voice-api)
16+
* [Verify API](#verify-api)
17+
* [Number Insight API](#number-insight-api)
18+
* [Number Management API](#number-management-api)
19+
* [Managing Secrets](#managing-secrets)
20+
* [Application API](#application-api)
21+
* [Overriding API Attributes](#overriding-api-attributes)
22+
* [Frequently Asked Questions](#frequently-asked-questions)
23+
* [License](#license)
2424

2525
## Installation
2626

@@ -68,9 +68,9 @@ environment variable).
6868

6969
## SMS API
7070

71-
## SMS Class
71+
### SMS Class
7272

73-
### Creating an instance of the SMS class
73+
#### Creating an instance of the SMS class
7474

7575
To create an instance of the SMS class follow these steps:
7676

@@ -281,7 +281,7 @@ from nexmo import Verify
281281
from nexmo.verify import Verify
282282
283283
#Third valid way
284-
import nexmo #then tou can use nexmo.Verify() to create an instance
284+
import nexmo #then you can use nexmo.Verify() to create an instance
285285
```
286286

287287
- **Create the instance**
@@ -296,6 +296,116 @@ client = Client(key=NEXMO_API_KEY, secret=NEXMO_API_SECRET)
296296
verify = Verify(client)
297297
```
298298

299+
### Search for a Verification request
300+
301+
```python
302+
client = Client(key='API_KEY', secret='API_SECRET')
303+
304+
verify = Verify(client)
305+
response = verify.search('69e2626cbc23451fbbc02f627a959677')
306+
307+
if response is not None:
308+
print(response['status'])
309+
```
310+
311+
### Send verification code
312+
313+
```python
314+
client = Client(key='API_KEY', secret='API_SECRET')
315+
316+
verify = Verify(client)
317+
response = verify.request(number=RECIPIENT_NUMBER, brand='AcmeInc')
318+
319+
if response["status"] == "0":
320+
print("Started verification request_id is %s" % (response["request_id"]))
321+
else:
322+
print("Error: %s" % response["error_text"])
323+
```
324+
325+
### Send verification code with workflow
326+
327+
```python
328+
client = Client(key='API_KEY', secret='API_SECRET')
329+
330+
verify = Verify(client)
331+
response = verify.request(number=RECIPIENT_NUMBER, brand='AcmeInc', workflow_id=1)
332+
333+
if response["status"] == "0":
334+
print("Started verification request_id is %s" % (response["request_id"]))
335+
else:
336+
print("Error: %s" % response["error_text"])
337+
```
338+
339+
### Check verification code
340+
341+
```python
342+
client = Client(key='API_KEY', secret='API_SECRET')
343+
344+
verify = Verify(client)
345+
response = verify.check(REQUEST_ID, code=CODE)
346+
347+
if response["status"] == "0":
348+
print("Verification successful, event_id is %s" % (response["event_id"]))
349+
else:
350+
print("Error: %s" % response["error_text"])
351+
```
352+
353+
### Cancel Verification Request
354+
355+
```python
356+
client = Client(key='API_KEY', secret='API_SECRET')
357+
358+
verify = Verify(client)
359+
response = verify.cancel(REQUEST_ID)
360+
361+
if response["status"] == "0":
362+
print("Cancellation successful")
363+
else:
364+
print("Error: %s" % response["error_text"])
365+
```
366+
367+
### Trigger next verification proccess
368+
369+
```python
370+
client = Client(key='API_KEY', secret='API_SECRET')
371+
372+
verify = Verify(client)
373+
response = verify.trigger_next_event(REQUEST_ID)
374+
375+
if response["status"] == "0":
376+
print("Next verification stage triggered")
377+
else:
378+
print("Error: %s" % response["error_text"])
379+
```
380+
381+
### Send payment authentication code
382+
383+
```python
384+
client = Client(key='API_KEY', secret='API_SECRET')
385+
386+
verify = Verify(client)
387+
response = verify.psd2(number=RECIPIENT_NUMBER, payee=PAYEE, amount=AMOUNT)
388+
389+
if response["status"] == "0":
390+
print("Started PSD2 verification request_id is %s" % (response["request_id"]))
391+
else:
392+
print("Error: %s" % response["error_text"])
393+
```
394+
395+
### Send payment authentication code with workflow
396+
397+
```python
398+
client = Client(key='API_KEY', secret='API_SECRET')
399+
400+
verify = Verify(client)
401+
verify.psd2(number=RECIPIENT_NUMBER, payee=PAYEE, amount=AMOUNT, workflow_id: WORKFLOW_ID)
402+
403+
if response["status"] == "0":
404+
print("Started PSD2 verification request_id is %s" % (response["request_id"]))
405+
else:
406+
print("Error: %s" % response["error_text"])
407+
```
408+
299409
## Number Insight API
300410

301411
### Basic Number Insight

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
description="Nexmo Client Library for Python",
1616
long_description=long_description,
1717
long_description_content_type="text/markdown",
18-
url="https://github.com/nexmo/nexmo-python",
18+
url="https://github.com/Nexmo/nexmo-python",
1919
author="Nexmo",
2020
author_email="[email protected]",
2121
license="MIT",

0 commit comments

Comments
 (0)