Parties Collection Resource
Search for parties.
Party is the superclass of Organization and Person and this collection resource provides generic search across all directory entities.
Query Form
https://my.usgs.gov/directory/parties/queryForm
Query Parameters
name | values | description |
---|---|---|
mode | quick, agent | Search using the 'quick' or 'agent' search modes instead of the default mode. quick mode is designed to support autocomplete inputs in ScienceBase. The normal full text search parameter, q, is used to search the beginnings of words in a few key party properties in additional to usual whole words elsewhere. agent mode is designed to support the directory matching features in catalog |
q | (text) | full text search |
active | true, false (boolean) | limit results to only parties with the active flag set to true or false |
email address | search by email address | |
max | (integer) | maximimun number of records to return |
offset | (integer) | skip the first N records, use this in combination with max page through results |
format | json, html, .... | specify the output format to be JSON or HTML. This can also be accomplished with an 'Accepts' header. |
sort | name, displayName, ... | the name of the field to sort by. When not specified, the results are sort by search score. Sorting by fields other than search score can negatively impact performance. |
order | asc, desc | sort in ascending or descending order |
Query Examples
- Find parties with the keywords 'Water' and 'Science'
https://www.sciencebase.gov/directory/parties?q=Water+Science - Find parties with the keyword 'Bristol' where party.active is true
https://www.sciencebase.gov/directory/parties?q=Bristol&active=true - Find parties with the keyword 'biology' and return a page of 20 results, starting on the second page (that is, skip the first 20), and using the format query paramater to reuqest JSON
https://www.sciencebase.gov/directory/parties?q=biology&max=20&offset=20&format=json - Find parties with the keywords 'marine' and 'biology' and order by the results by name in reverse order
https://www.sciencebase.gov/directory/parties?q=marine+biology&sort=name&order=desc - Use quick search to find parties with words the begin with 'brist'
https://www.sciencebase.gov/directory/parties?mode=quick&q=brist
GET: Search for Parties
https://www.sciencebase.gov/directory/parties?q=<keywords>
Request
GET directory/parties?q=bio HTTP/1.1 HOST: www.sciencebase.gov Accept: application/json
Alternative GET request using query param instead Accept header
Response
{ "total":184, "selflink":{ "rel":"self", "url":"https://www.sciencebase.gov/directory/parties?q=bio&format=JSON&max=10" }, "nextlink":{ "rel":"next", "url":"https://www.sciencebase.gov/directory/parties?q=bio&format=JSON&max=10&offset=10" }, "parties":[ { "type":"person", "id":50135, "name":"Bio, Kealii", "displayName":"Kealii Bio", "displayText":"Kealii Bio", "email":"kealii_bio@usgs.gov", "url":null, "description":"Record created from BASIS+ data.", "richDescriptionHtml":null, "note":"phone=|fax=mail=", "aliases":[ ], "active":false, "firstName":"Kealii", "lastName":"Bio", "organization":{ "id":18139, "displayText":"U.S. Geological Survey" }, "permissions":{ "read":{ "acl":[ "ROLE:ScienceBase_DataAdmin", "ROLE:PlotDataAdmin" ] }, "write":{ "acl":[ "ROLE:ScienceBase_DataAdmin", "ROLE:PlotDataAdmin" ] } } }, { "type":"organization", "id":59605, "name":"Biological Carbon Sequestration", "displayName":null, "displayText":"Biological Carbon Sequestration", "email":null, "url":null, "description":null, "richDescriptionHtml":null, "note":null, "aliases":[ "Carbon Sequest - Bio" ], "active":true, "fbmsCodes":[ { "id":383, "code":"GGHCGR0700", "annotation":"Old FBMS Code" } ], "permissions":{ "read":{ "acl":[ "ROLE:ScienceBase_DataAdmin", "ROLE:PlotDataAdmin" ] }, "write":{ "acl":[ "ROLE:ScienceBase_DataAdmin", "ROLE:PlotDataAdmin" ] } } }, ... ] }