Skip to content

Commit 24d75f0

Browse files
committed
Update README
Update README Examples to reflect best practice of reading access tokens from environment variables.
1 parent 6975c27 commit 24d75f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ A single Pythonic wrapper class representing the Cisco Spark API interfaces and
1818
### Examples
1919

2020
```python
21+
import os
2122
from ciscosparkapi import CiscoSparkAPI
2223

23-
access_token = "abcdefg..."
24-
api = CiscoSparkAPI(access_token)
24+
25+
access_token = os.environ['SPARK_ACCESS_TOKEN']
26+
api = CiscoSparkAPI(access_token, timeout=60)
27+
2528

2629
rooms = api.rooms.list() # Returns an generator container providing support for RFC5988 paging
2730
for room in rooms: # Efficiently iterates through returned objects
2831
print room.title # JSON objects are represented as native Python objects
2932

33+
3034
# Creating a list from the returned generator containers is easy
3135
team_list = list(api.teams.list())
3236
print team_list

0 commit comments

Comments
 (0)