RabbitMQ Events: Changes to Products
The article below will detail what can be seen in the product-related events in your Content Catalyst RabbitMQ feed.
The following events are available:
Product added
product.changes.added
Sent when a product is added to the system. You can GET from ~/api/v1/libraries/reports/products/{productCode} to retrieve information about the newly added product.
Message Body
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"productCode": {
"type": "string",
"description": "The code of the added product that can be used in the API endpoint."
}
}
}
Product updated
product.changes.updated
Sent whenever any aspect of a product changes apart from the following:
- Links
- External product configuration
- News items
The only other exception is that when the category tree changes structure, this message will not be sent even if category assignments change as a result.
See the category events.
The only category changes that trigger this event are when categories are explicitly assigned to or unassigned from a product.
You can GET from ~/api/v1/libraries/reports/products/{productCode} to retrieve the updated metadata for the product and references to the updated main deliverable, print copies and attachments.
The revisionCode below will be blank for most messages. This indicates that the changes have gone immediately to the published version. When draft content is added to or updated on the product, the message will contain a revisionCode.
Message Body
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"productCode": {
"type": "string",
"description": "The code of the updated product that can be used in the API endpoint."
},
"revisionCode": {
"type": "string",
"description": "If this is present then the draft content was updated"
}
}
}
Product removed
product.changes.removed
Sent when a product is removed from the system. When a product is deleted, it is unassigned from all categories if you store the product-category mappings separately, then you should refresh them from the API in response to this message.
Message Body
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"productCode": {
"type": "string",
"description": "The code of the removed product"
}
}
}
Product status changed
product.status
Sent when a product’s status changes between any of the following values, for example, when a product is published.
|
Status |
Description |
|---|---|
|
Disabled |
Disabled reports are never visible to site users - only to admins (in the admin area). |
|
Normal |
‘Normal’ reports are fully interactive and appear in the main body of the site’s content. |
|
PrivateReport |
Reports set to ‘private’ only appear to users who have licenses for them. They are not included in category licenses. |
|
Archive |
Excluded from the regular search results. Shown in a special ‘archive’ category tab. |
|
Preview |
Acts as a placeholder for reports that have not yet been published. |
Message Body
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"productCode": {
"type": "string",
"description": "The code of the updated product"
},
"oldStatus": {
"type": "string",
"description": "The status of the product before it was updated"
},
"newStatus": {
"type": "string",
"description": "The status of the product after it was updated"
}
}
}
Product accessed
product.access
🔔Note: This event is in version 2.
Sent when a subscriber accesses a product. You can use the accessType property to identify what type of access was achieved:
|
Access Type |
Description |
|---|---|
|
OpenMarketingPage |
The subscriber viewed the product’s marketing landing page. |
|
OpenLandingPage |
The subscriber viewed the landing page of a licensed product. |
|
OpenChapter |
The subscriber viewed a chapter. The event’s |
|
StayOnProduct |
The subscriber viewed a chapter for a period of time. |
|
OpenNews |
The subscriber viewed a news chapter. |
|
OpenExternalProduct |
The subscriber viewed an external report’s content. |
|
OpenFile |
The subscriber viewed a page inside of the PDF viewer. |
|
DownloadProduct |
The subscriber downloaded a product’s attachment. |
|
DownloadMarketingBrochure |
The subscriber downloaded/viewed the product’s marketing brochure. |
|
DownloadCustomReport |
The subscriber downloaded interactive content from a custom report into an office format. |
|
EmailProduct |
The subscriber sent a product by email. |
|
PlayVideo |
The subscriber played a video |
|
SearchWithinProduct |
The subscriber filtered a report. |
Message Body
This includes an “AccessDisplayName” property. The value of this property is subject to change at any time, and should only be used for display purposes - the access type, however, is stable and can be used for programmatic purposes.
{
"$schema":"http://json-schema.org/draft-04/schema#",
"type":"object",
"properties":{
"product":{
"type":"object",
"description":"Details about which product was accessed.",
"properties":{
"productCode":{
"type":"string",
"description":"The unique code of the product accessed."
},
"title":{
"type":"string",
"description":"The title of the product accessed."
},
"chapterTitle":{
"type":"string",
"description":"The title of the chapter accessed, if any. Will be null if part of the product accessed is not a chapter, e.g. the landing page or a PDF viewer page."
}
}
},
"reader":{
"type":"object",
"description":"Details about who accessed the product.",
"properties":{
"username":{
"type":"string",
"description":"The unique username of the subscriber who accessed the product."
},
"ipAddress":{
"type":"string",
"description":"The IP Address of the subscriber when they accessed the product."
},
"impersonation":{
"type":"boolean",
"description":"Optional. When true, this indicates that the access to the product was done whilst impersonating the subscriber."
},
"accountName":{
"type":"string",
"description":"The account the subscriber was associated with when they accessed the product."
},
"userAgent":{
"type":"string",
"description":"The user agent header provided with the request when the subscriber accessed the product."
}
}
},
"accessDate":{
"type":"string",
"format":"date-time",
"description":"When the product was accessed. Note: this may be different from the event's createdDate property."
},
"accessType":{
"type":"string",
"description":"The type of access."
},
"accessDisplayName":{
"type":"string",
"description":"The human friendly display name of the access type. This is subject to change at any time."
},
"referrerCode":{
"type":"string",
"description":"Optional. Associates the product access with how the reader found the report. This can be set by appending a 'ref' query parameter when linking to a report. E.g. '~/reports/{CODE}?ref=email'. The content of the code can be any none-empty value up to 50 characters."
}
}
}
Product sent to colleague
product.sentToColleague
Sent when a subscriber sends a product to their colleague via email. This also generates a product.access event, however, this event has more information.
Currently, only a briefing can be sent via an email.
The details of the recipient are entered by the sender and may need cross-checking.
Message Body
{
"$schema":"http://json-schema.org/draft-04/schema#",
"type":"object",
"properties":{
"sender":{
"type":"object",
"description":"Details about the subscriber who sent the product.",
"properties":{
"username":{
"type":"string",
"description":"The unique username of the subscriber."
},
"impersonation":{
"type":"boolean",
"description":"Optional, default 'false'. When true, this indicates that the action was performed whilst impersonating the subscriber."
},
"accountName":{
"type":"string",
"description":"The account the subscriber was associated with."
}
}
},
"recipient":{
"type":"object",
"description":"Details about the person who received the product, as entered by the sender. The recipient may or may not be an existing subscriber.",
"properties":{
"email":{
"type":"string",
"description":"The email address."
},
"name":{
"type":"string",
"description":"The name."
}, "company":{
"type":"string",
"description":"The company."
}
}
},
"product":{
"type":"object",
"description":"Details about which product was sent.",
"properties":{
"productCode":{
"type":"string",
"description":"The unique code of the product."
},
"title":{
"type":"string",
"description":"The title of the product."
},
"productType": {
"type":"string",
"description":"The type of product. Currently can only be 'Briefing'"
}
}
}
}
}