htruong | 2019-02-27 22:43:46 UTC | #1
So trying to test out postusers to create a user. It is erroring out and failing via both the API Explorer as well as via Python API SDK. The user is still being created, as I can see the new user in the PureCloud GUI under persons, but it doesn't provide a response to allow patchusers for adding remaining details.
Via API Explorer
https://developer.mypurecloud.com/developer-tools/#/api-explorer
/api/v2/users
BODY { "name": "direct api", "email": "directapi2@affirm.com", "password": "<some password>" }
RESPONSE { "status": 400, "code": "bad.request", "message": "The requested operation failed with status 400", "contextId": "633ab24e-1bc8-479b-8044-6544cff45a83", "details": [], "errors": [] }
Via Python API
createuserbody = PureCloudPlatformClientV2.CreateUser() createuserbody.name = 'apiload4' createuserbody.email = 'apiload4@affirm.com' createuserbody.password = '<somepassword>'
apiinstance = PureCloudPlatformClientV2.UsersApi() current = apiinstance.postusers(createuser_body)
HTTP response body: {"status":400,"code":"bad.request","message":"The requested operation failed with status 400","contextId":"51e237f5-f34d-48d5-a386-fa15d4193b23","details":[],"errors":[]}
tim.smith | 2019-02-28 15:41:04 UTC | #2
Please report this issue to PureCloud Care so it can be prioritized and fixed. This has been an issue for a long time. The password doesn't meet password requirements, so it's kicking back a 400. But the bug that you need to report is two part:
- The error message about the password isn't being included in the error response. It absolutely should be.
- The user shouldn't be created if any part of the user creation fails.
htruong | 2019-02-28 16:09:32 UTC | #3
Ah ok. That explains it. Thanks for help.
system | 2019-03-31 16:09:34 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 4695