|
1 | | -##Usabilla API - Python Client |
| 1 | +#Usabilla API - Python Client |
2 | 2 |
|
3 | 3 | [](https://travis-ci.org/usabilla/api-python) |
4 | 4 | [](https://badge.fury.io/py/usabilla-api) |
@@ -26,42 +26,24 @@ It makes use of the API to request the following products and resources: |
26 | 26 |
|
27 | 27 | For more information on resources, authorization and available API calls, please visit out [documentation](https://usabilla.com/api). |
28 | 28 |
|
29 | | -# Installation: |
| 29 | +## Installation: |
30 | 30 |
|
31 | 31 | Requires Python 2.7 |
32 | 32 |
|
33 | 33 | ```bash |
34 | 34 | pip install usabilla-api |
35 | 35 | ``` |
36 | 36 |
|
37 | | -# Buttons example: |
38 | | -```python |
39 | | ->>> import usabilla as ub |
40 | | ->>> api = ub.APIClient('YOUR-ACCESS-KEY', 'YOUR-SECRET-KEY') |
41 | | ->>> api.set_query_parameters({'limit' : 1}) |
42 | | ->>> buttons = api.get_resource(api.SCOPE_LIVE, api.PRODUCT_WEBSITES,api.RESOURCE_BUTTON) |
43 | | ->>> print buttons |
44 | | -``` |
| 37 | +## Examples: |
| 38 | +The example folder contains an example of the client, which gives an idea how the client can be used and what is possible. |
| 39 | + |
45 | 40 |
|
46 | | -### Iterators |
| 41 | +## Iterators |
47 | 42 |
|
48 | 43 | When working with the <code>limit</code> parameters (default value is **100**) you can request resources using the <code>item_iterator()</code> function. |
49 | 44 | The API returns data in pages. This function returns a [Generator](https://wiki.python.org/moin/Generators) which |
50 | 45 | traverses these pages for you and yields each result in the current page before retrieving the next page. |
51 | 46 |
|
52 | | -## Feedback example |
53 | | - |
54 | | -```python |
55 | | ->>> import usabilla as ub |
56 | | ->>> import json |
57 | | ->>> api = ub.APIClient('YOUR-ACCESS-KEY', 'YOUR-SECRET-KEY') |
58 | | ->>> api.set_query_parameters({'limit' : 1}) |
59 | | ->>> feedbackItems = api.get_resource(api.SCOPE_LIVE, api.PRODUCT_WEBSITES,api.RESOURCE_FEEDBACK,'*',iterate=True) |
60 | | ->>> print json.dumps([item for item in feedbackItems], indent=4) |
61 | | -``` |
62 | | - |
63 | | -Where <code>id</code> is the button id from which the feedback originates. |
64 | | - |
65 | 47 | ##Support |
66 | 48 |
|
67 | 49 | The Usabilla Python Client API is maintained by Usabilla Development Team. Everyone is encouraged to file bug reports, feature requests, and pull requests through GitHub. This input is critical and will be carefully considered, but we can’t promise a specific resolution or time frame for any request. For more information please email our Support Team at support@usabilla.com |
0 commit comments