Rules Management API

您可以通过 MAX 控制面板创建新的竞争对手规则和/或风险内容规则。 您一次只能创建一条规则。 但您也可以使用本页介绍的 Ad Review 规则管理 API,在一次请求中查看或创建多条规则。

此 API 中有两个端点:

  1. /v1/rules/competitors
    • /v1/rules/competitors 发送 GET 请求,以查看您所有预定义的竞争对手规则(活跃和暂停的规则)。
    • /v1/rules/competitors 发送 POST 请求,以创建新的竞争对手规则。
  2. /v1/rules/risky
    • /v1/rules/risky 发送 GET 请求,以查看您所有预定义的风险内容规则(活跃 and 暂停的规则)。
    • /v1/rules/risky 发送 POST 请求,以创建新的风险内容规则。

本页的以下部分将更详细地介绍这些端点。

您必须对每个 API 请求进行身份验证。 为此,请在请求中添加 Api-Key HTTP 标头,并将其值设置为您账户的 Ad Review Key。 您可以在 AppLovin 控制面板的 Account > General > Keys 部分找到您的 Ad Review Key。

目标 URL

https://api-safedk.applovin.com/v1/rules/competitors

POST 请求体

示例

{
  "rules": [
    {
      "name": "android title rule",
      "platform": "android",
      "package_names": ["com.mytest.app"],
      "rule_type": "title",
      "value": ["com.examplegames.solitaire", "com.eg.Bricks"]
    },
    ⋮
  ]
}

请求体元素表

名称类型描述 / 有效值创建时必需 (POST)
namestring规则名称(多条规则可以使用相同的名称)。最大长度为 35 个字符。规则名称可以包含字母数字字符、_:-& true
platformstring"android""ios"true
package_namesstring[]与此规则关联的发行商应用的包名 / bundle ID(例如 "com.my.test.app")。如果您在此处传递一个空数组,您的规则将适用于此平台的所有应用。注意: 如果其中一个名称对应的应用与所选平台不匹配,则整条规则无效。false
rule_typestring"title""store_category""advertiser"true
valuestring[]rule_type 字段指示的广告特征的可能值数组。如果广告与这些特征中的任何一个字符串匹配,则此规则将标记该广告。注意: 如果其中一个值不适合所选平台(例如,您的规则适用于 Android 应用,但您传递了 iTunes ID),则整条规则无效,API 将拒绝该规则。该数组中字符串的正确值取决于您选择的 platformrule_type(请参阅下文 "有效规则值")。true

可能的错误

  • 如果请求的实体结构无效,则返回 400 (Bad Request)。
  • 401 (Unauthorized)。 您必须对每个 API 请求进行身份验证。 为此,请在请求中添加 Api-Key HTTP 标头,并将其值设置为您账户的 Ad Review Key。 您可以在 AppLovin 控制面板的 Account > General > Keys 部分找到您的 Ad Review Key。

响应格式 (POST)

响应包含一个具有三个元素的哈希:

  1. updated_rules——新创建的规则,以及此请求重新激活的任何已暂停规则
  2. existing_rules
  3. invalid_rules

这些元素中的每一个都包括:

  1. total——一个整数,表示此元素涵盖的规则总数
  2. rules——一个包含相关 rule 对象的数组(与 POST 请求中的 rule 对象类型相同——有关此对象的元素,请参阅上文 "请求体元素表"

响应格式 (GET)

成功的响应包含所有现有自定义竞争对手规则对象的数组。 这不包括由 MAX Ad Review 自动生成的任何规则。 此响应对象的元素包括 nameplatformpackage_namesrule_typevalue(有关这些元素的说明,请参阅上文 "请求体元素表"),以及 is_active(如果规则处于活跃状态,则为 true,否则为 false)。

示例

[
  {
    "name": "android title rule",
    "platform": "android",
    "package_names":["com.test.my_first_app","com.test.my_second_app"],
    "rule_type": "title",
    "value": ["solitaire", "block", "com.games.solitaire", "com.bestgames.Bricks"],
    "is_active": "true"
  },
  {
    "name": "ios title rule",
    "platform": "ios",
    "rule_type": "title",
    "value": ["1449713068"],
    "is_active": "false"
  }
]

/v1/rules/risky 端点

要创建新的风险内容规则,请向 risky 端点发送 POST 请求。 在请求体中包含必需的字段,如下所述。 您可以在每个请求中创建多个风险内容规则。 这将创建所有处于活跃状态的新规则。

如果已经存在相同的活跃风险内容规则,API 不会再次添加该规则。 相反,它会将该规则包含在响应的 existing_rules 数组中。 如果存在相同的暂停规则,其状态将变为活跃。 所有新规则或重新激活的规则都会出现在响应的 updated_rules 数组中。 如果规则包含无效值,API 不会添加该规则,而是将其包含在响应的 invalid_rules 数组中。

Rules Management API: Add Risky Content Rule

要查看所有现有的风险内容规则(活跃和暂停的规则),请向 risky 端点发送 GET 请求。

Rules Management API: View Risky Content Rules

此端点不允许您编辑或暂停现有规则。 相反,请在 UI 中进行操作。

目标 URL

https://api-safedk.applovin.com/v1/rules/competitors

POST 请求体

示例

{
  "rules": [
    {
      "name": "android title rule",
      "platform": "android",
      "package_names": ["com.mytest.app"],
      "rule_type": "title",
      "value": ["com.examplegames.solitaire", "com.eg.Bricks"]
    },
    ⋮
  ]
}

请求体元素表

名称类型描述 / 有效值创建时必需 (POST)
namestring规则名称(多条规则可以使用相同的名称)。最大长度为 35 个字符。规则名称可以包含字母数字字符、_:-& true
platformstring"android""ios"true
package_namesstring[]与此规则关联的发行商应用的包名 / bundle ID(例如 "com.my.test.app")。如果您在此处传递一个空数组,您的规则将适用于此平台的所有应用。注意: 如果其中一个名称对应的应用与所选平台不匹配,则整条规则无效。false
rule_typestring"title""store_category""advertiser"true
valuestring[]rule_type 字段指示的广告特征的可能值数组。如果广告与这些特征中的任何一个字符串匹配,则此规则将标记该广告。注意: 如果其中一个值不适合所选平台(例如,您的规则适用于 Android 应用,但您传递了 iTunes ID),则整条规则无效,API 将拒绝该规则。该数组中字符串的正确值取决于您选择的 platformrule_type(请参阅下文 "有效规则值")。true

可能的错误

  • 如果请求的实体结构无效,则返回 400 (Bad Request)。
  • 401 (Unauthorized)。 您必须对每个 API 请求进行身份验证。 为此,请在请求中添加 Api-Key HTTP 标头,并将其值设置为您账户的 Ad Review Key。 您可以在 AppLovin 控制面板的 Account > General > Keys 部分找到您的 Ad Review Key。

响应格式 (POST)

响应包含一个具有三个元素的哈希:

  1. updated_rules——新创建的规则,以及此请求重新激活的任何已暂停规则
  2. existing_rules
  3. invalid_rules

这些元素中的每一个都包括:

  1. total——一个整数,表示此元素涵盖的规则总数
  2. rules——一个包含相关 rule 对象的数组(与 POST 请求中的 rule 对象类型相同——有关此对象的元素,请参阅上文 "请求体元素表"

响应格式 (GET)

成功的响应包含所有现有自定义竞争对手规则对象的数组。 这不包括由 MAX Ad Review 自动生成的任何规则。 此响应对象的元素包括 nameplatformpackage_namesrule_typevalue(有关这些元素的说明,请参阅上文 "请求体元素表"),以及 is_active(如果规则处于活跃状态,则为 true,否则为 false)。

示例

[
  {
    "name": "android title rule",
    "platform": "android",
    "package_names":["com.test.my_first_app","com.test.my_second_app"],
    "rule_type": "title",
    "value": ["solitaire", "block", "com.games.solitaire", "com.bestgames.Bricks"],
    "is_active": "true"
  },
  {
    "name": "ios title rule",
    "platform": "ios",
    "rule_type": "title",
    "value": ["1449713068"],
    "is_active": "false"
  }
]

/v1/rules/risky 端点

要创建新的风险内容规则,请向 risky 端点发送 POST 请求。 在请求体中包含必需的字段,如下所述。 您可以在每个请求中创建多个风险内容规则。 这将创建所有处于活跃状态的新规则。

如果已经存在相同的活跃风险内容规则,API 不会再次添加该规则。 相反,它会将该规则包含在响应的 existing_rules 数组中。 如果存在相同的暂停规则,其状态将变为活跃。 所有新规则或重新激活的规则都会出现在响应的 updated_rules 数组中。 如果规则包含无效值,API 不会添加该规则,而是将其包含在响应的 invalid_rules 数组中。

Rules Management API: Add Risky Content Rule

要查看所有现有的风险内容规则(活跃和暂停的规则),请向 risky 端点发送 GET 请求。

Rules Management API: View Risky Content Rules

此端点不允许您编辑或暂停现有规则。 相反,请在 UI 中进行操作。

目标 URL

https://api-safedk.applovin.com/v1/rules/risky

POST 请求体

示例

{
  "rules": [
    {
      "name": "android title rule",
      "platform": "android",
      "package_names": ["com.my.android.test.app"],
      "rule_type": "title",
      "value": ["com.games.solitaire","com.games.Bricks"]
    },
    {
      "name": "ios title rule",
      "platform": "ios",
      "rule_type": "title",
      "value": ["1349713000"]
    },
    {
      "name": "store_category rule",
      "platform": "ios",
      "rule_type": "store_category",
      "value": ["Action", "Card"]
    },
    {
      "name": "advertiser ios rule",
      "platform": "ios",
      "rule_type": "advertiser",
      "value": ["ExampleAdvertiser1", "ExampleAdvertiser2"]
    },
    {
      "name": "content_rating ios rule",
      "platform": "ios",
      "rule_type": "content_rating",
      "value": ["12+", "17+"]
    },
    {
      "name": "advisory ios rule",
      "platform": "ios",
      "rule_type": "advisory",
      "value": ["Frequent/Intense Alcohol, Tobacco or Drug Use or References"]
    },
    {
      "name": "web_domain rule",
      "platform": "ios",
      "rule_type": "web_domain",
      "value": ["test.com", "example.com"]
    },
    {
      "name": "ios_platform_with_android_package_name_rule",  //invalid rule
      "platform": "ios",
      "package_names": "com.my.android.test.app",
      "rule_type": "title",
      "value": ["1449713068"]
    },
    {
      "name": "ios_platform_with_android_title_value",  //invalid rule
      "platform": "ios",
      "rule_type": "title",
      "value": ["1449713068", "com.games.solitaire1"]
    },
    {
      "name": "ios_platform_with_android_content_rating_value",  //invalid rule
      "platform": "ios",
      "rule_type": "content_rating",
      "value": ["Everyone"]
    }
  ]
}

请参阅下文 "响应格式 (POST): 示例",了解如何在对此请求的响应中报告无效规则。

请求体元素表

名称类型描述 / 有效值创建时必需 (POST)
namestring规则名称(多条规则可以使用相同的名称)。最大长度为 35 个字符。规则名称可以包含字母数字字符、_:-& true
platformstring"android""ios"true
package_namesstring[]与此规则关联的发行商应用的包名 / bundle ID(例如 "com.my.test.app")。如果您在此处传递一个空数组,您的规则将适用于此平台的所有应用。注意: 如果其中一个名称对应的应用与所选平台不匹配,则整条规则无效。false
rule_typestring"title""store_category""advertiser""web_domain""content_rating""advisory"true
valuestring[]rule_type 字段指示的广告特征的可能值数组。如果广告与这些特征中的任何一个字符串匹配,则此规则将标记该广告。注意: 如果其中一个值不适合所选平台(例如,您的规则适用于 Android 应用,但您传递了 iTunes 内容分级值),则整条规则无效,API 将拒绝该规则。该数组中字符串的正确值取决于您选择的 platformrule_type(请参阅下文 "有效规则值")。true

可能的错误

  • 如果请求的实体结构无效,则返回 400 (Bad Request)。
  • 401 (Unauthorized)。 您必须对每个 API 请求进行身份验证。 为此,请在请求中添加 Api-Key HTTP 标头,并将其值设置为您账户的 Ad Review Key。 您可以在 AppLovin 控制面板的 Account > General > Keys 部分找到您的 Ad Review Key。

响应格式 (POST)

响应包含一个具有三个元素的哈希:

  1. updated_rules——新创建的规则以及此请求重新激活的任何已暂停规则
  2. existing_rules
  3. invalid_rules

这些元素中的每一个都包括:

  1. total——一个整数,表示此元素涵盖的规则总数
  2. rules——一个包含相关 rule 对象的数组(与 POST 请求中的 rule 对象类型相同——有关此对象的元素,请参阅上文 "请求体元素表"

示例

"updated_rules": {
  "total": 6
  "rules": {[
    {
      "name": "android title rule",
      "platform": "android",
      "package_names": ["com.my.android.test.app"],
      "rule_type": "title",
      "value": ["com.games.solitaire","com.games.Bricks"]
    }, {…},{…},{…},{…},{…}
  ]
},
"invalid_rules": {
  "total": 3
  "rules": [
    {
      "name": "ios_platform_with_android_package_name_rule",  //invalid rule
      "platform": "ios",
      "my_apps_package_name": "com.my.android.test.app",
      "rule_type": "title",
      "value": ["1449713068"]
    }, {…},{…}
  ]
},
"existing_rules": {
  "total": 1
  "rules":[
    {
      "name": "web_domain rule",
      "platform": "ios",
      "rule_type": "web_domain",
      "value": ["test.com", "example.com"]
    }
  ]
}

响应格式 (GET)

成功的响应包含所有现有自定义风险内容规则对象的数组。 这不包括由 MAX Ad Review 自动生成的任何规则。 此响应对象的元素包括 nameplatformpackage_namesrule_typevalue(有关这些元素的说明,请参阅上文 "请求体元素表"),以及 is_active(如果规则处于活跃状态,则为 true,否则为 false)。

示例

[
  {
    "name": "android title rule",
    "platform": "android",
    "package_names":["com.test.my_first_app","com.test.my_second_app"],
    "rule_type": "title",
    "value": ["solitaire", "block", "com.games.solitaire", "com.bestgames.Bricks"],
    "is_active": "true"
  },
  {
    "name": "ios title rule",
    "platform": "ios",
    "rule_type": "title",
    "value": ["1449713068"],
    "is_active": "false"
  }
]

限制 GET 请求以避免超时

如果规则太多,向这些端点发送的 GET 请求在尝试检索并发送所有规则时可能会超时。 要解决此问题,您可以限制这些端点返回的规则数量。 为此,请添加 limit 查询参数。 然后,您可以通过添加 offset 查询参数来分页浏览所有规则。 例如:

  1. GET /v1/rules/risky?limit=10&offset=0——获取前十条风险内容规则
  2. GET /v1/rules/risky?limit=10&offset=10——获取下十条风险内容规则
  3. GET /v1/rules/risky?limit=10&offset=20——获取下十条风险内容规则

如果您到达列表末尾且没有更多规则可返回,则响应将是一个空数组。

有效规则值

    Android

    有效值表

    rule_type有效值
    advertiser任何有效的广告主名称(例如 "Super Lucky Casino")。请从商店复制完全一致的广告主名称(区分大小写)。
    advisory来自 Google Play 的分级提示字符串(例如 "Sexual Content")。请参阅下文 “分级提示有效值”
    content_rating美国的 Google Play 内容分级:"Everyone""Everyone 10+""Teen""Mature 17+""Adults only 18+"
    store_categoryGoogle Play 类别字符串。请参阅下文 “商店类别有效值”
    title应用包名(此 API 不支持自由文本规则,仅 UI 支持)
    web_domain有效的 Web 域名(不含 “http(s)”、“www” 或末尾斜杠),例如:"apple.com"

    商店类别有效值

    • "Action"
    • "Action & Adventure"
    • "Adventure"
    • "Arcade"
    • "Art & Design"
    • "Auto & Vehicles"
    • "Beauty"
    • "Board"
    • "Books & Reference"
    • "Brain Games"
    • "Business"
    • "Card"
    • "Cards"
    • "Casino"
    • "Casual"
    • "Comics"
    • "Communication"
    • "Creativity"
    • "Dating"
    • "Education"
    • "Educational"
    • "Entertainment"
    • "Events"
    • "Finance"
    • "Food & Drink"
    • "Health & Fitness"
    • "House & Home"
    • "Libraries & Demo"
    • "Lifestyle"
    • "Maps & Navigation"
    • "Medical"
    • "Music"
    • "Music & Audio"
    • "Music & Video"
    • "Music Games"
    • "News & Magazines"
    • "Parenting"
    • "Personalization"
    • "Photography"
    • "Pretend Play"
    • "Productivity"
    • "Puzzle"
    • "Racing"
    • "Role Playing"
    • "Shopping"
    • "Simulation"
    • "Social"
    • "Sports"
    • "Strategy"
    • "Tools"
    • "Travel & Local"
    • "Trivia"
    • "Video Players & Editors"
    • "Weather"
    • "Word"
    • "Word Games"

    分级提示有效值

    • "Alcohol Reference"
    • "Alcohol and Tobacco Reference"
    • "Blood"
    • "Blood and Gore"
    • "Cartoon Violence"
    • "Comic Mischief"
    • "Crude Humor"
    • "Diverse Content: Discretion Advised"
    • "Drug Reference"
    • "Drug and Alcohol Reference"
    • "Fantasy Violence"
    • "Fear"
    • "Gambling"
    • "General"
    • "Horror"
    • "Implied Violence"
    • "Intense Violence"
    • "Language"
    • "Mild Blood"
    • "Mild Fantasy Violence"
    • "Mild Language"
    • "Mild Suggestive Themes"
    • "Mild Swearing"
    • "Mild Violence"
    • "Moderate Violence"
    • "Nudity"
    • "Online Interactivity"
    • "Parental Guidance Recommended"
    • "Partial Nudity"
    • "Real Gambling/Paid Contests"
    • "Sexual Content"
    • "Sexual Innuendo"
    • "Sexual Themes"
    • "Sexual Violence"
    • "Simulated Gambling"
    • "Strong Language"
    • "Strong Sexual Content"
    • "Strong Violence"
    • "Suggestive Themes"
    • "Tobacco Reference"
    • "Use of Alcohol"
    • "Use of Alcohol and Tobacco"
    • "Use of Drugs"
    • "Use of Drugs and Alcohol"
    • "Use of Tobacco"
    • "Violence"
    • "Violent References"

    iOS

    有效值表

    rule_type有效值
    advertiser任何有效的广告主名称(例如 "Super Lucky Casino")。请从商店复制完全一致的广告主名称(区分大小写)。
    advisory来自 iTunes 的分级提示字符串(例如 "Frequent/Intense Alcohol, Tobacco or Drug Use or References")。请参阅下文 “分级提示有效值”
    content_ratingiTunes 在美国的内容分级值:"4+""9+""12+""17+"
    store_categoryiTunes 类别字符串。请参阅下文 “商店类别有效值”
    titleiTunes ID(此 API 不支持自由文本规则,仅 UI 支持)
    web_domain有效的 Web 域名(不含 “http(s)”、“www” 或末尾斜杠),例如:"apple.com"

    商店类别有效值

    • "Action"
    • "Adventure"
    • "Animals & Nature"
    • "Arcade"
    • "Art"
    • "Board"
    • "Book"
    • "Books"
    • "Business"
    • "Card"
    • "Casino"
    • "Casual"
    • "Celebrations"
    • "Celebrities"
    • "Comics & Cartoons"
    • "Developer Tools"
    • "Eating & Drinking"
    • "Education"
    • "Emoji & Expressions"
    • "Entertainment"
    • "Family"
    • "Fashion"
    • "Finance"
    • "Food & Drink"
    • "Games"
    • "Gaming"
    • "Graphics & Design"
    • "Health & Fitness"
    • "Kids & Family"
    • "Lifestyle"
    • "Magazines & Newspapers"
    • "Medical"
    • "Movies & TV"
    • "Music"
    • "Navigation"
    • "News"
    • "People"
    • "Photo & Video"
    • "Places & Objects"
    • "Productivity"
    • "Puzzle"
    • "Racing"
    • "Reference"
    • "Role Playing"
    • "Role-Playing"
    • "Shopping"
    • "Simulation"
    • "Social Networking"
    • "Sports"
    • "Sports & Activities"
    • "Stickers"
    • "Strategy"
    • "Travel"
    • "Trivia"
    • "Utilities"
    • "Weather"
    • "Word"

    分级提示有效值

    • "Frequent/Intense Alcohol, Tobacco or Drug Use or References"
    • "Frequent/Intense Alcohol, Tobacco, or Drug Use or References"
    • "Frequent/Intense Cartoon or Fantasy Violence"
    • "Frequent/Intense Horror/Fear Themes"
    • "Frequent/Intense Mature/Suggestive Themes"
    • "Frequent/Intense Medical/Treatment Information"
    • "Frequent/Intense Profanity or Crude Humor"
    • "Frequent/Intense Profanity or Crude Humour"
    • "Frequent/Intense Realistic Violence"
    • "Frequent/Intense Sexual Content or Nudity"
    • "Frequent/Intense Simulated Gambling"
    • "Gambling and Contests"
    • "Infrequent/Mild Alcohol, Tobacco or Drug Use or References"
    • "Infrequent/Mild Alcohol, Tobacco, or Drug Use or References"
    • "Infrequent/Mild Cartoon or Fantasy Violence"
    • "Infrequent/Mild Horror/Fear Themes"
    • "Infrequent/Mild Mature/Suggestive Themes"
    • "Infrequent/Mild Medical/Treatment Information"
    • "Infrequent/Mild Profanity or Crude Humor"
    • "Infrequent/Mild Profanity or Crude Humour"
    • "Infrequent/Mild Realistic Violence"
    • "Infrequent/Mild Sexual Content and Nudity"
    • "Infrequent/Mild Simulated Gambling"
    • "Unrestricted Web Access"

变更日志

    Android

    iOS


search