From 883889c9c5c2702eadefd3c9085dd86d14bff292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 3 Mar 2022 19:09:58 +0100 Subject: [PATCH] fix: Incorrect call when requesting a new API key --- pymisp/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index 88d6d7d..ef25be3 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -2197,8 +2197,8 @@ class PyMISP: :param user: The owner of the key ''' - data = {"user_id": get_uuid_or_id_from_abstract_misp(user)} - r = self._prepare_request('POST', '/auth_keys/add', data=data) + user_id = get_uuid_or_id_from_abstract_misp(user) + r = self._prepare_request('POST', f'/auth_keys/add/{user_id}', data={}) authkey = self._check_json_response(r) if 'AuthKey' in authkey and 'authkey_raw' in authkey['AuthKey']: return authkey['AuthKey']['authkey_raw']