filter_by_tags_and_metadata
The job filters contents within an archive based on specified tags and metadata criteria. This allows you to retrieve a subset of content IDs that match your defined filtering rules.
Required Account Privileges: "read"
Request JSON ["inputs"]:
"archive": string (3 <= len <= 30) unique in account null NOT allowed A unique string identifier for the archive within your account. "archive_content_ids_subset": list of ints or None null allowed Optional. A list of integers representing the IDs of the specific contents to consider for filtering. If not provided, all contents in the archive will be considered. "expression_to_tags": dict null allowed Optional. A dictionary where the keys are tag matching strategies and the values are lists of tags. This parameter allows filtering based on the presence or absence of specific tags. The available strategies are: "accept on any exact match": Include contents that have at least one tag that exactly matches any of the tags in the list. "accept on any partial match": Include contents that have at least one tag that partially matches any of the tags in the list. "accept on all exact matches": Include contents that have all the tags in the list, with exact matches. "accept on all partial matches": Include contents that have tags that partially match all the tags in the list. "reject on any exact match": Exclude contents that have at least one tag that exactly matches any of the tags in the list. "reject on any partial match": Exclude contents that have at least one tag that partially matches any of the tags in the list. "reject on all exact matches": Exclude contents that have all the tags in the list, with exact matches. "reject on all partial matches": Exclude contents that have tags that partially match all the tags in the list. "metadata_name_to_expressions_and_values": dict null allowed Optional. A dictionary where the keys are metadata names and the values are lists of dictionaries. Each dictionary in the list defines a filtering condition for that metadata. Each inner dictionary must contain the keys "expression" and "value". The "expression" specifies the comparison operation to perform on the metadata value. The valid expressions are: "equal to": Checks if the metadata value is equal to the provided value. "not equal to": Checks if the metadata value is not equal to the provided value. "contains": Checks if the metadata value contains the provided value (for string types). "does not contain": Checks if the metadata value does not contain the provided value (for string types). "greater than": Checks if the metadata value is greater than the provided value (for comparable types). "greater than or equal to": Checks if the metadata value is greater than or equal to the provided value (for comparable types). "less than": Checks if the metadata value is less than the provided value (for comparable types). "less than or equal to": Checks if the metadata value is less than or equal to the provided value (for comparable types). "between": Checks if the metadata value is within the inclusive range defined by the provided value (expects a list or tuple of two values). "not between": Checks if the metadata value is outside the inclusive range defined by the provided value (expects a list or tuple of two values). "in": Checks if the metadata value is present in the provided list or tuple. "not in": Checks if the metadata value is not present in the provided list or tuple. "is null": Checks if the metadata value is null. The "value" field should be null for this expression. "is not null": Checks if the metadata value is not null. The "value" field should be null for this expression. "is empty": Checks if the metadata value is an empty string or an empty list. The "value" field should be relevant to the metadata type, e.g., "" for string or [] for list. "is not empty": Checks if the metadata value is not an empty string or an empty list. The "value" field should be relevant to the metadata type, e.g., "" for string or [] for list. "is true": Checks if the metadata value is boolean true. The "value" field should be boolean true. "is false": Checks if the metadata value is boolean false. The "value" field should be boolean false. "match date": Checks if the metadata value (assumed to be a date) matches the provided date string. "does not match date": Checks if the metadata value (assumed to be a date) does not match the provided date string. "match day": Checks if the day of the metadata value (assumed to be a date) matches the provided day (integer). "match month": Checks if the month of the metadata value (assumed to be a date) matches the provided month (integer). "match year": Checks if the year of the metadata value (assumed to be a date) matches the provided year (integer). "before": Checks if the metadata value (assumed to be a date) is before the provided date string. "before or same": Checks if the metadata value (assumed to be a date) is before or the same as the provided date string. "after": Checks if the metadata value (assumed to be a date) is after the provided date string. "after or same": Checks if the metadata value (assumed to be a date) is after or the same as the provided date string. Please note that all dates must be strings and follow the format YYYY-MM-DD
Response JSON ["results"]
"filtered_ids": list of ints