GetChanges
Checks for changes in campaigns, ads, and clients' personal data, as well as in the region and time zone directories, and in the Yandex Catalog.
Alert
Disabled method. Use version 5 of the API.
For information about the compatibility of methods between versions 4 and 5, see the Migration guide.
The Get Changes (Live) version also exists for this method.
The method states whether or not changes have been made since the date specified, without providing any details on what changed. We recommend using the method in the following way:
-
At the first launch of the app, call the method without input parameters in order to synchronize the current time.
The method returns the
Timestamp
parameter, which is the current UTC time on the server. -
For each method call after this, specify the usernames, campaigns, and ads to check changes for, along with the value of the
Timestamp
parameter received in the previous method call. This guarantees that there will be no gaps between the intervals for checking for changes, regardless of possible delays or discrepancies between the time on the server and the time in the app. -
If the response indicates changes, use the corresponding methods to get current data:
Note
In some cases, the parameters of campaigns, ads, and other data are the same as previously, but the GetChanges
method indicates changes. This is because the GetChanges method checks hidden parameters that are not accessible via the API.
Input data
The input data structure in JSON is shown below. The parameters CampaignIDS
, BannerIDS
and Logins
are mutually exclusive; only one of them can be included in the request.
{
"method": "GetChanges",
"param": {
/* GetChangesRequest */
"CampaignIDS": [
(int)
...
],
"BannerIDS": [
(long)
...
],
"Logins": [
(string)
...
],
"Timestamp": (string)
}
}
Parameters are described below.
Parameter |
Description |
Required |
GetChangesRequest object |
||
|
Array containing campaign identifiers (no more than 100). |
No |
|
Array containing ad identifiers (no more than 100). The ads can belong to different campaigns. |
No |
|
Array of client (agency) usernames. |
No |
|
The exact time to start from to check for changes. Specified in the format |
No |
Output data
The output data structure in JSON is shown below. The structure contains all possible data that can be included in the response. The data that is actually included depends on the input parameters and is described below.
{
"data": {
/* GetChangesResponse */
"Campaigns": {
/* GetChangesIntData */
"Updated": [
(int)
...
],
"NotUpdated": [
(int)
...
],
"NotFound": [
(int)
...
]
},
"Banners": {
/* GetChangesLongData */
"Updated": [
(long)
...
],
"NotUpdated": [
(long)
...
],
"NotFound": [
(long)
...
]
},
"Logins": {
/* GetChangesStringData */
"Updated": [
(string)
...
],
"NotUpdated": [
(string)
...
],
"NotFound": [
(string)
...
]
},
"CampaignsStatChange": [
{ /* CampaignStatChangeItem */
"CampaignID": (int),
"BorderDate": (date)
}
...
],
"Timestamp": (string),
"RubricsChanged": (string),
"TimeZonesChanged": (string),
"RegionsChanged": (string)
}
}
Parameters are described below.
Parameter |
Description |
GetChangesResponse object |
|
|
Present in the response if the Changes to the campaigns are defined as changes to parameters that are returned by the GetCampaignsParams method, including significant changes in the campaign status. |
|
Present in the response if a Changes to the ads are defined as changes to parameters that are returned by the GetBanners method, including significant changes in the ad status. |
|
Present in the response if the |
|
Array of The campaigns being checked are specified explicitly in the |
|
The exact time when the |
|
Shows whether or not there are any changes in the Yandex Catalog — Yes/No. |
|
Shows whether or not there are any changes in the time zone directory — Yes/No. |
|
Shows whether or not there are any changes in the region directory — Yes/No. |
GetChangesIntData object |
|
|
Contains IDs of campaigns specified in the call that did not have any changes. |
|
Contains IDs of campaigns specified in the call that had changes. |
|
Contains IDs of campaigns specified in the call that were removed or did not exist. |
GetChangesLongData object |
|
|
Contains IDs of ads specified in the call that did not have any changes. |
|
Contains IDs of ads specified in the call that had changes. |
|
Contains IDs of ads specified in the call that were removed or did not exist. |
GetChangesStringData object |
|
|
Contains the usernames specified in the method call that do not have any changes in the clients' personal data. |
|
Contains the usernames specified in the method call that have changes in the clients' personal data. |
|
Contains usernames specified in the method call that were deleted or did not exist. |
CampaignStatChangeItem object |
|
|
The campaign ID. |
|
Date when statistics were current. Output only for campaigns with statistics that were adjusted during the period being checked. Adjustments are usually made because of a declining click rate and an increasing campaign balance. Statistics reports that were generated earlier may turn out to be inaccurate if they show data after |
Examples of input data
Python
{
'CampaignIDS': [1327944,1327967],
'Timestamp': '2011-05-24T23:59:59Z'
}
PHP
array(
'BannerIDS' => array(1974642, 20920155, 20155899, 64654),
'Timestamp' ='2011-05-24T23:59:59Z'
)
Perl
{
'Logins' => ['agrom', 'john_smith', 'john_smith_old'],
'Timestamp' ='2011-05-24T23:59:59Z'
}
Examples of output data
The set of output data depends on the input parameters. In all cases, the method returns the current time on the server in the Timestamp
parameter.
Call without parameters
Returns the current time on the server.
{
"data": {
"Timestamp": "2011-05-24T23:59:59Z"
}
}
Call with the Timestamp parameter
Returns information about whether there are changes in Yandex Catalog, the region reference, or the time zone reference.
{
"data": {
"Timestamp": "2011-05-24T23:59:59Z",
"RubricsChanged": "Yes",
"TimeZonesChanged": "No",
"RegionsChanged": "No"
}
}
Call with the BannerIDS and Timestamp parameters
Returns information about whether there have been any changes to ads since the specified date.
{
"data": {
"Banners": {
"Updated": [1974642, 20920155],
"NotUpdated": [20155899],
"NotFound": [64654]
},
"Timestamp": "2011-05-24T23:59:59Z",
"RubricsChanged": "Yes",
"TimeZonesChanged": "No",
"RegionsChanged": "No"
}
}
Call with the CampaignIDS and Timestamp parameters
Returns information about whether there have been any changes to campaigns or ads since the specified date, along with the dates when statistics were current.
{
"data": {
"Campaigns": {
"Updated": [1327944]
},
"Banners": {
"Updated": [123123,123123],
"NotUpdated": [43532452],
},
"CampaignsStatChange": [
{
"CampaignID": 1327944,
"BorderDate": "2011-03-17"
}
],
"Timestamp": "2011-05-24T23:59:59Z",
"RubricsChanged": "Yes",
"TimeZonesChanged": "No",
"RegionsChanged": "No"
}
}
Call with the Logins and Timestamp parameters
Returns information about whether any changes were made to clients' personal data, along with the date when statistics were current for campaigns that belong to these clients.
{
"data": {
"Logins": {
"Updated": ["agrom"],
"NotUpdated": ["john_smith"],
"NotFound": ["john_smith_old"]
},
"CampaignsStatChange": [
{
"CampaignID": 1327944,
"BorderDate": "2011-03-17"
},
{
"CampaignID": 23667919,
"BorderDate": "2011-05-17"
}
],
"Timestamp": "2011-05-24T23:59:59Z",
"RubricsChanged": "No",
"TimeZonesChanged": "No",
"RegionsChanged": "No"
}
}