Hi Juan,
You request is giving an error because you are sending values that
aren't meaningful for Syncope, you cannot send "string" value for
auxClasses, resource, attribute schemas, etc.
Those properties refer to other entities that should exist on Syncope
(resources, any type classes, schemas, etc.).
In your specific case the error returned by Syncope means that you are
not sending some required (see related schema definition) attributes,
like *fullname*, *surname* and *userId*.
Here is an working example done on [1].
{
"@class": "org.apache.syncope.common.lib.to.UserTO",
"realm": "/",
"plainAttrs": [
{
"schema": "fullname",
"values": [
"donizzetti donizzetti"
]
},
{
"schema": "firstname",
"values": [
"donizzetti"
]
},
{
"schema": "userId",
"values": [
"[email protected]"
]
},
{
"schema": "surname",
"values": [
"donizzetti"
]
}
],
"username": "donizzetti",
"password": "Password123"
}
]
}
Please take also a look at [2]
HTH,
Andrea
[1] http://syncope-vm.apache.org:9080/syncope-console
[2] https://syncope.apache.org/docs/2.1/reference-guide.html#type-management
Il 06/12/18 13:02, Juan Medina ha scritto:
I'm traying to create a user from postman in Standalone distribution:
I try with
Post to: http://localhost:9080/syncope/rest/users
Body (JSON from the http://localhost:9080/syncope/swagger/):
{
"@class": "org.apache.syncope.common.lib.to.UserTO",
"realm": "/",
"auxClasses": [
"string"
],
"plainAttrs": [
{
"schema": "string",
"values": [
"string"
]
}
],
"derAttrs": [
{
"schema": "string",
"values": [
"string"
]
}
],
"virAttrs": [
{
"schema": "string",
"values": [
"string"
]
}
],
"resources": [
"string"
],
"username": "string",
"password": "string",
"securityQuestion": "string",
"securityAnswer": "string",
"roles": [
"string"
],
"privileges": [
"string"
],
"relationships": [
{
"type": "string",
"otherEndType": "string",
"otherEndKey": "string",
"otherEndName": "string"
}
],
"memberships": [
{
"groupKey": "string",
"groupName": "string",
"plainAttrs": [
{
"schema": "string",
"values": [
"string"
]
}
],
"derAttrs": [
{
"schema": "string",
"values": [
"string"
]
}
],
"virAttrs": [
{
"schema": "string",
"values": [
"string"
]
}
]
}
]
}
But the response is:
{
"status": 400,
"type": "RequiredValuesMissing",
"elements": [
"surname",
"fullname",
"userId"
]
}
I try to add it but the request header throw a
x-application-error-info says:
Unknown:UnrecognizedPropertyException: Unrecognized field "surname"
(class org.apache.syncope.common.lib.to.UserTO), not marked as ignorable
--
Dott. Andrea Patricelli
Tel. +39 3204524292
Engineer @ Tirasa S.r.l.
Viale Vittoria Colonna 97 - 65127 Pescara
Tel +39 0859116307 / FAX +39 0859111173
http://www.tirasa.net
Apache Syncope PMC Member