@@ -676,7 +676,7 @@ def create_global_api_key(self, label=None, description=None, admin=False):
676676
677677 def list_personal_api_keys (self , as_type = 'objects' ):
678678 """
679- List all your personal API keys
679+ List all your personal API keys.
680680
681681 :param str as_type: How to return the personal API keys. Possible values are "dict" and "object"
682682
@@ -692,7 +692,7 @@ def list_personal_api_keys(self, as_type='objects'):
692692
693693 def get_personal_api_key (self , id ):
694694 """
695- Get a handle to interact with a specific Personal API key
695+ Get a handle to interact with a specific Personal API key.
696696
697697 :param str id: the id of the desired API key
698698
@@ -702,7 +702,7 @@ def get_personal_api_key(self, id):
702702
703703 def create_personal_api_key (self , label = "" , description = "" , as_type = 'dict' ):
704704 """
705- Create a Personal API key associated with your user
705+ Create a Personal API key associated with your user.
706706
707707 :param str label: the label of the new API key
708708 :param str description: the description of the new API key
@@ -715,8 +715,6 @@ def create_personal_api_key(self, label="", description="", as_type='dict'):
715715 "POST" , "/personal-api-keys/" , body = {"label" : label , "description" : description })
716716 if resp is None :
717717 raise Exception ('API key creation returned no data' )
718- if resp .get ('messages' , {}).get ('error' , False ):
719- raise Exception ('API key creation failed : %s' % (json .dumps (resp .get ('messages' , {}).get ('messages' , {}))))
720718 if not resp .get ('id' , False ):
721719 raise Exception ('API key creation returned no key' )
722720
@@ -727,8 +725,8 @@ def create_personal_api_key(self, label="", description="", as_type='dict'):
727725
728726 def list_all_personal_api_keys (self , as_type = 'objects' ):
729727 """
730- List all personal API keys
731- Only admin can list all the keys
728+ List all personal API keys.
729+ Only admin can list all the keys.
732730
733731 :param str as_type: How to return the personal API keys. Possible values are "dict" and "object"
734732
@@ -744,8 +742,8 @@ def list_all_personal_api_keys(self, as_type='objects'):
744742
745743 def create_personal_api_key_for_user (self , user , label = "" , description = "" , as_type = 'object' ):
746744 """
747- Create a Personal API key associated on behalf of a user
748- Only admin can create a key for another user
745+ Create a Personal API key associated on behalf of a user.
746+ Only admin can create a key for another user.
749747
750748 :param str label: the label of the new API key
751749 :param str description: the description of the new API key
@@ -759,8 +757,6 @@ def create_personal_api_key_for_user(self, user, label="", description="", as_ty
759757 "POST" , "/admin/personal-api-keys/" , body = {"user" : user , "label" : label , "description" : description })
760758 if resp is None :
761759 raise Exception ('API key creation returned no data' )
762- if resp .get ('messages' , {}).get ('error' , False ):
763- raise Exception ('API key creation failed : %s' % (json .dumps (resp .get ('messages' , {}).get ('messages' , {}))))
764760 if not resp .get ('id' , False ):
765761 raise Exception ('API key creation returned no key' )
766762
0 commit comments