Group: http://groups.google.com/group/adsense-api/topics
- Python error on generate call [1 Update]
- Samuel Stoddard <sam@rinkworks.com> Nov 17 01:35PM -0800
Hi! I'm trying to use the AdSense Management API with Python 2.6.5 to
retrieve earnings data. I make it past the oauth step fine, and I can get
a report consisting of a single column just fine:
result = service.reports().generate(
> dimension = "DATE",
> sort = "+DATE"
> ).execute()
This returns data that looks correct. However, if I try to pass in lists
for any parameter, I get the Python error "TypeError: expected string or
buffer". For example, this code returns that Python error:
result = service.reports().generate(
> dimension = "DATE",
> sort = "+DATE"
> ).execute()
Passing in lists is what the bottom of
http://code.google.com/apis/adsense/management/v1/complete_guide.html says
to do, and it was only by fiddling around and trying things at random that
I discovered it worked if you just pass in strings instead of lists. But I
can't get multiple columns this way. I did try setting metric to
"PAGE_VIEWS,EARNINGS" to see if a comma-delimited string would work, but
then the response from the call to www.googleapis.com comes back with
"Invalid value 'PAGE_VIEWS,EARNINGS'. Values must match the following
regular expression: '[a-zA-Z_]+'"
Any ideas? Thanks.
You received this message because you are subscribed to the Google Group adsense-api.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.
You received this message because you are subscribed to the Google Groups "AdSense API Forum" group.
To post to this group, send email to adsense-api@googlegroups.com.
To unsubscribe from this group, send email to adsense-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en.
No comments:
Post a Comment