This topic contains 2 replies, has 2 voices, and was last updated by Vova Soroka 7 years, 4 months ago.
- Topic
Trying to create user via api, I have hit this roadblock.
The error stems from the password field. Not having the password field in the attributes array throws this exception:
1Integrity constraint violation: 1048 Column 'password' cannot be null.When called with password in attribute array, we get this tidbit:
123456789{"errors": [{"status": "400","title": "extra fields constraint","detail": "This form should not contain extra fields: \"password\""}]}I have tried the passwordPlain attribute, inspired by RestUsersTest::testCreateUser(), but this also throws the ‘extra field’ error.
It seems the field cannot be null, yet the api constraint disallows the password attribute.
Is there a workaround for this?
The request payload I send is as follow:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960{"data": {"type": "users","attributes": {"username":"user_2123136194","email":"test_612258133@test.com","phone":"123-123","enabled":"0","firstName":"firstName","lastName":"lastName","roles":["3"],"owner":"1","enabled":"0"},"relationships": {"groups": {"data": []},"owner": {"data": {"type": "businessunits","id": "1"}},"emails": {"data": []},"businessUnits": {"data": [{"type": "businessunits","id": "1"}]},"roles": {"data": [{"type": "userroles","id": "3"}]},"organizations": {"data": [{"type": "organizations","id": "1"}]},"organization": {"data": {"type": "organizations","id": "1"}}}}}Thanks!
Stef
Dream, in a pragmatic way.
— Aldous Huxley
The forum ‘OroCRM – Installation/Technical Issues or Problems’ is closed to new topics and replies.