Skip to content

Commit 980b286

Browse files
committed
Putting some changes back to reduce the diff
1 parent 8c02443 commit 980b286

File tree

2 files changed

+108
-14
lines changed

2 files changed

+108
-14
lines changed

README.md

Lines changed: 107 additions & 13 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

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

301395
### 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)