Rules Management API
You can create new competitor rules and/or risky content rules via the MAX dashboard. You do this one rule at a time. But you can also use the Ad Review Rules Management API described on this page to view or create many rules in one request.
There are two endpoints in this API:
/v1/rules/competitors- Make a
GETrequest to/v1/rules/competitorsto view all your pre-defined competitor rules (active and paused rules). - Make a
POSTrequest to/v1/rules/competitorsto create new competitor rules.
- Make a
/v1/rules/risky- Make a
GETrequest to/v1/rules/riskyto view all your pre-defined risky content rules (active and paused rules). - Make a
POSTrequest to/v1/rules/riskyto create new risky content rules.
- Make a
The following sections of this page explain these endpoints in greater detail.
The /v1/rules/competitors Endpoint
To create new competitor rules, make a POST request to the competitors endpoint.
Put the required fields in the request body, as described below.
You can create multiple competitor rules in each request.
This creates each new rule with an active status.
如果已经存在相同的活跃竞争对手规则,API 不会再次添加该规则。相反,它在响应的 existing_rules 数组中包含规则。如果存在相同的暂停规则,其状态将变为活跃。所有新规则或重新激活的规则都会出现在响应的 updated_rules 数组中。如果某个规则包含无效值,API 不会添加该规则,而是将其包含在响应的 invalid_rules 数组中。
To view all your existing competitor rules (active and paused rules) make a GET request to the competitors endpoint.
Target URL
https://api-safedk.applovin.com/v1/rules/competitorsPOST Request Body
Example
{ "rules": [ { "name": "android title rule", "platform": "android", "package_names": ["com.mytest.app"], "rule_type": "title", "value": ["com.examplegames.solitaire", "com.eg.Bricks"] }, ⋮ ]}Table of Request Body Elements
| Name | Type | Description / Valid Values | Required on Creation (POST) |
|---|---|---|---|
name | string | The rule name (you may use the same name for multiple rules). The maximum length is 35 characters. Rule names can contain alphanumeric characters, _, : , - , &, or . | true |
platform | string | "android" or "ios" | true |
package_names | string[] | The package names / bundle IDs of the publisher apps associated with this rule (e.g. "com.my.test.app"). If you pass an empty array here, your rule will apply to all your apps for this platform. Note: If one of these names is for an app that does not match the selected platform, the entire rule is invalid. | false |
rule_type | string | "title", "store_category", or "advertiser" | true |
value | string[] | 由 rule_type 字段指示的广告特征的可能值数组。如果广告与这些特征中的任何一个字符串匹配,则此规则将标记该广告。提示: 如果某个值不适合所选平台 (例如,您的规则适用于 Android 应用,但您传递了 iTunes ID),则整个规则无效,API 将拒绝该规则。该数组中字符串的正确值取决于您选择的 platform 和 rule_type (请参阅下文 “有效规则值” )。 | true |
Possible Errors
- 400 (Bad Request) if the request’s body structure is not valid.
- 401 (Unauthorized).
You must authenticate each API request.
To do so, add an
Api-KeyHTTP header to your request and set its value to your account’s Ad Review Key.您可以在 AppLovin 控制面板的 Account > General > Keys 部分找到 Ad Review Key。
Response Format (POST)
The response includes a hash with three elements:
updated_rules—the newly-created rules, and any paused rules that this request reactivatedexisting_rulesinvalid_rules
Each of these elements includes:
total—an integer that indicates the total number of rules covered by this elementrules—an array containing the relevantruleobjects (the same variety ofruleobject as is in thePOSTrequest—see “Table of Request Body Elements” above for the elements of this object)
Response Format (GET)
A successful response includes an array of all existing custom competitors rule objects.
This does not include any rules that were auto-generated by MAX Ad Review.
Elements of this response object include the name, platform, package_names, rule_type, and value (see “Table of Request Body Elements” above for an explanation of these elements), as well as is_active which is true if the rule is active, or false otherwise.
Example
[ { "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" }]The /v1/rules/risky Endpoint
To create new risky content rules, make a POST request to the risky endpoint.
Include the required fields in the request body, as described below.
You can create multiple risky content rules per request.
This creates all the new rules with an active status.
如果已经存在相同的活跃风险内容规则,API 不会再次添加该规则。相反,它在响应中包含 existing_rules 数组中的规则。如果存在相同的暂停规则,其状态将变为活跃。所有新规则或重新激活的规则都会出现在响应的 updated_rules 数组中。如果某个规则包含无效值,API 不会添加该规则,而是将其包含在响应的 invalid_rules 数组中。
To view all your existing risky content rules (active and paused rules) make a GET request to the risky endpoint.
Target URL
https://api-safedk.applovin.com/v1/rules/riskyPOST Request Body
Example
{ "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"] } ]}See “Response Format (POST): Example” below to see how the invalid rules are reported in the response to this request.
Table of Request Body Elements
| Name | Type | Description / Valid Values | Required on Creation (POST) |
|---|---|---|---|
name | string | The rule name (you may use the same name for multiple rules). The maximum length is 35 characters. Rule names can contain alphanumeric characters, _, : , - , &, or | true |
platform | string | "android" or "ios" | true |
package_names | string[] | The package names / bundle IDs of the publisher apps associated with this rule (e.g. "com.my.test.app"). If you pass an empty array here, your rule will apply to all your apps for this platform. Note: If one of these names is for an app that does not match the selected platform, the entire rule is invalid. | false |
rule_type | string | "title", "store_category", "advertiser", "web_domain", "content_rating", or "advisory" | true |
value | string[] | 由 rule_type 字段指示的广告特征的可能值数组。如果广告与这些特征中的任何一个字符串匹配,则此规则将标记该广告。提示: 如果某个值不适合所选平台 (例如,您的规则适用于 Android 应用,但您传递了 iTunes 内容分级值),则整个规则无效,API 将拒绝该规则。该数组中字符串的正确值取决于您选择的 platform 和 rule_type (请参阅下文 “有效规则值” )。 | true |
Possible Errors
- 400 (Bad Request) if the request’s body structure is not valid.
- 401 (Unauthorized).
You must authenticate each API request.
To do so, add an
Api-KeyHTTP header to your request and set its value to your account’s Ad Review Key.您可以在 AppLovin 控制面板的 Account > General > Keys 部分找到 Ad Review Key。
Response Format (POST)
The response includes a hash with three elements:
updated_rules—the newly-created rules and any paused rules that this request reactivatedexisting_rulesinvalid_rules
Each of these elements includes:
total—an integer that indicates the total number of rules covered by this elementrules—an array containing the relevantruleobjects (the same variety ofruleobject as is in thePOSTrequest—see “Table of Request Body Elements” above for the elements of this object)
示例
"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"] } ]}Response Format (GET)
A successful response includes an array of all existing custom risky content rule objects.
This does not include any rules that were auto-generated by MAX Ad Review.
Elements of this response object include the name, platform, package_names, rule_type, and value (see “Table of Request Body Elements” above for an explanation of these elements), as well as is_active which is true if the rule is active, or false otherwise.
Example
[ { "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" }]Limiting GET Requests to Avoid Timeouts
If there are too many rules, a GET request to these endpoints may time out while it tries to retrieve and send them all.
To fix this, you can limit the number of rules that these endpoints return.
Do this by adding the limit query parameter.
Then you can paginate through all rules by adding the offset query parameter.
For example:
GET /v1/rules/risky?limit=10&offset=0—get the first ten risky content rulesGET /v1/rules/risky?limit=10&offset=10—get the next ten risky content rulesGET /v1/rules/risky?limit=10&offset=20—get the next ten risky content rules- ⋮
The response will be an empty array if you reach the end of the list and there are no more rules to return.
Valid Rule Values
Android
有效值表
rule_type | Valid Values |
|---|---|
advertiser | Any valid advertiser name (e.g. "Super Lucky Casino"). Copy the exact advertiser from the store (this is case sensitive). |
advisory | Advisory strings from Google Play (e.g. "Sexual Content"). See “Advisory Valid Values” below. |
content_rating | 美国的 Google Play 内容分级:"Everyone"、"Everyone 10+"、"Teen"、"Mature 17+" 或 "Adults only 18+"。 |
store_category | Google play categories strings. See “Store Categories Valid Values” below. |
title | The app package name (free text rules are not supported by this API, only by the UI) |
web_domain | A valid web domain (without “http(s)”, “www” or trailing slashes), for example: "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 | Valid Values |
|---|---|
advertiser | Any valid advertiser name (e.g. "Super Lucky Casino"). Copy the exact advertiser from the store (this is case sensitive). |
advisory | Advisory strings from iTunes (e.g. "Frequent/Intense Alcohol, Tobacco or Drug Use or References"). See “Advisory Valid Values” below. |
content_rating | iTunes 在美国的 content_rating 值:"4+"、"9+"、"12+" 或 "17+" |
store_category | iTunes categories strings. See “Store Categories Valid Values” below. |
title | The iTunes ID (free text rules are not supported by this API, only by the UI) |
web_domain | A valid web domain (without “http(s)”, “www” or trailing slashes), for example: "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"