Skip to content

Commit 92445c1

Browse files
committed
Include the id param to the people list method.
No other param can be used with this one. The Spark error message is pretty clear: > GET by ID cannot also other query filters, or a 'max' parameter
1 parent f5eb7f8 commit 92445c1

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

ciscosparkapi/api/people.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(self, session):
137137
self._session = session
138138

139139
@generator_container
140-
def list(self, email=None, displayName=None, orgId=None, max=None):
140+
def list(self, email=None, displayName=None, orgId=None, id=None, max=None):
141141
"""List people
142142
143143
This method supports Cisco Spark's implementation of RFC5988 Web
@@ -154,6 +154,7 @@ def list(self, email=None, displayName=None, orgId=None, max=None):
154154
email(basestring): The e-mail address of the person to be found.
155155
displayName(basestring): The complete or beginning portion of
156156
the displayName to be searched.
157+
id(basestring): List people by ID. Accepts up to 85 person IDs separated by commas.
157158
orgId(basestring): The organization id.
158159
max(int): Limits the maximum number of people returned from the
159160
Spark service per request.
@@ -171,16 +172,20 @@ def list(self, email=None, displayName=None, orgId=None, max=None):
171172
assert email is None or isinstance(email, basestring)
172173
assert displayName is None or isinstance(displayName, basestring)
173174
assert orgId is None or isinstance(orgId, basestring)
175+
assert id is None or isinstance(id, basestring)
174176
assert max is None or isinstance(max, int)
175177
params = {}
176-
if email:
177-
params['email'] = email
178-
elif displayName:
179-
params['displayName'] = displayName
180-
if orgId:
181-
params["orgId"] = orgId
182-
if max:
183-
params['max'] = max
178+
if id:
179+
params["id"] = id
180+
else:
181+
if email:
182+
params['email'] = email
183+
elif displayName:
184+
params['displayName'] = displayName
185+
if orgId:
186+
params["orgId"] = orgId
187+
if max:
188+
params['max'] = max
184189
# API request - get items
185190
items = self._session.get_items('people', params=params)
186191
# Yield Person objects created from the returned items JSON objects

0 commit comments

Comments
 (0)