GET search

Returns search results for a specified string.

Search results vary according to the user's status. If the user is not logged in, the search results include information about public APIs and public apps. However, if the user logs in, and is a member of one or more API Scope Groups or app teams, search results will include information about the apps and APIs that the user is authorized to access.

Authorization Roles/Permissions: Anyone can use this operation; login is not required. However, note that for any operations that do not require login, information about private resources is not returned unless the user is logged in and is authorized to view information about those resources. Without login, only public information is returned. However, search results vary according to the user's login status and access rights.

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

https://{hostname}/api/search?{q}={SearchExpression}&sort={sort}&sortBy={sortBy}&start={start}&count={count}

Back to top

Sample Request

The example below shows a search on the search term "payments" requesting the first two responses.

Sample request URL #1

https://{hostname}/api/search?count=20&start=0&q=type:API%20AND%20ACME%20-Payments

Sample request URL #2

The example below shows a search for oauth.

https://{hostname}/api/search?count=20&start=0&q=type:*%20AND%20oauth

Sample request URL #3

The example below shows a search for the list of all users.

https://{hostname}/api/search?sort=asc&sortBy=com.soa.sort.order.title_sort&Federation=false&count=20&start=0&q=type:us

Sample request headers

accept: application/json
X-Csrf-Token_{tenant}: {TokenID}

Sample request body

Not applicable.

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/xml, text/xml, or application/json

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
q Query string Required

The search term or phrase; for example, Payments. Use encoding for spaces between words; for example, ACME%20Payments for ACME Payments. You can use q=type: to specify a type of resource you want to search. For valid values, see Search "Type" Values.

For more information about search expressions, see Using Search on the Platform.

sort Query string Optional The sort order for the search results; for example, asc for ascending order. For valid values, see Sort Order Values.
sortBy Query string Optional An optional parameter allowing users to sort results by a specific value; for example, com.soa.sort.order.updated sorts with the most updated entries first. For valid values, see Sort By Values. If not specified, items are returned in the sort order of DescendingDate, which means that the most recent items are first.
start Query integer Optional The starting position for the search results page. If not specified, defaults to 0.
count Query integer Optional The number of search results to be displayed on the search results page. If not specified, defaults to 20.
FollowedOnly Query boolean Optional Limits the search to only resources followed by the current user. Default to false.

Back to top

Response

If successful, this operation returns HTTP status code 200, with the requested search results. The response is formatted as an RSS feed.

Back to top

Sample Response

The sample response below shows the results for the sample request shown above. The results are returned in JSON as specified in the request header, and are limited to the first two matches.

Sample response headers #1

Status Code: 200 OK
Content-Type: application/json
Date: Tue, 04 Aug 2015 12:55:26 GMT

Sample response body #1: application/json

The sample response below shows results for the GET search method if the content type is JSON.

{
  "channel" : {
    "title" : "Search Results",
    "description" : "Search results for [type:* AND pet]",
    "pubDate" : "Tue Aug 04 17:55:26 UTC 2015",
    "startIndex" : 0,
    "totalResults" : 11,
    "itemsPerPage" : 11,
    "elapsedTime" : 575,
    "item" : [ {
      "title" : "1.0",
      "description" : "Sample version description for Pet Store API",
      "category" : [ {
        "value" : "apiversion",
        "domain" : "uddi:soa.com:resourcetype"
      }, {
        "value" : "com.soa.imageprovider.type.default",
        "domain" : "uddi:soa.com:avatar-provider"
      }, {
        "value" : "Public",
        "domain" : "uddi:soa.com:visibility"
      } ],
      "guid" : {
        "value" : "c0d59183-07f6-43b9-8cdc-d13c14caf650.acmepaymentscorp"
      },
      "Rating" : 0.0,
      "Image" : {
        "Url" : "http://{hostname}/api/apis/590c83cb-89d9-4e73-9dc5-1510b59e65dd.acmepaymentscorp/avatar"
      },
      "EntityReferences" : {
        "EntityReference" : [ {
          "Title" : "PetStore API",
          "Guid" : "590c83cb-89d9-4e73-9dc5-1510b59e65dd.acmepaymentscorp",
          "Category" : [ {
            "value" : "api",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      },
      "Connections" : 0
    }, {
      "title" : "Add Pet This",
      "description" : " (if not specified) and an href. Parameters Parameter:  body (Pet Object
) The API is secured using",
      "category" : [ {
        "value" : "doc",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "api/82532296-d4b7-4a37-9e0e-bf41ef2db0a1.demo/documents?addPet.htm"
      },
      "pubDate" : "Tue, 04 Aug 2015 16:47:40 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Guid" : "82532296-d4b7-4a37-9e0e-bf41ef2db0a1.demo",
          "Category" : [ {
            "value" : "api",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    }, {
      "title" : "Find Pet By",
      "description" : " docs page. The fundamental objects this API deals with are pets. The JSON
 representation for a pet",
      "category" : [ {
        "value" : "doc",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "api/82532296-d4b7-4a37-9e0e-bf41ef2db0a1.demo/documents?findPetById.htm"
      },
      "pubDate" : "Tue, 04 Aug 2015 16:47:40 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Guid" : "82532296-d4b7-4a37-9e0e-bf41ef2db0a1.demo",
          "Category" : [ {
            "value" : "api",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    }, {
      "title" : "PetStore API Overview",
      "description" : ". The fundamental objects this API deals with are pets. The JSON representation
 for a pet is easiest seen",
      "category" : [ {
        "value" : "doc",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "api/82532296-d4b7-4a37-9e0e-bf41ef2db0a1.demo/documents?overview.htm"
      },
      "pubDate" : "Tue, 04 Aug 2015 16:47:40 +0000",
      "EntityReferences" : {
        "EntityReference" : [ {
          "Guid" : "82532296-d4b7-4a37-9e0e-bf41ef2db0a1.demo",
          "Category" : [ {
            "value" : "api",
            "domain" : "uddi:soa.com:resourcetype"
          } ]
        } ]
      }
    }, {
      "title" : "PetStore API Overview",
      "description" : ". The fundamental objects this API deals with are pets. The JSON representation
 for a pet is easiest seen",
      "category" : [ {
        "value" : "doc",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "documentation?overview.htm"
      },
      "pubDate" : "Tue, 04 Aug 2015 16:47:40 +0000"
    }, {
      "title" : "PetStore API Overview",
      "description" : ". The fundamental objects this API deals with are pets. The JSON representation
 for a pet is easiest seen",
      "category" : [ {
        "value" : "doc",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "documentation?index.htm"
      },
      "pubDate" : "Tue, 04 Aug 2015 16:47:40 +0000"
    }, {
      "title" : "All the functionality",
      "description" : "All the functionality of the greatest ever Pet Store platform delivered
 through a RESTful JSON API",
      "category" : [ {
        "value" : "doc",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "home/landing?index.htm"
      },
      "pubDate" : "Tue, 04 Aug 2015 16:47:40 +0000"
    }, {
      "title" : "Listen Up",
      "description" : "Listen Up This is the greatest PetStore API you'll ever see. You can use
 this API to pound out your",
      "category" : [ {
        "value" : "doc",
        "domain" : "uddi:soa.com:resourcetype"
      } ],
      "guid" : {
        "value" : "welcome?index.htm"
      },
      "pubDate" : "Tue, 04 Aug 2015 16:47:40 +0000"
    } ]
  }
}

Sample response body #2: application/xml

The sample response below shows results for the GET search method, a different search than example #1, when the content type is application/XML.

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:ns2="http://soa.com/xsd/business/1.0" xmlns:ns3="http://soa.com/xsd/user/1.0" xmlns:ns4="http://soa.com/xsd/rss/1.0" 
xmlns:ns5="http://soa.com/xsd/comment/1.0" xmlns:ns6="http://a9.com/-/spec/opensearch/1.1/" 
xmlns:ns7="http://soa.com/xsd/resource/1.0" xmlns:ns8="http://soa.com/xsd/fault/1.0" 
xmlns:ns9="http://soa.com/xsd/api/1.0" xmlns:ns10="http://soa.com/xsd/board/1.0">
  <channel>
    <title>Search Results</title>
    <description>Search results for [(type:API AND ACME -Payments) AND visibility:(group19262.acmepaymentscorp OR api17115.acmepaymentscorp 
OR AMyrWWlF0Qj2ZPGqF8dPsa7O.acmepaymentscorp OR group19271.acmepaymentscorp OR group17116.acmepaymentscorp OR apiversion20693.acmepaymentscorp OR group19265.acmepaymentscorp 
OR group19793.acmepaymentscorp OR group17178.acmepaymentscorp OR api19427.acmepaymentscorp OR api16995.acmepaymentscorp OR group17119.acmepaymentscorp OR apiversion19266.acmepaymentscorp 
OR apiversion19263.acmepaymentscorp OR apiversion19184.acmepaymentscorp OR group17170.acmepaymentscorp OR api19270.acmepaymentscorp OR api19261.acmepaymentscorp OR group17277.acmepaymentscorp 
OR registeredusers.acmepaymentscorp OR apiversion17179.acmepaymentscorp OR apiversion18972.acmepaymentscorp OR apiversion17278.acmepaymentscorp OR app13935.acmepaymentscorp 
OR 90VsIX3WmpP32sqoYQk8jj4J.acmepaymentscorp OR user.acmepaymentscorp OR group18970.acmepaymentscorp OR group19428.acmepaymentscorp OR apiversion19272.acmepaymentscorp 
OR global.acmepaymentscorp OR apiversion19429.acmepaymentscorp OR group19212.acmepaymentscorp OR app17118.acmepaymentscorp OR api17276.acmepaymentscorp OR group16996.acmepaymentscorp 
OR group16965.acmepaymentscorp OR app16964.acmepaymentscorp OR apiversion16997.acmepaymentscorp OR api17169.acmepaymentscorp OR apiversion17117.acmepaymentscorp OR api17177.acmepaymentscorp 
OR group13936.acmepaymentscorp OR api19264.acmepaymentscorp OR api18969.acmepaymentscorp OR apiversion17171.acmepaymentscorp)]</description>
    <pubDate>Fri May 10 19:51:15 GMT 2013</pubDate>
    <ns11:elapsedTime xmlns:ns11="http://soa.com/search/1.0/">408</ns11:elapsedTime>
    <ns6:startIndex>0</ns6:startIndex>
    <ns6:totalResults>0</ns6:totalResults>
    <ns6:itemsPerPage>0</ns6:itemsPerPage>
  </channel>
</rss>

Sample response body: text/xml

The example below shows the same results as for the example above, if the content type is text/XML. In this example, there is no difference between application/xml and text/xml results.

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:ns2="http://soa.com/xsd/business/1.0" xmlns:ns3="http://soa.com/xsd/user/1.0" xmlns:ns4="http://soa.com/xsd/rss/1.0" 
xmlns:ns5="http://soa.com/xsd/comment/1.0" xmlns:ns6="http://a9.com/-/spec/opensearch/1.1/" 
xmlns:ns7="http://soa.com/xsd/resource/1.0" xmlns:ns8="http://soa.com/xsd/fault/1.0" 
xmlns:ns9="http://soa.com/xsd/api/1.0" xmlns:ns10="http://soa.com/xsd/board/1.0">
  <channel>
    <title>Search Results</title>
    <description>Search results for [(type:API AND ACME -Payments) AND visibility:(group19262.acmepaymentscorp OR api17115.acmepaymentscorp 
OR AMyrWWlF0Qj2ZPGqF8dPsa7O.acmepaymentscorp OR group19271.acmepaymentscorp OR group17116.acmepaymentscorp OR apiversion20693.acmepaymentscorp OR group19265.acmepaymentscorp 
OR group19793.acmepaymentscorp OR group17178.acmepaymentscorp OR api19427.acmepaymentscorp OR api16995.acmepaymentscorp OR group17119.acmepaymentscorp OR apiversion19266.acmepaymentscorp 
OR apiversion19263.acmepaymentscorp OR apiversion19184.acmepaymentscorp OR group17170.acmepaymentscorp OR api19270.acmepaymentscorp OR api19261.acmepaymentscorp OR group17277.acmepaymentscorp 
OR registeredusers.acmepaymentscorp OR apiversion17179.acmepaymentscorp OR apiversion18972.acmepaymentscorp OR apiversion17278.acmepaymentscorp OR app13935.acmepaymentscorp 
OR 90VsIX3WmpP32sqoYQk8jj4J.acmepaymentscorp OR user.acmepaymentscorp OR group18970.acmepaymentscorp OR group19428.acmepaymentscorp OR apiversion19272.acmepaymentscorp 
OR global.acmepaymentscorp OR apiversion19429.acmepaymentscorp OR group19212.acmepaymentscorp OR app17118.acmepaymentscorp OR api17276.acmepaymentscorp OR group16996.acmepaymentscorp 
OR group16965.acmepaymentscorp OR app16964.acmepaymentscorp OR apiversion16997.acmepaymentscorp OR api17169.acmepaymentscorp OR apiversion17117.acmepaymentscorp OR api17177.acmepaymentscorp 
OR group13936.acmepaymentscorp OR api19264.acmepaymentscorp OR api18969.acmepaymentscorp OR apiversion17171.acmepaymentscorp)]</description>
    <pubDate>Fri May 10 19:54:33 GMT 2013</pubDate>
    <ns11:elapsedTime xmlns:ns11="http://soa.com/search/1.0/">615</ns11:elapsedTime>
    <ns6:startIndex>0</ns6:startIndex>
    <ns6:totalResults>0</ns6:totalResults>
    <ns6:itemsPerPage>0</ns6:itemsPerPage>
  </channel>
</rss>

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/xml, text/xml, or application/json

Back to top

Response Body

Name Description
title The title of the RSS channel; in this case, Search Results.
description Description of the RSS channel, including the search criteria that were specified.
pubdate The date of the search.
startIndex The starting position for the search results page. This corresponds to the start value in the request parameters.
totalResults The total number of results matching the request, even if a subset of total results is returned.
itemsPerPage The number of search results to be displayed on the search results page. This corresponds to the count value in the request parameters.
Item

An array of individual search results. For each item:

  • Title
  • Description
  • Category[ ]—One or more categories for the search results.
  • GUID: the unique ID for the item.
  • Entity references—One or more. For each:Title, GUID, Category
  • Connections
  • Ratings

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics