Hello.
For sure it’s a simply and stupid question, but I cannot find solution.
My Qt5 C++ API works great… except it cannot delete remote parameters/variables 
I tried some ways, but I’m unable to do so:
=comment=
=comment=“”
=comment=‘’
=!comment=
=!comment=“”
=!comment=‘’
There is no “trap” messages from ROS when use the ! prepending attribute name, but ROS doesn’t do anything either xD
It was no important to me until now, as I allways fill all attributes but “comment”, clearing it by replacing text with a single space: " ". But cannot use this trick on other attributes.
Can someone give me some clues?
=comment= is the way to go, as documented:
https://wiki.mikrotik.com/wiki/Manual:API#Attribute_word
Atribute word structure consists of 5 parts in this order:
- encoded length
- content prefix equals sigh - =
- attribute name
- separating equals sign - =
- value of attribute if there is one. > It is possible that attribute does not have a value
Note: > Value can be empty
Example (note that 0x07 is not end of value, but encoded length of next word)
0000017C 2f 69 6e 74 65 72 66 61 63 65 2f 65 74 68 65 72 /interfa ce/ether
0000018C 6e 65 74 2f 73 65 74 09 3d 63 6f 6d 6d 65 6e 74 net/set. =comment
0000019C 3d 07 3d 2e 69 64 3d 2a 32 00 =.=.id=* 2.
Thanks for your interest.
Yes, now is working… don’t know why it was’nt as it was the first attempt I did. I will search why my tests fail at first.
Thanks again.
Hi again
Found it!!
I’ll do my best to explain. It’s hard to me doing it in english 
When I face this problem I tried some code changes… and break things in my own API base code. (blame me for not trusting my 5 years younger version of me XD )
The deletion method works fine in attributes like comment.
But I saw some weird issue when deleting via API this way attributes like rate-limit in /ppp/profile/ because this kind of attribute, in winbox, can be “actived” or “inactived” and when “actived” can have data or be empty. Deleting via API it remains active but empty. ROS doesn’t says it’s wrong and I moved on.
BUT!
bridge in /ppp/profile/ is quite similar, but it cannot be active and empty at the same time.
So, when I clear /ppp/profile → bridge, ROS keeps it activated, and, as this cannot be activated and empty, ROS “auto fills” with the first bridge in their list.
ROS API documentation never talks about deleting AFAK. The =attribute= word means “use this attribute” for API:

Then… what should I do to clear this kind of attributes?
Granted, this one isn’t documented. But when in doubt, try to recreate console command first and convert that command with parameters to API words.
This example was used to remove bridge1 from ppp profile:
0000004A 2f 70 70 70 2f 70 72 6f 66 69 6c 65 2f 73 65 74 /ppp/pro file/set
0000005A 07 3d 2e 69 64 3d 2a 31 09 3d 21 62 72 69 64 67 .=.id=*1 .=!bridg
0000006A 65 3d 00 e=.
So, =!value= seems to do the trick.
Yes! It does the trick!
Indeed it’s not documented and shall be.
So, to resume, to remove an attribute value from API you must know if attribute must be disabled or it’s just a fillable field.
If it’s just a fillable attribute, just send and empty value: ==
It it’s a enable/disable attribute, just negate the attribute: =!=
Thankyou for your help.
You know this times where someone is blind to quite obvious things and is unable to solve it without help…?
No problem. Note that API is behaving exactly like CLI in these cases:
To unset a comment, use: /interface ethernet set 0 comment=“”
The command contains a parameter (comment) with a value (“”)
To unset a bridge in ppp, use: /ppp profile set 0 !bridge
The commands contains a parameter (!bridge) without a value