Hi, I’m experimenting with the REST-API and i successfully created a computer object via the gui with the following json:
{
"properties": {
"name": "RESTI",
"description": "testvia api",
"operatingSystem": "windows",
"operatingSystemVersion": "win98",
"domain": "string",
"mac": [
"11:22:33:44:55:66"
],
"ip": [
"1.2.3.4"
]
}
}
However, the exact same json via a curl POST gives an error:
curl -nk -X POST -H "Accept: application/json" -H "Content-Type: application/json" "https://<FQDN>/univention/udm/computers/computer/" --data @rest.json
{"error": {"code": 422, "title": "Unprocessable Entity", "message": "3 error(s) occurred:\nRequest argument \"domain\" The Computer module has no property domain.\nRequest argument \"operatingSystem\" The Computer module has no property operatingSystem.\nRequest argument \"operatingSystemVersion\" The Computer module has no property operatingSystemVersion.\n", "error": {"domain": "The Computer module has no property domain.", "operatingSystem": "The Computer module has no property operatingSystem.", "operatingSystemVersion": "The Computer module has no property operatingSystemVersion."}}, "_embedded": {"udm:error": [{"location": ["body", "properties", "domain"], "message": "The Computer module has no property domain.", "type": "value_error"}, {"location": ["body", "properties", "operatingSystem"], "message": "The Computer module has no property operatingSystem.", "type": "value_error"}, {"location": ["body", "properties", "operatingSystemVersion"], "message": "The Computer module has no property operatingSystemVersion.", "type": "value_error"}]}, "_links": {"self": [{"title": "HTTP-Error 422: Unprocessable Entity", "href": "https://<FQDN>/univention/
Can someone explain what went wrong here?
Regards.
Oliver Niesner
P.S.: I did the same with with a user object and this worked also with a curl POST command!!