Records by ID
The Records by ID API returns an array of records for the IDs provided. It is optimized for fast lookups by unique ID.
Use cases
You can use the Records by ID API to display the details of a record. For example, you can use the Records by ID API to display the details of a record in a data table or on a record detail page.
Record detail pages |
---|
Features
- Fast lookup by ID: Data Pools are optimized to provide fast record lookups by the unique ID. It is the fastest way to fetch a single record.
Usage
Arguments
The table below describes the input parameters for the Records by Unique ID API. These parameters allow you to specify a list of unique IDs for the records to be fetched.
Field | Type | Required | Description |
---|---|---|---|
dataPool | DataPoolInput | Yes | The Data Pool to be queried. A Data Pool ID or unique name can be provided. |
columns | array of String | Yes | The columns to retrieve. |
uniqueIds | array of String | Yes | The unique IDs of the records to retrieve. |
Read more about RecordsByUniqueIdInput.
Response
The Records by ID API responds with a RecordsByUniqueIdResponse
object that includes the records requested.
Field | Type | Nullable | Description |
---|---|---|---|
columns | array of String | No | The Data Pool columns for the record. |
values | array of String | No | An array of values for the record. |
query | QueryInfo | No | The Query statistics and metadata. |
Read more about RecordsByUniqueIdResponse.
Example
The following example demonstrates how to use the Records by ID API to fetch the record with ID “1234567890”.
- GraphQL Query
- JSON Response
query RecordsByUniqueId($input: RecordsByUniqueIdInput!) {
recordsByUniqueId(input: $input) {
columns
values
}
}
Variables:
{
"input": {
"dataPool": {
"name": "TacoSoft Demo Data"
},
"columns": ["taco_name", "salsa_name", "quantity"],
"uniqueIds": ["a8b6b27a-5aab-4cbd-abab-3d89eec5f790"]
}
}
{
"data": {
"recordsByUniqueId": {
"columns": ["ID", "AccountNumber", "Type", "Industry"],
"values": [["1234567890", "CD451796", "Customer - Direct", "Electronics"]]
}
}
}