First changing the display name only works on UI not with api
testcase:
MYURL=“https://${PoNCoadmin}:${PoNCoADMINoPASSWORD}@${PoDOMAIN}/nextcloud/ocs/v1.php/cloud/users”
MYUSER=Mitarbeiter1.Buchhaltung
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname="${MYUSER}"
curl -X PUT -H “OCS-APIRequest:true” -X GET ${MYURL}/${MYUSER}
Second, if I change the displayname via user interface, all existing group associations will break.
To me it looks like you have a little error in your syntax. This might be the problem, why you can’t change the displayname via API.
Yours:
MYURL=“https://${PoNCoadmin}:${PoNCoADMINoPASSWORD}@${PoDOMAIN}/nextcloud/ocs/v1.php/cloud/users”
MYUSER=Mitarbeiter1.Buchhaltung
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname="${MYUSER}"
curl -X PUT -H “OCS-APIRequest:true” -X GET ${MYURL}/${MYUSER}
Regarding changing the display name in the UI linked to group associations breaking, I tried this on my NC playground version 17.0.3 but could not reproduce it. If you do so, please could you provide some log entries from that specific time?
MYUSER=Mitarbeiter1.Buchhaltung
curl -X PUT -H “OCS-APIRequest:true” -X GET ${MYURL}/${MYUSER}
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d key=“displayname” -d value=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X GET ${MYURL}/${MYUSER}/groups
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP2}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP5}”
curl -X PUT -H “OCS-APIRequest:true” -X GET ${MYURL}/${MYUSER}/groups
MYUSER=Mitarbeiter2.Buchhaltung
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP2}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP5}”
MYUSER=Mitarbeiter3.Buchhaltung
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP2}”
MYUSER=Mitarbeiter1.Marketing
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP1}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP3}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP5}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP6}”
MYUSER=Mitarbeiter2.Marketing
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP1}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP3}”
MYUSER=Mitarbeiter3.Marketing
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP1}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP3}”
MYUSER=Mitarbeiter1.Logistik
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP1}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP4}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP6}”
MYUSER=Mitarbeiter2.Logistik
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP1}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP4}”
MYUSER=Mitarbeiter3.Logistik
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER} -d displayname=“${MYUSER}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP1}”
curl -X PUT -H “OCS-APIRequest:true” -X POST ${MYURL}/${MYUSER}/groups -d groupid=“${MYGROUP4}”
You can shorten the --header “OCS-APIRequest: true” as well by just using -H “OCS-APIRequest: true”, which you were using before.
Looking at your cURL stuff from above, I would suggest revising all of them by removing the second -X flag. This is probably causing the issues you’re having.
Blockquote
works: curl -X PUT -H “OCS-APIRequest:true” -X GET ${MYURL}/${MYUSER}
do not work: curl -X PUT -H “OCS-APIRequest:true” GET ${MYURL}/${MYUSER}
The -X flag is a request flag for a method (GET, POST, PUT, etc.) - If you add two request method flags, the second one will overwrite the first one, which causes issues.
Your example from above should look like this:
curl -X GET ${MYURL}/${MYUSER} -H “OCS-APIRequest:true”
thank you regarding the first topic. => done.
regarding the second topic, I validate it again (with the fixed api script) and it worked. BUT doing the same (change displayname) with UI it breaks the group-associations.
any suggestions?
Also, if you change the display name in the web UI and it breaks the group association, please could you check your Nextcloud log to see if it shows anything user/group related at the time of the change?
It could be a unnoticed bug, that’s what we need to find out
No log entries? In that case I pretty much think, that this is a bug.
Please could you report this at the Nextcloud GitHub page, so that the developers can have a look at this? Please could you also link the new issue on Github on here, so that other who may encounter this, will see it?