REST API Syntax

mhogeweg edited this page Oct 24, 2014 · 9 revisions

The Geoportal Server REST interface allows for search of the Geoportal's catalog. Through the REST API, it is possible to query the locally-hosted resources, and also resources hosted on remote repositories. These two scenarios are shown below. In these scenarios, requestParameter is a placeholder for a REST parameter. REST parameters are discussed later in this topic.

  • To query the local geoportal catalog only, use the following url pattern: //machineName/geoportal/rest/find/document?requestParameter
  • To query remote repositories, use the following url pattern: //machineName/geoportal/rest/distributed?rid=repositoryID&requestParameters. Here, the rid parameter is the identification for the repository being searched.

By using multiple rid parameters, you can search multiple repositories at the same time (federated search). Use the following url pattern: //machineName/geoportal/rest/distributed?rid=repositoryID1&rid=repositoryID2&requestParameter.

If you provide multiple remote repository identifiers, Geoportal Server will respond with information on the number of results from each repository. Then selecting one of the listed repositories will drill down into the results of that repository for the federated query.

Here is an example: Return items from gptogc.esri.com and ArcGIS Online containing 'water'

 http://gptogc.esri.com/geoportal/rest/distributed?rid=local&rid=ArcGIS.COM&start=1&max=10&orderBy=relevance&searchText=water&f=atom

The table below lists the parameters that are available in the Geoportal Server REST API. For a full description of each parameter, refer to the com.esri.gpt.control.georss and com.esri.gpt.control.rest.search packages in the Geoportal Server Javadoc. For requests that have more than one parameter, the parameters must be concatenated using the ampersand (&) symbol. Use the following URL pattern: //machineName/geoportal/rest/find/document?requestParameter1&requestParameter2&...

requestParameter Function Accepted Values
bbox Query by extent specified as two pairs of coordinates (west-south and east-north). Comma-delimited string of integers between -180,180 and -90, 90.
spatialRel Query by spatial relationship. Used in conjunction with bbox parameter. String value. One of esriSpatialRelWithin (default), esriSpatialRelOverlaps.
searchText Query by keyword. String value representing a keyword. Note, as of version 1.1.1, you can use searchText=sys.schema.key to query for documents that correspond to a specific metadata schema. See How to find all documents of a particular metadata standard for more details.
contains Keyword concatenation options. This parameter is obsolete with the Lucene syntax (see Using Lucene Search Text Queries). For an exact match use double quotes. For example, see the syntax for two terms, Hawaii and quads:
  • Exact: "Hawaii quads"
  • Any: Hawaii quads
  • All: +Hawaii+quads
//serverName/geoportal/rest/find/document?searchText="Hawaii quads"&f=georss
contentType Query by content type. String value representing an Esri content type. See Javadoc for complete list.
dataCategory Query by data category (ISO 19115 themes). Comma-delimited list of strings. Keywords identified by the ISO 19115 specification. See JavaDoc for complete list.
after, before Query by date. Date string in the format yyyy-mm-dd.
orderBy Result sort options. String value. One of areaAscending, areaDescending, dateAscending, dateDescending (default), format, relevance, title.
start Specify which item to start the response with out of the entire resultset. Integer. When used with the max parameter, this provides for pagination of the search results.
max Specify max number of records to retrieve. Integer. There is a limit of max=100 on unqualified queries. An 'unqualified query' is when there are no search parameters set. The limit on qualified queries is max=5000. Default: 10. When used with the start parameter, this provides for pagination of the search results.
geometryType Defines how spatial data will be represented. String value. One of esriGeometryPoint, esriGeometryPolygon (default), esriGeometryBox.
f the response format. String value. One of georss (default), atom, json, pjson, xjson, dcat (1.2.4), kml, html, htmlfragment, searchpage (as of 1.1.1), CSV (as of 1.2), xjson output compliants with geojson 1.0 and contains more detailed information(1.2.4).
style CSS stylesheet for HTML results. String value representing a URL to a stylesheet.
target Behavior of links (open in same or new window). String value. One of blank (default), parent, self, top.
rid Id associated with the repository. Multiple rid parameters are allowed for comparing results between different repositories. String value.
rids Comma Delimited rid. Can be used instead of the multiple rid parameters. String values.
maxSearchTimeMilliSec Maximum amount of time allowed to retrieve results. Integer. Default is 5000 milliseconds.
filter Can apply a persistent filter to the search interface. See URL Filter Customization lucene-based query syntax
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.