Add get_profiles()
@@ -180,6 +180,18 @@ class Client(object):
profile = response.json()['profile']
return Note.from_json(profile)
+ def get_profiles(self, email_or_id_list):
+ """If the list is tilde_ids, returns an array of profiles
+ If the list is emails, returns an array of dictionaries with 'email' and 'profile'"""
+ tildematch = re.compile('~.+')
+ if len(email_or_id_list) > 0 and tildematch.match(email_or_id_list[0]):
+ att = 'ids'
+ else:
+ att = 'emails'
+ response = requests.post(self.baseurl + '/user/profiles', json={att: email_or_id_list})
+ response = self.__handle_response(response)
+ return response.json()['profiles']
+
def post_profile(self, id, content):
response = requests.put(
self.profiles_url,
