We’ve improved our subscriber_edit API method to allow for updating only a portion of subscriber details, rather than supplying the entire subscriber record for each update.
The default behavior of
subscriber_edit remains the same – you must build the entire subscriber record each time you save any updates associated with that record. Here are example
POST parameters that you could pass:
Array ( 'id' => 1, 'email' => 'email@example.com', 'first_name' => 'John', 'last_name' => 'Doe', 'field' => Array ( '2,4' => 'field value', ), 'p' => Array ( '3' => 3, '5' => 5, ), 'status' => Array ( '3' => 1, '5' => 1, ), )
With potentially lots of lists and custom field values, this array becomes very large when you often only want to update a single value pertaining to the subscriber.
In these cases you can include the
overwrite parameter in the API request URL. Set it to
0 to turn off automatic overwrite.
Here is an example API request URL for
http://mysite.com/admin/api.php ?api_user=admin &api_pass_h=098f6bjdsa87sadhsj4e832627b4f6 &api_action=subscriber_edit &api_output=serialize &overwrite=0
If you include the
overwrite parameter, it can be value
0. Leaving it out defaults to
Now here is your modified
Array ( 'id' => 1, 'p' => Array ( '6' => 6, ), 'status' => Array ( '6' => 1, ), )
Here we are only appending this new list (ID 6) for the subscriber record, and all other details are left alone (if
overwrite=0). Please keep in mind if you leave out some parameters that have dependencies (such as
status), you might receive an error or have incomplete data being saved.
The only required parameter is
id. Here are a list of dependencies:
statusare dependent on each other.
Let us know if you have any problems with this new functionality!