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
Adds support for Audience Intelligence #160
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Two, small comments.
twitter_ads/audience.py
Outdated
|
||
PROPERTIES = {} | ||
|
||
RESOURCE_BASE = '/3/accounts/{account_id}/audience_intelligence/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using API_VERSION
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good callout!
"audience_definition": self.audience_definition, | ||
"targeting_inputs": self.targeting_inputs | ||
} | ||
return self.__get(account=self.account, client=self.account.client, params=json.dumps(body)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use json.dumps
here? If body
is a dict
, it's my understanding that it should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, i thought so too but it turns out these are all stored as "property" objects, so i had to convert them to JSON to avoid this:
twitter_ads.error.BadRequest: <BadRequest object at 0x10d69c050 code=400 details=[{u'message': u'The JSON string format is invalid', u'code': u'INVALID'}]>
No description provided.