Skip to end of metadata
Go to start of metadata

Change Log Services

The read-only Change Log and Change Log Detail Services are used in conjunction with other services (listed below) to retrieve information about changes that have been made to a set of objects. This page describes the use of these two services to retrieve a list of the logged changes in which you are interested.

The Change Log service is only available to users with the "member", "advertiser", or "member_advertiser" user type.
On This Page

REST API for retrieving the ID of a change

Retrieving the ID of a change:  

JSON Fields

The Change Log service is read-only; however, some fields can be used in a POST call to filter the response.

Field

Type

Description

Default

Required On

Filter?
resource_idintThe ID of the object used to make the change.N/AGET in query string, POST  Yes
servicestring

The service used to make the change. Possible values:

  • insertion-order
  • line-item
  • campaign
  • profile

N/AGET in query string, POST  Yes
min_timestamptimestamp

The date and time of the earliest modification to the object, in YYYY-MM-DD format.

The min_timestamp may not be earlier than 90 days ago, and the difference between min_timestamp and  max_timestamp may not be longer than 1 month.

One week earlier than the max_timestamp Yes
max_timestamptimestamp

The date and time of last modification to the object, in YYYY-MM-DD format.

The difference between min_timestamp and max_timestamp may not be larger than 90 days.

Current timestamp

 Yes
transaction_idstringThe ID of the change transaction.N/A No
created_ontimestamp

The date and time of the modification to the object, in YYYY-MM-DD HH:MM:SS format.

Timestamp of update No
start_elementintBy default, the change-log service will return 100 transactions or less. If there are more transactions, use start_element to set the offset. Enter in the query string.N/A Yes
num_elementsintBy default, the change-log service will return 100 transactions or less. If there are more transactions, use num_elements to retrieve the specified number of transactions. Enter in the query string.N/A Yes

REST API for retrieving the details of a change 

Retrieving the details of a change:

JSON Fields

The Change Log Details service is read-only; however, some fields can be used in a POST call to filter the response.

Field

Type

Description

Default

Required On

Filter?

transaction_id

int

The ID of the change transaction.

N/A

GET in query string, POST

Yes
created_ontimestampThe date and time of the modification to the object, in YYYY-MM-DD HH:MM:SS format.Current timestamp on update No
resource_idintThe ID of the object used to make the change.N/AGET in query string, POST Yes
modified_by_admin boolean

If true, return only admin modifications. If false, return only non-admin modifications. If null, return all.

null No
user_id intThe ID of the user who made the modification.N/A No
servicestring

The service used to make the change. Possible values:

  • line_item
  • campaign
  • profile

N/AGET in query string, POST  Yes
methodenum

The API method used to make the change. Possible values:

  • "put"
  • "post"
  • "delete"
N/A No
urlstringThe URL of the original request.N/A No
changesarray of objectsDetails about the changes made to the object. See Changes below for more details.N/A No
plugin_idintThe ID of the plugin that made the modification. If null, a plugin did not make the modification (and a user did). For more information on a plugin, see the Plugin Service.N/A No

Changes

Each object in the changes array contains the following fields.

Field

Type

Description

field_namestring Read-only. The name of the field changed.

new_value

stringRead-only. The new value of the field.
old_valuestringRead-only. The old value of the field.
changedboolean Read-only. If true, the field has changed.

Examples

Retrieve Change Log Details Using GET

Step 1. GET the change log transaction ID

See JSON above for more details about the fields that can be included in the query string to filter the response.

Step 2. GET the change log details

See JSON above for more details about the fields that can be included in the query string to filter the response.

Retrieve Change Log Details Using POST

The code samples in the steps below show how a user retrieves changes made to line item 1951460 between 00:00:00 on August 10, 2015 and 00:00:00 on August 15, 2015.

Step 1. Create a JSON-formatted change log request

The JSON file should include the service and resource_id of the change logs you want to view, as well as the min_timestamp and max_timestamp to limit change logs to a specific time period. You can also use start_element or num_elements in the query string.

See JSON above for more details about the fields that can be included in the request.

Step 2. POST the request to the Change Log Service

 Post the JSON request to get back basic change log information, including the transaction_id.

Step 3. Create a JSON-formatted change log detail request

The JSON file should include the service resource_id, and transaction_id of the change log for which details you want to view.

See JSON above for more details about the fields that can be included in the request.

Step 4. POST the request to the Change Log Detail Service

 Post the JSON request to get back a detailed change log for the change corresponding to the transaction_id .

Related Topics

 

  • No labels