We have a Google CSE (Custom Search Engine) and have built a script to manage its Promotions via API via our own web interface. That script has been working for over three years, but now it fails. It worked Feb. 6 of this year, the last time we used it before today.
The documentation for the API is here (and seems to be unchanged from when we developed the script long ago): https://developers.google.com/custom-search/docs/api#create_promos
We can connect and authorize, but when we try to send the XML needed to add, update, or delete a Promotion nothing happens. We get back a list of 20 Promotions, but the desired action did not happen. There are no error messages of any sort.
We have tried this from two servers here. One shows a 200 code and the other shows a 302. The former uses ColdFusion 9, and the latter ColdFusion 10; both use cfhttp to send the XML. Perhaps the response code is related to some difference there. This does not explain why the script running on the server we've been using for years now fails.
Does the Google CSE API still work as it did in the past? Any advice on fixing our script? Is there some other way to work with CSE Promotions via API now?
Code that uses the API:
<cfhttp url="#cseURL#" method="post" result="postResult">
<cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#Auth#">
<cfhttpparam type="XML" value="#xml.trim()#">
</cfhttp>
A sample of the XML we're sending:
<Batch><Remove><Promotions><Promotion id="06DD467E-B663-437D-F94B4EB6DA0B13AF" /></Promotions></Remove></Batch>
The #Auth# variable contains authorization code generated per the API docs and appears to be valid; there are no error messages when generating it via an earlier API call.
The #cseURL# variable contains a proper URL in the documented format: https://www.google.com/cse/api/#USER_ID#/promotions/#CSE_ID#
Thanks in advance for pointers or advice on this.
-Ken