Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ print channels.get_info(token,channel_id)

#### Get channel members
```python
print channels.get_members(token,channel_id,show_public_profile)
print channels.list_members(token,channel_id,show_public_profile)
```

#### Get channels list of which user is member of
Expand Down
3 changes: 2 additions & 1 deletion flockos/api_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# coding: utf-8

from __future__ import absolute_import
from utils import to_camel_case
import requests
import json
import flockos
Expand All @@ -9,5 +10,5 @@
def call_api(resource_path, params=None):
base_url = flockos.base_url
url = base_url + resource_path
response_data = requests.post(url, data=str(params))
response_data = requests.post(url, data=str({k:to_camel_case(v) for k,v in params.items()}))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to do the camel case conversion recursively for nested objects.

return json.loads(response_data.text)
4 changes: 2 additions & 2 deletions flockos/apis/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_info(token, channel_id, **kwargs):
return response


def get_members(token, channel_id, show_public_profile, **kwargs):
def list_members(token, channel_id, show_public_profile, **kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming this was auto generated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The name was incorrect in swagger.json earlier

"""


Expand All @@ -41,7 +41,7 @@ def get_members(token, channel_id, show_public_profile, **kwargs):
for key, val in iteritems(params['kwargs']):
params[key] = val
del params['kwargs']
resource_path = '/channels.getMembers'.replace('{format}', 'json')
resource_path = '/channels.listMembers'.replace('{format}', 'json')
response = call_api(resource_path, params=params)
return response

Expand Down