-
I am playing with FusionAuth and created some API keys:
The Python client seems to require a valid UUID a api key since the following code does not work (taken from the Python client examples):
client = FusionAuthClient('4zs15CcJJsczlYjeL62bltfbsqbxMZp4m43epG56gsA', 'http://127.0.0.1:9011') user_request = { 'sendSetPasswordEmail': False, 'skipVerification': True, 'user': { 'email': 'art@vandaleyindustries.com', 'password': 'password' } } client_response = client.create_user(None, user_request)
The API return this
{'error_response': {'fieldErrors': {'user': [{'code': '[missing]user', 'message': 'Your request is missing the User information as JSON in the entity-body.'}], 'userId': [{'code': '[couldNotConvert]userId', 'message': "Invalid userId on the URL [{'sendSetPasswordEmail': False, 'skipVerification': True, 'user': {'email': 'art@vandaleyindustries.com', 'password': 'password'}}]. This must be a valid UUID String (e.g. 25a872da-bb44-4af8-a43d-e7bcb5351ebc)."}]}}, 'exception': None, 'response': <Response [400]>, 'success_response': None, 'status': 400}
The error is obviously
This must be a valid UUID String
but why does not FusionAuth create a proper UUID? Even creating a new API key with my own provided UUID causes the same issue...anything I am missing here? -
Hiya,
It looks like there's an error in our sample code.
If you replace
client_response = client.create_user(None, user_request)
with
client_response = client.create_user(user_request)
then the user is created.I will file an issue on that library repo.
Hope this helps.
-
Ah, looks like someone else already shared a fix. https://github.com/FusionAuth/fusionauth-python-client/pull/6