I am using dot net lib 4.1.0 and v200906 of API. I've just started
using this so getting used to it all. I've setup a test in order to
retrieve keywords using the AdGroupCriterionService. However, i do not
get any data back in the response object (totalentries=0 and
entries=nothing). My vb.net code is:
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim google As New GoogleData()
'create request header
Dim header As Dictionary(Of String, String)
'get Header
header = google.GetReportServiceHeaderLive() 'see method
extract at end of this method
Dim user As New AdWordsUser(header)
'get service
Dim critSvc As AdGroupCriterionService = DirectCast
(user.GetService(ApiServices.v200906.AdGroupCriterionService),
AdGroupCriterionService)
Dim critSelector As New AdGroupCriterionSelector()
Dim filters As New List(Of AdGroupCriterionIdFilter)
'set filters - ad group id
Dim AdGrpIdFilter As New AdGroupCriterionIdFilter()
AdGrpIdFilter.adGroupId = CLng(DropDownList2.SelectedValue)
'Ad group id from drop down list of adgroups set here
AdGrpIdFilter.adGroupIdSpecified = True
filters.Add(AdGrpIdFilter)
'set get AdGroupCriterionSelector params
critSelector.criterionUseSpecified = True
critSelector.criterionUse = CriterionUse.BIDDABLE
critSelector.userStatuses = New UserStatus()
{UserStatus.ACTIVE, UserStatus.PAUSED, UserStatus.DELETED}
critSelector.idFilters = filters.ToArray()
'get data
Dim cResult As AdGroupCriterionPage = critSvc.get
(critSelector) 'TODO: not returing any data!
'bind to gridview
GridView1.DataSource = cResult.entries
GridView1.DataBind()
End Sub
-==-==-==-==--
Extract of method from GoogleData.vb class to get header used in above
method:
Public Function GetReportServiceHeaderLive() As Dictionary(Of String,
String)
Dim header As New Dictionary(Of String, String)
'clientemail or clientid not specified and ussing mcc
account login
header("email") = ConfigurationManager.AppSettings
("GoolgeAdwordsAPI_email")
header("password") = ConfigurationManager.AppSettings
("GoolgeAdwordsAPI_password")
header("useragent") = "AWAPI DotNetLib " +
DataUtilities.GetVersion() + " - " + _
ConfigurationManager.AppSettings("GoolgeAdwordsAPI_userAgent")
header("developerToken") = ConfigurationManager.AppSettings
("GoolgeAdwordsAPI_DeveloperToken")
header("applicationToken") =
ConfigurationManager.AppSettings("GoolgeAdwordsAPI_ApplicationToken")
Return header
End Function
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---