Returns all related data records stored under the specified key in a related data set.
Optional filter, sort_field and sort_order query parameter values must be URL-encoded by REST clients.
Recommended curl pattern:
curl -G "https://host/core/sysname/api/rest/v20/relatedData/getRecordsByKey" --data-urlencode "datasetName=products" --data-urlencode "key=test-user@example.com" --data-urlencode "filter=NEGOZIO=Rome AND RECEIPTPOINTS>=60" --data-urlencode "sort_field=RECEIPTPOINTS" --data-urlencode "sort_order=desc"
Encoded URL example:
/core/sysname/api/rest/v20/relatedData/getRecordsByKey?datasetName=products&key=test-user%40example.com&filter=NEGOZIO%3DRome%20AND%20RECEIPTPOINTS%3E%3D60&sort_field=RECEIPTPOINTS&sort_order=desc
Response body example - 1 record:
[
{
"datasetName": "products",
"key": "test-user@example.com",
"data": [
{ "name": "hairColor", "value": "green" },
{ "name": "eyeColor", "value": "blue" }
]
}
]
Response body example - empty result:
[]
Name of the related data set
Key defining which record(s) to select from the data set
Optional query-string filter expression applied after selecting records by key; it is different from the name/value request-body filter used by Related Data create, update and delete operations. Syntax: field operator value, with conditions combined using AND and OR; AND has higher precedence than OR. Field names are case-insensitive. Supported operators: = for exact equality; >, >=, < and <= for Number and Date fields; and contains for case-insensitive substring matching on String fields. Date literals use ISO-8601 date or UTC timestamp format, for example 2026-01-10 or 2026-01-10T08:00:00Z. Quote values containing spaces or operator characters, for example store="New York". REST clients must URL-encode this value.
Optional active related data field used to sort matching records after filtering. Field names are case-insensitive. Only one sort field is supported. REST clients must URL-encode this value.
Optional sort direction for sort_field: asc, ascending, desc or descending. Defaults to ascending when sort_field is supplied. It is ignored when sort_field is omitted. REST clients must URL-encode this value.
successful operation
Invalid filter or sorting input. The response contains a client INVALID_PARAMETER error with parameterName, value and message details.