Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Creative API issue #103

Open
vidyakumar2023 opened this issue Mar 20, 2024 · 0 comments
Open

Copy Creative API issue #103

vidyakumar2023 opened this issue Mar 20, 2024 · 0 comments

Comments

@vidyakumar2023
Copy link

Hi team,
We have a copy creative requirement. We are using Python Client Library for CM360 API
We didn't see any API for Copy Creative(In CM360 API explorer), so we are using the below steps to create a copy of Creative

  1. Search creative in Campaign and get the Creative ID.
  2. If creative is available in the campaign, we will mark the creative ID.
  3. If creative is not found in the campaign, we will search in the advertiser if it is found will mark the creative id.
  4. For copy creative we are using below API calls
    First, we will call creatives().get() API using creative ID- Fetch the creative information from CM360
    creatives().get(profileId=profile_id, id=creative_id)
    Then using Creative create API creatives().insert() - In DCM create a new copy of the creative with a new name
    [service.creatives().insert(profileId=profile_id, body=creative_body)] with the following request body. .

For creative_type == 'html', the request body is as follows.
new_cr_body = {
'active': 'true',
'advertiserId': advertiser_id,
'creativeAssets': new_cr_assets,
'backupImageClickThroughUrl': {'landingPageId': default_landing_page['id']},
'backupImageReportingLabel': 'backup_image_exit',
'backupImageTargetWindow': {'targetWindowOption': 'NEW_WINDOW'},
'name': new_cr_name,
'size': new_cr_size,
'clickTags':new_cr_clicktags,
'type': 'DISPLAY'
}
For creative_type == 'image', the request body is as follows.

    new_cr_body = {
                    'active': 'true',
                    'advertiserId': advertiser_id,
                    'creativeAssets': new_cr_assets,
                    'name': new_cr_name,
                    'size': new_cr_size,
                    'type': 'DISPLAY'
                        }

we can copy HTML and image creatives using the above request body. These steps are working fine for both HTML and Image.

For Rich Media Display banner creatives we tried the following request body.
new_cr_body = {
'active': 'true',
'advertiserId': advertiser_id,
'creativeAssets': new_cr_assets,
'backupImageClickThroughUrl': {'landingPageId': default_landing_page['id']},
'backupImageReportingLabel': 'backup_image_exit',
'backupImageTargetWindow': {'targetWindowOption': 'NEW_WINDOW'},
'name': new_cr_name,
'size': new_cr_size,
'exitCustomEvents':new_cr_cust_events,
'type': 'RICH_MEDIA_DISPLAY_BANNER'
}

When we use the same for RichMedia, we are getting the below error message( Creative asset file not found error)

{'status': 'failed', 'message': '<HttpError 400 when requesting
https://dfareporting.googleapis.com/dfareporting/v4/userprofiles//creatives?alt=json
returned "8020 : Creative asset file 14181315/ads/richmedia/studio/pv2/62429140/20230912085042931/XOLAIR_CSU_HERITAGE_PATIENT_HTML5_BANNER_DESKTOP_M-US-00015458v2_300x250.html not found.". Details: "[{'message': '8020 : Creative asset file 14181315/ads/richmedia/studio/pv2/62429140/20230912085042931/XOLAIR_CSU_HERITAGE_PATIENT_HTML5_BANNER_DESKTOP_M-US-00015458v2_300x250.html not found.', 'domain': 'global', 'reason': 'invalid'}]">'}

Please Help us resolve this issue if any parameter is missing or pls suggest any alternate way to make a copy of Rich Media Creative,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant