|
1 | 1 | """
|
2 | 2 | Using the Africa's Talking API, send airtime to a phone number.
|
3 | 3 |
|
4 |
| -You'll need to have an Africa's Talking account, request for airtime API access in their dashboard, |
| 4 | +You'll need to have an Africa's Talking account, request for airtime API access in their dashboard, |
5 | 5 | and get your API key and username.
|
6 | 6 |
|
7 | 7 | This is the error you get
|
8 | 8 | {'errorMessage': 'Airtime is not enabled for this account', 'numSent': 0,
|
9 | 9 | 'responses': [], 'totalAmount': '0', 'totalDiscount': '0'}
|
10 | 10 |
|
11 | 11 | successful responses
|
12 |
| -{'errorMessage': 'None', 'numSent': 1, 'responses': [{'amount': 'KES 10.0000', |
13 |
| -'discount': 'KES 0.4000', 'errorMessage': 'None', 'phoneNumber': 'xxxxxxxx2046', |
14 |
| -'requestId': 'ATQid_xxxx', 'status': 'Sent'}], 'totalAmount': 'KES 10.0000', |
| 12 | +{'errorMessage': 'None', 'numSent': 1, 'responses': [{'amount': 'KES 10.0000', |
| 13 | +'discount': 'KES 0.4000', 'errorMessage': 'None', 'phoneNumber': 'xxxxxxxx2046', |
| 14 | +'requestId': 'ATQid_xxxx', 'status': 'Sent'}], 'totalAmount': 'KES 10.0000', |
15 | 15 | 'totalDiscount': 'KES 0.4000'}
|
16 | 16 |
|
17 | 17 | {'errorMessage': 'None', 'numSent': 1, 'responses': [{'amount': 'KES 10.0000',
|
18 |
| -'discount': 'KES 0.4000', 'errorMessage': 'None', 'phoneNumber': 'xxxxxxxx2046', |
19 |
| -'requestId': 'ATQid_xxxx', 'status': 'Sent'}], 'totalAmount': 'KES 10.0000', |
| 18 | +'discount': 'KES 0.4000', 'errorMessage': 'None', 'phoneNumber': 'xxxxxxxx2046', |
| 19 | +'requestId': 'ATQid_xxxx', 'status': 'Sent'}], 'totalAmount': 'KES 10.0000', |
20 | 20 | 'totalDiscount': 'KES 0.4000'}
|
21 |
| -
|
22 |
| -
|
23 | 21 | """
|
24 | 22 |
|
25 | 23 | import os
|
|
0 commit comments