Get Lookup Records

Retrieves record list belonging to the specified lookup.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

GET /api/sonar/lookups/:guid/records
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     "https://HOSTNAME/api/sonar/lookups/76b8699d-91a1-4576-a908-7db753570a0a/records?offset=0&limit=20"
Request Parameters
Path Parameters
KeyTypeDescriptionNotes
guidStringLookup GUID36 characters
Query Parameters
KeyRequiredTypeDescriptionNote
offsetNo32-bit integerNumber to skip0 or greater. Default: 0
limitNo32-bit integerMaximum count0 or greater. Default: 20
keywordsNoStringSearch keywordsSearches record keys and values

Success Response

HTTP status code 200 response

{
  "total_count": 236,
  "fields": ["country", "name"],
  "records": [
    ["AE", "United Arab Emirates"],
    ["AF", "Afghanistan"],
    ["AG", "Antigua and Barbuda"],
    ["AI", "Angola"],
    ["AL", "Albania"],
    ["AM", "Armenia"],
    ["AN", "Antilles"],
    ["AO", "Angola"],
    ["AQ", "Antarctica"],
    ["AR", "Argentina"],
    ["AS", "American Samoa"],
    ["AT", "Austria"],
    ["AU", "Australia"],
    ["AW", "Aruba"],
    ["AZ", "Azerbaijan"],
    ["BA", "Bosnia and Herzegovina"],
    ["BB", "Barbados"],
    ["BD", "Bangladesh"],
    ["BE", "Belgium"],
    ["BF", "Burkina Faso"]
  ]
}
FieldTypeDescription
total_count32-bit integerTotal number of lookup records matching criteria
fieldsArrayField name list
recordsArrayRecord list

Error Responses

offset, limit: non-integer values

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'offset' parameter should be int type"
}
offset, limit: negative values

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'offset' must be greater than or equal to 0."
}
Lookup is not found

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "lookup not found: 76b8699d-91a1-4576-a908-7db753570a0a"
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}