diff --git a/README.md b/README.md index 089a658..4d0e5d8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/flockos/api_client.py b/flockos/api_client.py index 761994d..0f947c6 100644 --- a/flockos/api_client.py +++ b/flockos/api_client.py @@ -1,6 +1,7 @@ # coding: utf-8 from __future__ import absolute_import +from utils import to_camel_case import requests import json import flockos @@ -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()})) return json.loads(response_data.text) diff --git a/flockos/apis/channels.py b/flockos/apis/channels.py index fc73e96..802702e 100644 --- a/flockos/apis/channels.py +++ b/flockos/apis/channels.py @@ -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): """ @@ -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