Reddit Compliance Integration Guide
Overview
Socialgist and Reddit will require from April 1, 2019 that all Reddit data feed customers keep their copies of Reddit data up to date on a go-forward basis using edit and delete notifications provided in a compliance data stream. All copies of Reddit data residing in your infrastructure, both production and non-production, must be updated with these changes within 24 hours after the change notification is received. These notifications come in a separate stream provisioned in your Socialgist account. This document outlines the types of updates and deletion events contained in the stream.
With Reddit Standard, use the "id" value provided in the compliance update messages to associate the update or delete event to the "sitepostid" on your records for that message. Regardless of whether the message is a post or comment, the "id" value in the compliance stream will correspond to a value for each message updated, deleted or "gone" ("gone" should be processed in the same way as "deleted"). Note that posts always have the "thing" type "link", regardless of whether a link is included in the post. Please note that other attributes such as the message URL may not always be populated on compliance notifications.
For the Reddit Premium product, you can match the "id" field in the compliance stream to the "id" field in your content stream.
Deleted Posts & Comments
Here is an example of a notice of a post being deleted. This post must be removed from your dataset.
{
"thing": "link",
"id": "fw52b4",
"name": "t3_fw52b4",
"author": "2002kid",
"created": 1586200885,
"permalink": "https://www.reddit.com/r/MemeTemplatesOfficial/comments/fw52b4/i_dont_have_any_title_for_this_picture_of_a/",
"subreddit": "MemeTemplatesOfficial",
"subreddit_id": "t5_3k0bl",
"parent_id": null,
"link_id": null,
"$event": {
"action": "deleted",
"created": 1586263619,
"changes": {}
}
}Here is an example of a notice of a comment being deleted. This post must be removed from your dataset.
{
"thing": "comment",
"id": "fmcso1g",
"name": "t1_fmcso1g",
"author": "TehMadWolf",
"created": 1585952048,
"permalink": "https://www.reddit.com/r/pcgaming/comments/fuhpkp/unwanted_steam_keys/fmcso1g/",
"subreddit": "pcgaming",
"subreddit_id": "t5_2qhfg",
"parent_id": "t3_fuhpkp",
"link_id": "t3_fuhpkp",
"$event": {
"action": "deleted",
"created": 1586263623,
"changes": {}
}
}
Updated Post & Comments
In cases where a post or comment's text has been updated, you will see a "previous_body" field followed by an updated "body" field. Similarly, previous_body_html and body_html are provided. These updates should be applied to your datasets.
{
"thing": "comment",
"id": "eapq35g",
"name": "t1_eapq35g",
"author": "DaGhostmeister",
"created": 1543498497,
"permalink": "https://www.reddit.com/r/gaming/comments/a1hd66/some_explanation_for_recent_events/eapq35g/",
"subreddit": "gaming",
"subreddit_id": "t5_2qh03",
"parent_id": "t3_a1hd66",
"link_id": "t3_a1hd66",
"$event": {
"action": "updated",
"created": 1543502102,
"changes": {
"previous_body": "Fallout 76 is a multilayer only fallout game with no NPCs. You spend your game time collecting junk to build.\nDiabolo is on a phone or something ",
"body": "Fallout 76 is a multilayer only fallout game with no NPCs. You spend your game time collecting junk to build.\nDiabolo is on a phone or something.\nBFV and BOPS4 went down a partial battle royale route. ",
"previous_body_html": "<div class=\"md\"><p>Fallout 76 is a multilayer only fallout game with no NPCs. You spend your game time collecting junk to build.\nDiabolo is on a phone or something </p>\n</div>",
"body_html": "<div class=\"md\"><p>Fallout 76 is a multilayer only fallout game with no NPCs. You spend your game time collecting junk to build.\nDiabolo is on a phone or something.\nBFV and BOPS4 went down a partial battle royale route. </p>\n</div>"
}
}
}Banned Posts & Comments
"action":"banned" indicates that a moderator has banned the post or comment. It must be removed from your datasets.
{
"thing": "link",
"id": "a1hdng",
"name": "t3_a1hdng",
"author": "TalfrynKenobi",
"created": 1543498500,
"permalink": "https://www.reddit.com/r/BokuNoHeroAcademia/comments/a1hdng/is_it_worth_picking_up_the_manga_from_where/",
"subreddit": "BokuNoHeroAcademia",
"subreddit_id": "t5_34a0h",
"parent_id": null,
"link_id": null,
"$event": {
"action": "banned",
"created": 1543502102,
"changes": {
"previous_selftext": "",
"selftext": "[removed]"
}
}
}Gone Posts & Comments
When the Reddit API does not return any reference information indicating that a particular message was deleted or banned, but the message is no longer available, the "action" value will be "gone". Gone posts and comments must be removed from your data stores.
{
"thing": "link",
"id": "hreoc4",
"name": "t3_hreoc4",
"author": "braydensly",
"created": 1594777562,
"permalink": "https://www.reddit.com/r/u_braydensly/comments/hreoc4/psvr_for_sale_bought_for_500_selling_for_400_used/",
"subreddit": "u_braydensly",
"subreddit_id": "t5_2v7t15",
"parent_id": null,
"link_id": null,
"$event": {
"action": "gone",
"created": 1595335877,
"changes": {}
}
}