Attempting to write prototype initialisation code I want to rename a ContactType using the API action "create". I tried to set:
- array ('parent_id' => 0)
- array ('parent_id' => '')
But both error out with "Mandatory key(s) missing from params array: parent_id". I cannot set array('parent_id' => NULL), because it would be like unsetting 'parent_id' which according to the error message cannot be missing. So the question is how do you set it NULL or how do you rename the label of a ContactType using the API?
Edited: Then I discovered that apparently you need the ID of the ContactType when you want to update with 'create', following the instruction that the API explorer gives me when I choose 'update':
The "update" action is deprecated. Use "create" with an id instead.
So I added id as parameter and kept trying ways to set 'parent_id' correctly to NULL. I discovered that array('parent_id' => '0') is the likely way to do that, because it returned a different error message: "already exists". Well yes, I knew that. My intention was to update the label with 'create" according apparently a wrong instruction. Or is this a bug?