|
1 | | -# python-sdk |
| 1 | +# Getting Started with bandwidth |
| 2 | + |
| 3 | +Bandwidth's set of APIs |
| 4 | + |
| 5 | +## Install the Package |
| 6 | + |
| 7 | +The package is compatible with Python versions ```2 >=2.7.9``` and ```3 >=3.4```. |
| 8 | +Install the package from PyPi using the following pip command: |
| 9 | + |
| 10 | +```python |
| 11 | +pip install bandwidth-sdk==5.1.0 |
| 12 | +``` |
| 13 | + |
| 14 | +You can also view the package at: |
| 15 | +https://pypi.python.org/pypi/bandwidth-sdk |
| 16 | + |
| 17 | +## Initialize the API Client |
| 18 | + |
| 19 | +The following parameters are configurable for the API Client. |
| 20 | + |
| 21 | +| Parameter | Type | Description | |
| 22 | +| --- | --- | --- | |
| 23 | +| `messaging_basic_auth_user_name` | `string` | The username to use with basic authentication | |
| 24 | +| `messaging_basic_auth_password` | `string` | The password to use with basic authentication | |
| 25 | +| `voice_basic_auth_user_name` | `string` | The username to use with basic authentication | |
| 26 | +| `voice_basic_auth_password` | `string` | The password to use with basic authentication | |
| 27 | +| `environment` | Environment | The API environment. <br> **Default: `Environment.PRODUCTION`** | |
| 28 | +| `timeout` | `float` | The value to use for connection timeout. <br> **Default: 60** | |
| 29 | +| `max_retries` | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 3** | |
| 30 | +| `backoff_factor` | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 0** | |
| 31 | + |
| 32 | +The API client can be initialized as following. |
| 33 | + |
| 34 | +```python |
| 35 | +from bandwidth.bandwidth_client import BandwidthClient |
| 36 | + |
| 37 | +client = BandwidthClient( |
| 38 | + messaging_basic_auth_user_name='MessagingBasicAuthUserName', |
| 39 | + messaging_basic_auth_password='MessagingBasicAuthPassword', |
| 40 | + voice_basic_auth_user_name='VoiceBasicAuthUserName', |
| 41 | + voice_basic_auth_password='VoiceBasicAuthPassword', |
| 42 | + environment = Environment.PRODUCTION,) |
| 43 | +``` |
| 44 | + |
| 45 | +API calls return an `ApiResponse` object that includes the following fields: |
| 46 | + |
| 47 | +| Field | Description | |
| 48 | +| --- | --- | |
| 49 | +| `status_code` | Status code of the HTTP response | |
| 50 | +| `reason_phrase` | Reason phrase of the HTTP response | |
| 51 | +| `headers` | Headers of the HTTP response as a dictionary | |
| 52 | +| `text` | The body of the HTTP response as a string | |
| 53 | +| `request` | HTTP request info | |
| 54 | +| `errors` | Errors, if they exist | |
| 55 | +| `body` | The deserialized body of the HTTP response | |
| 56 | + |
| 57 | +## Authorization |
| 58 | + |
| 59 | +This API does not require authentication. |
| 60 | + |
| 61 | +## API Reference |
| 62 | + |
| 63 | +### List of APIs |
| 64 | + |
| 65 | +* |
| 66 | + |
0 commit comments