You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! The Snapchat Ads Manager I'm trying to pull data from has two organizations, where each organization has one and two ad accounts respectively. When I use pyairbyte, it seems like source.read() only pulls data from one ad account each. I can see both organizations, but only one ad account per organization. This propagates downwards with campaigns, daily ad stats etc, I only get data from one ad account per organization.
Is there anything I can do on my side to get all ad accounts? Maybe change the state of ManifestDeclarativeSource?
I've changed my setup to the standard requests Python library, and that works like a charm. The code snippet under works fine and returns all ad accounts when I loop through the two organization IDs.
AD_ACCOUNTS_API_URL_W_ORGANIZATION = f"https://adsapi.snapchat.com/v1/organizations/{organization_id}/adaccounts"
def fetch_ad_accounts(access_token):
headers = {
"Authorization": f"Bearer {access_token}",
}
response = requests.get(AD_ACCOUNTS_API_URL_W_ORGANIZATION, headers=headers)
if response.status_code == 200:
ad_accounts = response.json().get('adaccounts', [])
for account in ad_accounts:
print(f"ID: {account.get('adaccount')['id']}, Name: {account.get('adaccount')['name']}, Status: {account.get('adaccount')['status']}")
else:
print("Failed to fetch ad accounts:", response.status_code, response.text)
return ad_accounts
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! The Snapchat Ads Manager I'm trying to pull data from has two organizations, where each organization has one and two ad accounts respectively. When I use pyairbyte, it seems like source.read() only pulls data from one ad account each. I can see both organizations, but only one ad account per organization. This propagates downwards with campaigns, daily ad stats etc, I only get data from one ad account per organization.
Is there anything I can do on my side to get all ad accounts? Maybe change the state of ManifestDeclarativeSource?
I've changed my setup to the standard requests Python library, and that works like a charm. The code snippet under works fine and returns all ad accounts when I loop through the two organization IDs.
Beta Was this translation helpful? Give feedback.
All reactions