start_campaign_asset_activation_task
¶
start_campaign_asset_activation_task(
catalog: Catalog,
campaign_identifier: CampaignIdentifier,
campaign_asset_identifiers: CampaignAssetIdentifiers,
*,
config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
client_token: Optional[ClientToken] = None,
) -> StartCampaignAssetActivationTaskResponse
Activates 1–25 of a campaign's assets as one ordered unit, and returns a task to poll. Takes a list because the service owns the ordering. Assets link to one another by URL — an email's call-to-action carries the landing page's URL, the landing page's download field carries the document's — and a URL does not exist until the asset it points at is activated. Those edges are derived by the service from the campaign's pinned template, so reconstructing and topologically sorting them is work the service has already done, and getting it wrong arms an email with a dead link. Name every asset you want live and the service sequences them; "activate everything" is the list with every id in it, which ListCampaignAssets already gave you. Asynchronous, because activating an asset installs or arms behaviour that runs later and an email activation bulk-loads its audience into the delivery platform. Everything decidable without a write to the delivery platform is evaluated before this returns; everything else lands on the task. A refusal that applies to one asset does not fail the request: that asset is on the task already FAILED, with its reason, and the rest run. A refusal that applies to the whole request — a malformed list, an unknown campaign, another task already running on this campaign, this service's service-linked role being deleted (ConflictException SERVICE_LINKED_ROLE_DELETION_IN_PROGRESS), a campaign setting an asset in the request needs (ValidationException CAMPAIGN_INCOMPLETE), a campaign sender that no longer passes CreateCampaign's sender rules while the request names an email (ValidationException with no FieldList, whose message ends with one Reason: <code> token per failed rule: PATTERN_MISMATCH, SENDER_DOMAIN_NOT_ALLIANCE_LEAD, or SENDER_DOMAIN_DKIM_MISSING and/or SENDER_DOMAIN_DMARC_MISSING) — is thrown, and nothing starts. One task runs on a campaign at a time. A second concurrent call is refused with ConflictException / CAMPAIGN_ACTIVATION_IN_PROGRESS, whose ResourceId names the task already holding the campaign. Two tasks over disjoint asset sets are refused too: the guard is deliberately campaign-wide, because overlapping runs made the per-asset status misleading rather than merely contended.
Parameters:
-
catalog(Catalog) –The catalog (AWS or Sandbox).
-
campaign_identifier(CampaignIdentifier) –The campaign identifier, which also authorizes the call.
-
campaign_asset_identifiers(CampaignAssetIdentifiers) –The assets to activate, in any order — the service derives the dependency order and ignores the order given here.
-
client_token(Optional[ClientToken], default:None) –Idempotency token. Two requests carrying the same token are one request, and the second returns the first one's task rather than starting a second. The deduplication window is the life of the task record, not a fixed number of hours: replaying a token after the task has expired starts a new task. Stated because a caller would otherwise assume the usual few-hour guarantee.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action. An IAM denial carries no
Reason. A refusal for the caller's Partner Central state carries one, so a client tells the two apart by its presence. -
InternalServerException–An unexpected error occurred during the processing of the request.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by the service. A caller branches on
Reason, and where the rejection is attributable to particular fields it readsFieldListrather than parsingMessage, which is prose and may change. -
ConflictException–The request conflicts with the current state of the resource.
-
ResourceNotFoundException–The specified resource does not exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Activate a whole campaign kit
>>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-4b81e0c9f2a7b', 'ast-9f3c1a2b7d40e', 'ast-2k7m4p9x1c6qd', 'ast-7w3n8r5t2h1ya'])
Some assets refused, the rest started anyway
>>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-4b81e0c9f2a7b', 'ast-9f3c1a2b7d40e', 'ast-2k7m4p9x1c6qd', 'ast-7w3n8r5t2h1ya'])
Every asset refused, so the task is FAILED at once
>>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-2k7m4p9x1c6qd'])
Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 | |