decentriq_platform.ab_media.advertiser_api
Classes
AdvertiserApi
AdvertiserApi(
dcr: AbMediaDcr,
)
Provides the API for interacting with an Audience Builder DCR as an advertiser.
add_audiences
def add_audiences(
self,
audiences: list[LookalikeAudienceDefinition | RuleBasedAudienceDefinition],
)
Add the given audiences to the current DCR. The audiences will only be visible to the publisher after they have been published.
Parameters:
audiences
: The audience definitions to add.
deprovision_audiences_dataset
def deprovision_audiences_dataset(
self,
) ‑> None
Deprovision the audiences dataset from the Audience Builder DCR.
estimate_audience_size
def estimate_audience_size(
self,
audience_name: str,
) ‑> int
Estimate the audience size for the advertiser.
Parameters:
audience_name
: Name of the audience for which the estimated audience size should be retrieved.
get_audience_attributes
def get_audience_attributes(
self,
) ‑> List[decentriq_platform.ab_media.advertiser_api.Attribute]
Retrieve all audience attributes. These attributes can be used to build new rule-based audiences.
get_audience_user_list
def get_audience_user_list(
self,
audience_name: str,
) ‑> List[str]
Get the list of user IDs for the advertiser.
Parameters:
audience_name
: Name of the audience for which the audience user list should be retrieved.
get_audiences
def get_audiences(
self,
) ‑> List[Union[decentriq_platform.ab_media.audience_definitions.RuleBasedAudienceDefinition, decentriq_platform.ab_media.audience_definitions.LookalikeAudienceDefinition, decentriq_platform.ab_media.audience_definitions.AdvertiserAudienceDefinition]]
Retrieve all advertiser audiences.
get_lookalike_audience_statistics
def get_lookalike_audience_statistics(
self,
audience_name: str,
) ‑> decentriq_platform.ab_media.audience_statistics_definition.LalAudienceStatistics
Retrieve lookalike statistics for an audience with the given name.
Parameters:
audience_name
: Name of the audience whose lookalike statistics should be retrieved.
get_validation_report
def get_validation_report(
self,
) ‑> dict[str, typing.Any]
Get the validation reports for the advertiser datasets.
Validation reports contain information about issues that were found in the provisioned data (e.g. values that don't match the expected schema or duplicated rows).
Returns: A dictionary with a single key "audiences" under which the validation report is stored.
make_audiences_available_to_publisher
def make_audiences_available_to_publisher(
self,
audience_names: List[str],
)
Make the audiences with the given names available to the Publisher. The Publisher will be able to download the user ids belonging to these audiences.
Parameters:
audience_names
: Names of the audiences to make available to the publisher.
provision_audiences_dataset
def provision_audiences_dataset(
self,
dataset_id: str,
key: Key,
) ‑> None
Provision the audiences dataset to the Audience Builder DCR.
Parameters:
dataset_id
: ID of the uploaded dataset to provision to the DCR.key
: Key used to encrypt the dataset.
upload_and_publish_audiences_dataset
def upload_and_publish_audiences_dataset(
self,
data: BinaryIO,
key: Key,
file_name: str,
) ‑> None
Upload the data to the Decentriq Platform and publish the data to the Audience Builder DCR.
Parameters:
data
: The data to upload and provision.key
: Key used to encrypt the file.file_name
: Name of the file.
Attribute
Attribute(
name: str,
values: List[str],
)
as_dict
def as_dict(
self,
) ‑> Dict[str, Any]