Google Search Appliance: Administrative API Developer’s Guide: Protocol 7
The search appliance returns a response containing your authentication token in response to a
POST
request. The authentication token is the
Auth
value on that page, and you need to extract the token
from the page. When you submit an API request, you must set the
Content-Type
and authorization
headers as follows:
Content-type: application/atom+xml
Authorization: GoogleLogin auth=your-authentication-token
Note: Authentication tokens expire after 24 hours or 30 minutes when not in use. Submit a request to
the URL at least once again. We recommend that you keep the token in memory rather than writing the
token to a file.
How the API Works
To execute an operation using the API, submit an HTTP
POST
,
GET
,
PUT
, or
DELETE
request to the URL that
corresponds to the operation that you wish to perform. Each URL includes variables that identify the
resource that you are creating, retrieving, updating or deleting. The URL pattern is as follows:
http://Search_Appliance:8000/feeds/Collection_Name/Entry
The
Collection_Name
and
Entry
values indicate a search appliance configuration. Note that all create
and update requests (
POST
and
PUT
requests) also require that you submit an XML document that
contains the information you need to fulfill the request. Send the content using the
application/
atom+xml
content type. The section “XML Request Formats” on page 10 explains the XML structures.
XML Element Definitions
The following XML elements can be used in a reporting API request. The elements are listed in the order
that they appear in an API request.
Note: In API requests, the ampersand (
&
) character must be XML-escaped as
&
when used in
<gsa:content ...> values. For example:
<gsa:content name='followURLs'>^http://my.domain.com/index.php?a=2&b=1</
gsa:content>
atom:feed
Definition
The
<atom:feed>
element encapsulates an API response to a request to retrieve all the information in
one configuration collect.
Example
<atom:feed xmlns="http://www.w3.org/2005/Atom"
xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
Child Elements
atom:id, atom:link, atom:entry
Komentáře k této Příručce