This guide will walk you through Audit logs, a feature enabling users to track various changes made to a product. It helps monitor the timing and the individuals responsible for these actions.
Monitored Events:
- Shelf price adjustment - Logs changes in the shelf prices of products.
- Price edits - Logs changes in recommendation acceptance status and overrides in recommendations.
- Product edits - Logs edits made to products on the QL platform, such as disabling or enabling a product, product configuring etc.
- Pricing group edits - Logs edits made to pricing groups.
- Pricing Strategies edits - Logs edits made to pricing strategies.
- Promotion edits - Logs edits made to promotions.
- Custom function edits - Logs edits made to custom functions.
- Account edits - Logs edits made to the account settings on the QL platform
Access Methods
To access the audit logs, there are two methods - through the QL platform or via the API.
Via QL platform
Navigate to the left sidebar > Admin > Audit Logs.
You can filter by the specific action you are seeking and choose the timeframe for your search
How to read the log?
The title will represent the action taken, and each field will display relevant data related to the product and the specific action. Different actions will have distinct fields. At the top right, you can observe the timestamp indicating when the action was performed.
Note: You must have "account manager" permissions to access this functionality
Via API
You can use api/v3/admin/audit_log endpoint.
All you will need is the client key & channel key for which you want to extract the logs and the requested period.
Each request can return up to 300 logs (the default is 50). Use pagination in case you have more than 300 logs. The amount of logs for the period will show in the response in the 'total' value. see the example response below under "total".
When utilizing the API, the outcome will be returned in the form of a JSON file. Each event has its unique set of fields, as illustrated in the example below. It's essential to map these fields according to your specific requirements. In the provided response example, there are two actions: recommendation override and custom function edit, and you can observe that each action is associated with its own set of fields.
{
"result": [
{
"channel": "the channel the action was made for",
"client_key": "The client key the action was made for",
"entity_id": "the id of the entity that was changed",
"id": "Internal Quicklizard ID of the event",
"kind": "type of the event, usually event/audit_log",
"_params": {
"text": {
"action": ["the action taken"]
}
},
"props": {
"date": [
{
"name": "timeline/0/timestamp",
"value": "the time when the action was taken"
},
{
"name": "timeline/1/timestamp",
"value": "the time when the second action was taken (in case there are more than 2 actions)"
}
],
"num": [
{
"name": "price/shelf",
"value": shelf price
},
{
"name": "price/recommendation",
"value": recommended price
}
],
"text": [
{
"name": "product/id",
"value": "the id of the product"
},
{
"name": "product/label",
"value": "the title of the product"
},
{
"name": "group/name",
"value": "the group of the product"
},
{
"name": "group/id",
"value": "the id of the group product"
},
{
"name": "strategy/name",
"value": "the name of the strategy"
},
{
"name": "strategy/id",
"value": "the id of the strategy"
},
{
"name": "override/reason",
"value": "the reason for the override (will show in case the action is override)"
},
{
"name": "override/expiry/function",
"value": "the expiry for the override (will show in case the action is override)"
},
{
"name": "value/from",
"value": what was the former value
},
{
"name": "value/to",
"value": what is the new value
},
{
"name": "timeline/0/action",
"value": "what is the action taken"
},
{
"name": "timeline/0/user",
"value": "user who preformed the first action"
},
{
"name": "timeline/1/action",
"value": "what is the second action taken (in case there are two actions)"
},
{
"name": "timeline/1/user",
"value": "user who preformed the second action (in case there are two actions)"
}
]
},
"timestamp": "when the event was recorded"
},
{
"channel": "the channel the action was made for",
"client_key": "The client key the action was made for",
"entity_id": "Quicklizard internal id of the entity that was changed",
"id": "Internal Quicklizard ID of the event",
"kind": "type of the event, usually event/audit_log",
"_params": {
"text": {
"action": ["the action taken"]
}
},
"props": {
"date": [
{
"name": "timeline/0/timestamp",
"value": "the time when the action was taken"
}
],
"text": [
{
"name": "custom_function/id",
"value": "the custom function id"
},
{
"name": "custom_function/name",
"value": "the custom function name"
},
{
"name": "timeline/0/action",
"value": "the action that was taken"
},
{
"name": "timeline/0/user",
"value": "the user who preformed the action"
}
]
},
"timestamp": "2024-01-30T13:18:45Z"
}You can find all the technical information about the endpoint here.
If it's the first time you use our API we recommend first reading the Getting started with API guide to sign your request correctly.
Comments
0 comments
Please sign in to leave a comment.