0

I am using google's "CustomSearch API Client Library for .NET" and trying to retrieve the promotions which I have created through the Control panel with the Add Promotion functionality. I have a paid version of Google Site Search.

When I test it with the "Google Search"INSIDE the control panel it shows the promotion, but when I try to search through the .Net API, it returns Null in promotions.

I dont even get the promotions shown when I search with the API explorer. The promotion is active.

Does it require some additional coding to get the promotions through the API?

Thank you..

A.D.
  • 13
  • 3

1 Answers1

1

I found the answer.

The reason for why I wasn't getting any Promotion Results was because I had set the SiteSearch property to the domain. When I removed the value from that property then it all worked :)

var listRequest = svc.Cse.List(query);
            listRequest.Hl = language;
            listRequest.Cx = this.cx;
            listRequest.Start = startIndex;
            listRequest.SiteSearch = "www.domain.name"; <-- this has to be removed
A.D.
  • 13
  • 3