Google Commerce Search Deployment Guide User Manual
Page 15
the control panel. To see examples of the XML:
1. Create some rules manually.
2. Download the resulting XML.
3. Open the XML into your favorite editor, or have a script generate more XML in the same
format.
Admin API
The GCS control panel shares the same API as CSE (Custom Search Engine), and most of the
functionality within the control panel can be accessed programmatically using this API. The CSE
API is documented at
.
Some things to note:
●
All administrators/collaborators to the search engine have the ability to use the API.
●
Not all of the CSE elements translate:
○
Example for autocompletion: the authtoken needs to have service=cprose
○
ClientLogin.java
~/Desktop/auto$ more data.txt
~/Desktop/auto$ curl -v -trace -H "Authorization: GoogleLogin auth=DQAAAKoABCAJvYrL4l-
uDVX0O8cTgisW4fuPHN0wzjFLb9Gn_JHsSuMGwFkcCZRS9dpilysAEnDrmfoiajxKHGN0fvLOKXnwePSfXTqejp3I-
S0CG6tWDGkLVw-
NGoioe1nkT4uTdgTwmJgXekI6yO7wBHuQQmwLMBB0RpV0d7eXNZMKuc3LTakEMmat193xOieboyhcInGD8y7IxGeP
TW_ArE3H5ojuS6nV6LUp8x98LJfenrFCoQ" -X POST -d @data.txt -H "Content-type: text/xml" "http://www.google.com/
cse/api/014034025922634248784/autocomplete/udhuvsynrfw?num=20&start=0&actype=1&acmatch=1"
* About to connect() to www.google.com port 80 (#0)
* Trying 2001:4860:b006::6a... connected
* Connected to www.google.com (2001:4860:b006::6a) port 80 (#0)
> POST /cse/api/014034025922634248784/autocomplete/udhuvsynrfw?num=20&start=0&actype=1&acmatch=1 HTTP/
1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: www.google.com
> Accept: */*
> Authorization: GoogleLogin auth=DQABCKoAAAAJvYrL4l-
uDVX0O8cTgisW4fuPHN0wzjFLb9Gn_JHsSuMGwFkcCZRS9dpilysAEnDrmfoiajxKHGN0fvLOKXnwePSfXTqejp3I-
S0CG6tWDGkLVw-
NGoioe1nkT4uTdgTwmJgXekI6yO7wBHuQQmwLMBB0RpV0d7eXNZMKuc3LTakEMmat193xOieboyhcInGD8y7IxGePT
W_ArE3H5ojuS6nV6LUp8x98LJfenrFCoQ
> Content-type: text/xml
> Content-Length: 139
>
< HTTP/1.1 200 OK
< Date: Tue, 10 May 2011 00:40:36 GMT
< Expires: Fri, 04 Aug 1978 12:00:00 GMT
< Cache-Control: private, no-cache, no-cache="Set-Cookie", proxy-revalidate
< Content-Type: text/xml; charset=UTF-8
< Pragma: no-cache
15