Skip to main content

site/opensearch/description (GET) (TCS)

Overview

Get the OpenSearch Description document

  • REST Method: GET
  • Method Access: public

Query Parameters

Name Type Description
authenticate bool? Force authentication for request (default: false)

Message Format

Output:

<OpenSearchDescription>
  <ShortName>{text}</ShortName> 
  <Description>{text}</Description> 
  <Query role="{text}" searchTerms="{text}" /> 
  <Url type="{contenttype}" indexOffset="{int}" template="{uri}" /> 
  ...
</OpenSearchDescription>

Implementation Notes

Refer here for more information about OpenSearch.

C# Code Sample: Retrieve OpenSearch Description Document

The following code example retrieves the OpenSearch Description document:

Sample Code

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("site", "opensearch", "description").Get();

Sample Response from executing Code

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Deki Wiki Search</ShortName> 
  <Description>Deki Wiki Search Engine</Description> 
  <Query role="example" searchTerms="Wiki" /> 
  <Url type="application/atom+xml" indexOffset="0" template="http://deki-hayes/@api/deki/site/opensearch?q={searchTerms}&offset={startIndex}&limit={count?}&format=atom" /> 
  <Url type="application/rss+xml" indexOffset="0" template="http://deki-hayes/@api/deki/site/opensearch?q={searchTerms}&offset={startIndex}&limit={count?}&format=rss" /> 
  <Url type="text/html" indexOffset="0" template="http://deki-hayes/Special:Search?search={searchTerms}&offset={startIndex}&limit={count?}&format=html" /> 
  <Url type="application/x-suggestions+json" template="http://deki-hayes/@api/deki/site/opensearch/suggestions?q={searchTerms}" /> 
</OpenSearchDescription>

Curl Code Sample: Retrieve OpenSearch Description Document

The following command retrieves the OpenSearch Description:

Sample Code

curl -u username:password -i http://mindtouch.address/@api/deki/site/opensearch/description

Sample Response from executing Code

Content-Type: application/xml

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Best Wiki Ever Search</ShortName>
  <Description>MindTouch Search Engine</Description>
  <Query role="example" searchTerms="Wiki"/>
  <Url type="text/html" indexOffset="0" template="http://192.168.59.128/Special:Search?search={searchTerms}&offset=0&limit={count?}&format=html"/>
  <Url type="application/atom+xml" indexOffset="0" template="http://192.168.59.128/@api/deki/site/opensearch?q={searchTerms}&offset={startIndex}&limit={count?}&format=atom"/>
  <Url type="application/rss+xml" indexOffset="0" template="http://192.168.59.128/@api/deki/site/opensearch?q={searchTerms}&offset={startIndex}&limit={count?}&format=rss"/>
  <Url type="application/x-suggestions+json" template="http://192.168.59.128/@api/deki/site/opensearch/suggestions?q={searchTerms}"/>
</OpenSearchDescription>

Implementation notes 

curl flags

-u
Provides external user authentication.
-i
Outputs the HTTP response headers. Useful for debugging.
  • Was this article helpful?