diff --git a/README.md b/README.md index 7f1104a..639b4a9 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,26 @@ guarantee that your application continues to function properly in the future. } ``` +* **getProfiles** + + Retrieve the list of profiles. + + *Sample request*: + ```json + { + "action": "getProfiles", + "version": 6 + } + ``` + + *Sample result*: + ```json + { + "result": ["User 1"], + "error": null + } + ``` + * **loadProfile** Selects the profile specified in request. diff --git a/plugin/__init__.py b/plugin/__init__.py index 4d1f933..4b056d5 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -261,6 +261,9 @@ class AnkiConnect: def version(self): return util.setting('apiVersion') + @util.api() + def getProfiles(self): + return self.window().pm.profiles() @util.api() def loadProfile(self, name):