|
| 1 | +Themes |
| 2 | +====== |
| 3 | + |
| 4 | +.. autoclass:: ad_api.api.sb.Themes |
| 5 | + |
| 6 | + .. autofunction:: ad_api.api.sb.Themes.list_themes |
| 7 | + |
| 8 | + ### Example Python |
| 9 | + |
| 10 | + .. code-block:: python |
| 11 | +
|
| 12 | + from ad_api.api.sb.themes import Themes |
| 13 | +
|
| 14 | + result = Themes().list_themes() |
| 15 | + print(result) |
| 16 | +
|
| 17 | + .. autofunction:: ad_api.api.sb.Themes.create_themes |
| 18 | + |
| 19 | + ### Example Python |
| 20 | + |
| 21 | + .. code-block:: python |
| 22 | +
|
| 23 | + from ad_api.api.sb.themes import Themes |
| 24 | + import json |
| 25 | +
|
| 26 | + # Example data for themes |
| 27 | + themes_to_create = [ |
| 28 | + { |
| 29 | + "adGroupId": "YOUR_ADGROUP_ID", |
| 30 | + "campaignId": "YOUR_CAMPAIGN_ID", |
| 31 | + "themeType": "KEYWORDS_RELATED_TO_YOUR_BRAND", |
| 32 | + "bid": 0.75 |
| 33 | + } |
| 34 | + # Add more theme objects as needed, up to 100 |
| 35 | + ] |
| 36 | +
|
| 37 | + # For a real scenario, you might read this from a file like in your Keywords example |
| 38 | + # file = open("create_themes.json") |
| 39 | + # data = file.read() |
| 40 | + # file.close() |
| 41 | + # result = Themes().create_themes(body=data) |
| 42 | +
|
| 43 | + result = Themes().create_themes(themes=themes_to_create) |
| 44 | + print(result) |
| 45 | +
|
| 46 | + ### Example JSON (for request body) |
| 47 | + |
| 48 | + .. code-block:: json |
| 49 | +
|
| 50 | + { |
| 51 | + "themes": [ |
| 52 | + { |
| 53 | + "adGroupId": "string", |
| 54 | + "campaignId": "string", |
| 55 | + "themeType": "KEYWORDS_RELATED_TO_YOUR_BRAND|KEYWORDS_RELATED_TO_YOUR_LANDING_PAGES", |
| 56 | + "bid": 0.75 |
| 57 | + } |
| 58 | + ] |
| 59 | + } |
| 60 | +
|
| 61 | +
|
| 62 | + .. autofunction:: ad_api.api.sb.Themes.update_themes |
| 63 | + |
| 64 | + ### Example Python |
| 65 | + |
| 66 | + .. code-block:: python |
| 67 | +
|
| 68 | + from ad_api.api.sb.themes import Themes |
| 69 | + import json |
| 70 | +
|
| 71 | + # Example data for themes to update |
| 72 | + themes_to_update = [ |
| 73 | + { |
| 74 | + "themeId": "YOUR_THEME_ID", |
| 75 | + "adGroupId": "YOUR_ADGROUP_ID", |
| 76 | + "campaignId": "YOUR_CAMPAIGN_ID", |
| 77 | + "state": "paused", # or "enabled", "archived" |
| 78 | + "bid": 0.80 # Optional, if updating bid |
| 79 | + } |
| 80 | + # Add more theme objects as needed, up to 100 |
| 81 | + ] |
| 82 | +
|
| 83 | + # For a real scenario, you might read this from a file |
| 84 | + # file = open("update_themes.json") |
| 85 | + # data = file.read() |
| 86 | + # file.close() |
| 87 | + # result = Themes().update_themes(body=data) |
| 88 | +
|
| 89 | + result = Themes().update_themes(themes=themes_to_update) |
| 90 | + print(result) |
| 91 | +
|
| 92 | + ### Example JSON (for request body) |
| 93 | + |
| 94 | + .. code-block:: json |
| 95 | +
|
| 96 | + { |
| 97 | + "themes": [ |
| 98 | + { |
| 99 | + "themeId": "string", |
| 100 | + "adGroupId": "string", |
| 101 | + "campaignId": "string", |
| 102 | + "state": "enabled|paused|archived", |
| 103 | + "bid": 0.80 |
| 104 | + } |
| 105 | + ] |
| 106 | + } |
0 commit comments