Skip to content

Latest commit

 

History

History
73 lines (63 loc) · 2.07 KB

File metadata and controls

73 lines (63 loc) · 2.07 KB

Search API

Search Profiles and Groups

Search for EDI profiles and groups based on a provided search string.

  • The search is case-insensitive and supports partial matches
  • The search string must be at least 3 characters long
  • Matches always start at the beginning of each field
  • Only a limited number of results are returned. If the expected match is not found, try refining the search string.
  • For profiles, the search string is matched against:
    • The full common name (CN)
    • The second part of the common name (family name in Western cultures)
    • Email address
    • Profile EDI-ID ('EDI-' prefix is optional)
  • For groups, the search string is matched against:
    • Group name
    • Group description
    • Group EDI-ID ('EDI-' prefix is optional)
GET: /auth/v1/profile?s=<search_string>&profiles=<true|false>&groups=<true|false>

searchPrincipals(
  edi_token 
  s (search string, min length: 3)
  profiles (optional, default: true)
  groups (optional, default: true)
)

Returns:
  200 OK
  401 Unauthorized
  403 Forbidden
  404 Not Found

Permissions:
  Caller must be authenticated

Example JSON 200 OK response:

{
  "method": "searchPrincipals",
  "msg": "Profiles and/or groups searched successfully",
  "profiles": [
    {
      "edi_id": "EDI-147dd745c653451d9ef588aeb1d6a188",
      "common_name": "John Smith",
      "email": "john@smith.com",
      "avatar_url": "https://auth.edirepository.org/auth/ui/api/avatar/gen/JS"
    }
  ],
  "groups": [
    {
      "edi_id": "EDI-abcdef1234567890abcdef1234567890",
      "name": "Researchers",
      "description": "Group for all researchers"
    }
  ]
}