REST API v1 conditions: Change
Warning: You are viewing the documentation for the old REST API. We recommend using our latest version of the REST API.
Conditions are smaller parts of rules. Only one condition has to be satisfied to satisfy a rule. Every condition has a few specific properties.
This article is about the change condition. If you're looking for any other condition you can find them in the More information section.
Individual properties
The change condition has the following parameters:
- change-type: The changetype of the changecondition. See the change types table.
- field: Database field to be changed/not changed.
- interest: Database interest to be changed/not changed.
Change types
The following table contains the possible values for the change type and their descriptions.
Change type | Description |
---|---|
any | Any change |
none | No change |
field | Field value changed |
nofield | Field value not changed |
new | Profile was created |
notnew | Profile was not created |
edit | Profile was edited |
noedit | Profile was not edited |
newsubprofile | New subprofile added |
nonewsubprofile | No new subprofile added |
editsubprofile | Subprofile was edited |
noeditsubprofile | Subprofile was not edited |
removesubprofile | Subprofile was removed |
noremovesubprofile | Subprofile was not removed |
interest | Interest setting changed |
gotinterest | Interest added that was not there before |
lostinterest | Interest lost that was there before |
Date properties
The date properties can be used to limit the selection to a specified time period. All of the variables below are required to be YYYY-MM-DD HH:MM:SS format.
- before-time: The timestamp before which the change must have occured.
- after-time: The timestamp after which the change must have occured.
- before-mutation: The beforemutation (time difference) of the changecondition.
- after-mutation: The aftermutation (time difference) of the changecondition.
Example
We use a condition here when there has ever been a change in any of the data.
require_once("copernica_rest_api.php");
// change this to your access token
$api = new CopernicaRestApi("my-access-token");
// add data for the call
$data = array(
// select email condition
'type' => 'Change',
// select change type
'change-type' => 'any'
);
// execute the call
$result = $api->post("rule/id/conditions", $data);
// print the result
print_r($result);
This example requires the REST API class.