Page 1 of 1

Setting system identity through REST API

Posted: Mon Jun 27, 2022 4:10 pm
by bassist
I'm trying to set /system/identity through the REST API, but struggling to get it to set.
curl -k -u admin: -X PATCH https://localhost/rest/system/identity --data '{"name":"newName"}' -H "content-type: application/json"
{"detail":"missing or invalid resource identifier","error":400,"message":"Bad Request"}%
curl -k -u admin: -X PATCH https://localhost/rest/system/identity/set --data '{"name":"newName"}' -H "content-type: application/json"
{"detail":"missing or invalid resource identifier","error":400,"message":"Bad Request"}%
Any pointers here? Is this even possible?

Re: Setting system identity through REST API

Posted: Mon Jun 27, 2022 4:34 pm
by mrz
Use POST to set this and similar parameters
https://help.mikrotik.com/docs/display/ ... STAPI-POST

Re: Setting system identity through REST API

Posted: Fri Jul 01, 2022 2:29 pm
by bassist
Ahh thanks that worked:
curl -k -u admin: -X POST https://localhost/rest/system/identity/set --data '{"name":"NewIdentity"}' -H "content-type: application/json"
[]%
curl -k -u admin: -X GET https://localhost/rest/system/identity
{"name":"NewIdentity"}%

Re: Setting system identity through REST API

Posted: Tue Aug 06, 2024 10:57 am
by keksdom
Great thanx!!!..