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

Adds support for Audience Intelligence #160

Merged
merged 7 commits into from Mar 16, 2018
Merged

Adds support for Audience Intelligence #160

merged 7 commits into from Mar 16, 2018

Conversation

tushdante
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@juanshishido juanshishido left a 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.


PROPERTIES = {}

RESOURCE_BASE = '/3/accounts/{account_id}/audience_intelligence/'
Copy link
Collaborator

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

Copy link
Collaborator Author

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))
Copy link
Collaborator

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.

Copy link
Collaborator Author

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'}]>

@juanshishido juanshishido merged commit ea4d33c into master Mar 16, 2018
@juanshishido juanshishido deleted the tushar/ai branch March 16, 2018 17:00
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

Successfully merging this pull request may close these issues.

None yet

2 participants