Find Records
Learn how to find Records from a Table with Morph API.
Overview
In this guide, you will learn how to find Records from a Table using Morph API.
To find one or more Records from a Table using Morph API, you make an API request to the Query Records endpoint.
This endpoint allows you to find all the Records of a Table (if you do not apply any filter or sort condition), or only certain Records meeting the filtering and/or sorting conditions that you would have defined.
pagination
This guide is about the filter and sort conditions of the body parameter of the Query endpoint. The body parameter has paginations parameters. To learn how to use pagination parameters, head to the pagination reference.
For example, you may want to "find all the employees currently working in the the Central Regional Office".
Example for this guide
We will see how to:
- Find all Records in a Table.
- Find a specific Record
- Find filtered Records
- Single Filter
- Composite Filter
- Find sorted Records
- Single sort
- Composite sort
Common parameters
The Headers and Path parameters will be common for all these cases. You can find them right below. What will change between each case is the body parameter. Therefore, we will only focus on the body parameters for each case of this guide.
To build the request of each of the examples of this guide, you will need the following parameters.
Headers
- authorization header:
x-api-key: {YOUR_API_KEY}
client-type: widget
Content-Type: application/json
How to get my API Key?
Head to Create an API Key.
Path parameters
teamSlug
databaseId
tableSlug
Where can I find my teamSlug, databaseId and tableSlug?
Find all the Records
To find all the Records of a Table using Morph API, you make an API request to the Query Records endpoint without applying any filtering or sorting condition.
Let's see it an example with the [Sample] Employees
Table.
Build the request
To build the request, you will need to define header, path and body parameters. We will only focus on the body parameter (as explained above).
Body parameter
To find all the Records, send a first request with no filter
or sort
condition, and no pagination parameters ( limit
nor skip
):
{
"select":["*"],
}
Make the API request
cURL
To make the HTTP request directly using cURL:
- Open a Terminal window.
- Replace the following placeholders in the cURL template below with your own values.
- In the URL:
{YOUR_TEAM_SLUG}
{YOUR_DATABASE_ID}
{YOUR_TABLE_SLUG}
- In the headers:
{YOUR_API_KEY}
for thex-api-key
- Run the command in your Terminal.
- In the URL:
Replace the placeholders with your own values:
curl --X POST 'https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/record/{YOUR_DATABASE_ID}/{YOUR_TABLE_SLUG}/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"select":["*"]
}
'
Example with mock values:
curl --X POST 'https://acme.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2' \
--data '{
"select":["*"]
}
'
Response
Two cases, depending on the value of count
in the response. The value of count
is the total number of Records in the Table.
- The value of
count
is less or equal to20
: The Table has less than20
Records, i.e. less than the default pagination limit. The response returned all the Records of the Table. - The value of
count
is strictly superior to20
: The Table holds more than20
Records. You will need to make a follow up API request to fetch the remaining Records, as shown below.
{
"items": [
{
"employee_id": "E02002",
"full_name": "Kai Le",
"job_title": "Controls Engineer",
"department": "Engineering",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 47,
"hire_date": "2022-02-05",
"annual_salary": 92368,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02003",
"full_name": "Robert Patel",
"job_title": "Analyst",
"department": "Sales",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 58,
"hire_date": "2013-10-23",
"annual_salary": 45703,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02004",
"full_name": "Cameron Lo",
"job_title": "Network Administrator",
"department": "IT",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Asian",
"age": 34,
"hire_date": "2019-03-24",
"annual_salary": 83576,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02005",
"full_name": "Harper Castillo",
"job_title": "IT Systems Architect",
"department": "IT",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 39,
"hire_date": "2018-04-07",
"annual_salary": 98062,
"bonus": 0,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02006",
"full_name": "Harper Dominguez",
"job_title": "Director",
"department": "Engineering",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 42,
"hire_date": "2005-06-18",
"annual_salary": 175391,
"bonus": 24,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02007",
"full_name": "Ezra Vu",
"job_title": "Network Administrator",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 62,
"hire_date": "2004-04-22",
"annual_salary": 66227,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": "2014-02-14"
},
{
"employee_id": "E02008",
"full_name": "Jade Hu",
"job_title": "Sr. Analyst",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 58,
"hire_date": "2009-06-27",
"annual_salary": 89744,
"bonus": 0,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02009",
"full_name": "Miles Chang",
"job_title": "Analyst II",
"department": "Finance",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 62,
"hire_date": "1999-02-19",
"annual_salary": 69674,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02011",
"full_name": "Jameson Thomas",
"job_title": "Manager",
"department": "Finance",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 52,
"hire_date": "2015-02-05",
"annual_salary": 105879,
"bonus": 10,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02012",
"full_name": "Jameson Pena",
"job_title": "Systems Analyst",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Latino",
"age": 49,
"hire_date": "2003-10-12",
"annual_salary": 40499,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02013",
"full_name": "Bella Wu",
"job_title": "Sr. Analyst",
"department": "Finance",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 63,
"hire_date": "2014-08-03",
"annual_salary": 71418,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02014",
"full_name": "Jose Wong",
"job_title": "Director",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2017-11-15",
"annual_salary": 150558,
"bonus": 23,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02015",
"full_name": "Lucas Richardson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 36,
"hire_date": "2018-07-22",
"annual_salary": 118912,
"bonus": 8,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02016",
"full_name": "Jacob Moore",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Black",
"age": 42,
"hire_date": "2021-03-24",
"annual_salary": 131422,
"bonus": 15,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02017",
"full_name": "Luna Lu",
"job_title": "IT Systems Architect",
"department": "IT",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 62,
"hire_date": "1997-07-26",
"annual_salary": 64208,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02018",
"full_name": "Bella Tran",
"job_title": "Vice President",
"department": "Engineering",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2010-08-05",
"annual_salary": 254486,
"bonus": 33,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02019",
"full_name": "Ivy Chau",
"job_title": "Analyst",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 61,
"hire_date": "2019-03-03",
"annual_salary": 54811,
"bonus": 0,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02020",
"full_name": "Jordan Kumar",
"job_title": "Service Desk Analyst",
"department": "IT",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 29,
"hire_date": "2017-11-11",
"annual_salary": 95729,
"bonus": 0,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02021",
"full_name": "Sophia Gutierrez",
"job_title": "Manager",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Latino",
"age": 63,
"hire_date": "2009-02-08",
"annual_salary": 102649,
"bonus": 6,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02022",
"full_name": "Eli Dang",
"job_title": "Sr. Manager",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2015-11-16",
"annual_salary": 122875,
"bonus": 12,
"country": "United States",
"city": "Chicago",
"exit_date": null
}
],
"count": 100
}
Follow up API request
If the the value of count
in the response is strictly superior to 20
, it means that the Table has more than 20
Records. To find all the Records at once, send a follow up request setting the value of the limit
pagination parameter equal to the value of count
.
In the first request to the [Sample] Employees
Table we did not specify any filter or sort condition or pagination parameter. The response returned the 20
first Records from the Table, while the value of count
was 100
. So far we have retrieved 20
out of the 100
Records that the Table holds in total.
Copy of the response above with only the first and twentieth records.
{
"items": [
{
"employee_id": "E02002",
"full_name": "Kai Le",
"job_title": "Controls Engineer",
"department": "Engineering",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 47,
"hire_date": "2022-02-05",
"annual_salary": 92368,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
// (Records removed for readability)
{
"employee_id": "E02022",
"full_name": "Eli Dang",
"job_title": "Sr. Manager",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2015-11-16",
"annual_salary": 122875,
"bonus": 12,
"country": "United States",
"city": "Chicago",
"exit_date": null
}
],
"count": 100
}
Body parameter
To find all the Records, add the limit
parameter and give it a value equal to count
.
{
"select":["*"],
"limit" {VALUE of COUNT}
}
In the example of [Sample] Employees
where count
is equal to 100
:
{
"select":["*"],
"limit": 100
}
Make the API request
cURL
Replace the placeholders with your own values:
curl --X POST 'https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/record/{YOUR_DATABASE_ID}/{YOUR_TABLE_SLUG}/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"select":["*"],
"limit: {VALUE of COUNT}
}
'
Example for [Sample] Employees
Table where limit
is set to the value of count
which is 100
.
curl --X POST 'https://acme.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2' \
--data '{
"select":["*"],
"limit: 100
}
'
Response
You should obtained the following successful response with the full records.
For the [Sample] Employees
you should obtain the entire hundred records in that Table:
{
"items": [
{
"employee_id": "E02002",
"full_name": "Kai Le",
"job_title": "Controls Engineer",
"department": "Engineering",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 47,
"hire_date": "2022-02-05",
"annual_salary": 92368,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02003",
"full_name": "Robert Patel",
"job_title": "Analyst",
"department": "Sales",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 58,
"hire_date": "2013-10-23",
"annual_salary": 45703,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02004",
"full_name": "Cameron Lo",
"job_title": "Network Administrator",
"department": "IT",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Asian",
"age": 34,
"hire_date": "2019-03-24",
"annual_salary": 83576,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02005",
"full_name": "Harper Castillo",
"job_title": "IT Systems Architect",
"department": "IT",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 39,
"hire_date": "2018-04-07",
"annual_salary": 98062,
"bonus": 0,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02006",
"full_name": "Harper Dominguez",
"job_title": "Director",
"department": "Engineering",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 42,
"hire_date": "2005-06-18",
"annual_salary": 175391,
"bonus": 24,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02007",
"full_name": "Ezra Vu",
"job_title": "Network Administrator",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 62,
"hire_date": "2004-04-22",
"annual_salary": 66227,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": "2014-02-14"
},
{
"employee_id": "E02008",
"full_name": "Jade Hu",
"job_title": "Sr. Analyst",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 58,
"hire_date": "2009-06-27",
"annual_salary": 89744,
"bonus": 0,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02009",
"full_name": "Miles Chang",
"job_title": "Analyst II",
"department": "Finance",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 62,
"hire_date": "1999-02-19",
"annual_salary": 69674,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02011",
"full_name": "Jameson Thomas",
"job_title": "Manager",
"department": "Finance",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 52,
"hire_date": "2015-02-05",
"annual_salary": 105879,
"bonus": 10,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02012",
"full_name": "Jameson Pena",
"job_title": "Systems Analyst",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Latino",
"age": 49,
"hire_date": "2003-10-12",
"annual_salary": 40499,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02013",
"full_name": "Bella Wu",
"job_title": "Sr. Analyst",
"department": "Finance",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 63,
"hire_date": "2014-08-03",
"annual_salary": 71418,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02014",
"full_name": "Jose Wong",
"job_title": "Director",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2017-11-15",
"annual_salary": 150558,
"bonus": 23,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02015",
"full_name": "Lucas Richardson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 36,
"hire_date": "2018-07-22",
"annual_salary": 118912,
"bonus": 8,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02016",
"full_name": "Jacob Moore",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Black",
"age": 42,
"hire_date": "2021-03-24",
"annual_salary": 131422,
"bonus": 15,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02017",
"full_name": "Luna Lu",
"job_title": "IT Systems Architect",
"department": "IT",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 62,
"hire_date": "1997-07-26",
"annual_salary": 64208,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02018",
"full_name": "Bella Tran",
"job_title": "Vice President",
"department": "Engineering",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2010-08-05",
"annual_salary": 254486,
"bonus": 33,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02019",
"full_name": "Ivy Chau",
"job_title": "Analyst",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 61,
"hire_date": "2019-03-03",
"annual_salary": 54811,
"bonus": 0,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02020",
"full_name": "Jordan Kumar",
"job_title": "Service Desk Analyst",
"department": "IT",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 29,
"hire_date": "2017-11-11",
"annual_salary": 95729,
"bonus": 0,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02021",
"full_name": "Sophia Gutierrez",
"job_title": "Manager",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Latino",
"age": 63,
"hire_date": "2009-02-08",
"annual_salary": 102649,
"bonus": 6,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02022",
"full_name": "Eli Dang",
"job_title": "Sr. Manager",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2015-11-16",
"annual_salary": 122875,
"bonus": 12,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02023",
"full_name": "Lillian Lewis",
"job_title": "Technical Architect",
"department": "IT",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Black",
"age": 43,
"hire_date": "2013-08-14",
"annual_salary": 83323,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": "2019-03-31"
},
{
"employee_id": "E02024",
"full_name": "Serenity Cao",
"job_title": "Account Representative",
"department": "Sales",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Asian",
"age": 31,
"hire_date": "2018-10-21",
"annual_salary": 66721,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02025",
"full_name": "Parker Lai",
"job_title": "Vice President",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 48,
"hire_date": "2006-11-29",
"annual_salary": 246400,
"bonus": 36,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02026",
"full_name": "Charles Simmons",
"job_title": "Manager",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 55,
"hire_date": "1997-10-27",
"annual_salary": 113525,
"bonus": 6,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02027",
"full_name": "Jayden Luu",
"job_title": "Director",
"department": "Accounting",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 64,
"hire_date": "2004-05-13",
"annual_salary": 184342,
"bonus": 22,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02028",
"full_name": "Brooks Richardson",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 58,
"hire_date": "2020-11-24",
"annual_salary": 151341,
"bonus": 22,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02029",
"full_name": "Ivy Thompson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 50,
"hire_date": "2004-08-11",
"annual_salary": 118900,
"bonus": 5,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02030",
"full_name": "Peyton Wright",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Black",
"age": 41,
"hire_date": "2017-05-13",
"annual_salary": 153370,
"bonus": 10,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02031",
"full_name": "Wyatt Dinh",
"job_title": "System AdministratorIT",
"department": "Specialty Products",
"business_unit": null,
"gender": "Male",
"ethnicity": "Asian",
"age": 50,
"hire_date": "2002-03-15",
"annual_salary": 72860,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02032",
"full_name": "Ruby Alexander",
"job_title": "Vice President",
"department": "Finance",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 59,
"hire_date": "2001-08-13",
"annual_salary": 255610,
"bonus": 36,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02033",
"full_name": "Axel Oh",
"job_title": "Sr. Analyst",
"department": "Sales",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 26,
"hire_date": "2020-10-24",
"annual_salary": 84962,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02034",
"full_name": "Axel Ramirez",
"job_title": "Manager",
"department": "Human Resources",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Latino",
"age": 55,
"hire_date": "2017-12-04",
"annual_salary": 103795,
"bonus": 7,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02035",
"full_name": "Liliana Chang",
"job_title": "Service Desk Analyst",
"department": "IT",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 32,
"hire_date": "2018-01-11",
"annual_salary": 97509,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02037",
"full_name": "Landon Gonzales",
"job_title": "Test Engineer",
"department": "Engineering",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Latino",
"age": 54,
"hire_date": "2009-08-30",
"annual_salary": 88689,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02038",
"full_name": "Amelia Dominguez",
"job_title": "Sr. Manager",
"department": "Accounting",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 31,
"hire_date": "2015-09-23",
"annual_salary": 158184,
"bonus": 15,
"country": "Brazil",
"city": "Rio de Janeiro",
"exit_date": "2018-07-27"
},
{
"employee_id": "E02039",
"full_name": "Silas Ross",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 47,
"hire_date": "2016-02-10",
"annual_salary": 48523,
"bonus": 0,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02040",
"full_name": "Jeremiah Cheng",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 26,
"hire_date": "2022-02-05",
"annual_salary": 70946,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02041",
"full_name": "Chloe Chin",
"job_title": "Sr. Manager",
"department": "Finance",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 62,
"hire_date": "2021-11-13",
"annual_salary": 134487,
"bonus": 10,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02042",
"full_name": "Ella Martinez",
"job_title": "Sr. Analyst",
"department": "Finance",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Latino",
"age": 35,
"hire_date": "2012-04-06",
"annual_salary": 76111,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02043",
"full_name": "Gianna Jones",
"job_title": "Manager",
"department": "Accounting",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 48,
"hire_date": "1998-09-26",
"annual_salary": 119220,
"bonus": 9,
"country": "United States",
"city": "Columbus",
"exit_date": "2016-11-02"
},
{
"employee_id": "E02044",
"full_name": "Austin Chow",
"job_title": "Vice President",
"department": "Accounting",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 35,
"hire_date": "2021-04-11",
"annual_salary": 180858,
"bonus": 32,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02045",
"full_name": "Ella Chen",
"job_title": "Manager",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2005-11-10",
"annual_salary": 114072,
"bonus": 8,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02046",
"full_name": "Ruby Kaur",
"job_title": "Test Engineer",
"department": "Engineering",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Asian",
"age": 26,
"hire_date": "2021-06-26",
"annual_salary": 91672,
"bonus": 0,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02047",
"full_name": "Savannah Morales",
"job_title": "Analyst II",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 48,
"hire_date": "2005-01-26",
"annual_salary": 71542,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02048",
"full_name": "Luca Powell",
"job_title": "IT Coordinator",
"department": "IT",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 33,
"hire_date": "2016-12-18",
"annual_salary": 54700,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02049",
"full_name": "Parker Thao",
"job_title": "Analyst II",
"department": "Sales",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 55,
"hire_date": "2011-05-08",
"annual_salary": 65022,
"bonus": 0,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02050",
"full_name": "Ryan Vo",
"job_title": "Cloud Infrastructure Architect",
"department": "IT",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Asian",
"age": 38,
"hire_date": "2011-04-12",
"annual_salary": 65109,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02051",
"full_name": "Isabella Ngo",
"job_title": "Manager",
"department": "Accounting",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 49,
"hire_date": "2022-01-01",
"annual_salary": 126598,
"bonus": 9,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02052",
"full_name": "Leah Vega",
"job_title": "Cloud Infrastructure Architect",
"department": "IT",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 52,
"hire_date": "2018-06-07",
"annual_salary": 72388,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02053",
"full_name": "Jaxson Liu",
"job_title": "Vice President",
"department": "Finance",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 27,
"hire_date": "2021-05-18",
"annual_salary": 205216,
"bonus": 36,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02054",
"full_name": "Santiago f Ross",
"job_title": "Enterprise Architect",
"department": "IT",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 34,
"hire_date": "2012-12-13",
"annual_salary": 74004,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02055",
"full_name": "Layla Bell",
"job_title": "Vice President",
"department": "Engineering",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 65,
"hire_date": "2001-07-26",
"annual_salary": 203030,
"bonus": 31,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02056",
"full_name": "Bella Morales",
"job_title": "Director",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Latino",
"age": 38,
"hire_date": "2016-05-10",
"annual_salary": 194864,
"bonus": 24,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02057",
"full_name": "Eliza Kang",
"job_title": "Computer Systems Manager",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Asian",
"age": 63,
"hire_date": "2002-01-27",
"annual_salary": 76659,
"bonus": 5,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02058",
"full_name": "Gabriel Reyes",
"job_title": "Manager",
"department": "Sales",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Latino",
"age": 42,
"hire_date": "2005-06-10",
"annual_salary": 101630,
"bonus": 8,
"country": "Brazil",
"city": "Sao Paulo",
"exit_date": null
},
{
"employee_id": "E02059",
"full_name": "Piper Garcia",
"job_title": "Sr. Manager",
"department": "Sales",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Latino",
"age": 60,
"hire_date": "1993-11-24",
"annual_salary": 126929,
"bonus": 12,
"country": "Brazil",
"city": "Sao Paulo",
"exit_date": null
},
{
"employee_id": "E02060",
"full_name": "Jacob Cheng",
"job_title": "Director",
"department": "Sales",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Asian",
"age": 47,
"hire_date": "1999-11-26",
"annual_salary": 155890,
"bonus": 17,
"country": "United States",
"city": "Columbus",
"exit_date": "2003-11-27"
},
{
"employee_id": "E02061",
"full_name": "Nathan Hong",
"job_title": "Director",
"department": "Finance",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 50,
"hire_date": "2019-10-02",
"annual_salary": 150631,
"bonus": 17,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02062",
"full_name": "Chloe Kim",
"job_title": "Sr. Analyst",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 39,
"hire_date": "2012-07-06",
"annual_salary": 72850,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02063",
"full_name": "Isaac Guzman",
"job_title": "Account Representative",
"department": "Sales",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Latino",
"age": 46,
"hire_date": "2010-08-18",
"annual_salary": 57951,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02064",
"full_name": "Julian Ford",
"job_title": "Analyst II",
"department": "Sales",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 50,
"hire_date": "2010-07-29",
"annual_salary": 70340,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02066",
"full_name": "Wesley Yu",
"job_title": "Sr. Manager",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 43,
"hire_date": "2003-09-24",
"annual_salary": 127175,
"bonus": 12,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02068",
"full_name": "Ethan Sanchez",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Latino",
"age": 34,
"hire_date": "2019-05-15",
"annual_salary": 81646,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02069",
"full_name": "David Sanchez",
"job_title": "Director",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Latino",
"age": 38,
"hire_date": "2009-07-05",
"annual_salary": 182055,
"bonus": 27,
"country": "Brazil",
"city": "Rio de Janeiro",
"exit_date": null
},
{
"employee_id": "E02070",
"full_name": "Elias Hsu",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 35,
"hire_date": "2022-01-23",
"annual_salary": 86777,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02071",
"full_name": "Luca Phan",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 39,
"hire_date": "2015-06-17",
"annual_salary": 129949,
"bonus": 9,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02072",
"full_name": "Olivia Xi",
"job_title": "Manager",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Asian",
"age": 26,
"hire_date": "2020-08-19",
"annual_salary": 124535,
"bonus": 6,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02073",
"full_name": "Alice Luu",
"job_title": "System AdministratorIT",
"department": "Research & Development",
"business_unit": null,
"gender": "Female",
"ethnicity": "Asian",
"age": 60,
"hire_date": "1993-07-17",
"annual_salary": 81083,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02074",
"full_name": "Leonardo Ng",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 32,
"hire_date": "2019-06-10",
"annual_salary": 57727,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02075",
"full_name": "Peyton Edwards",
"job_title": "Analyst II",
"department": "Finance",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 65,
"hire_date": "2020-07-11",
"annual_salary": 59344,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02076",
"full_name": "Axel Patel",
"job_title": "Sr. Analyst",
"department": "Sales",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Asian",
"age": 27,
"hire_date": "2022-09-13",
"annual_salary": 73203,
"bonus": 0,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02077",
"full_name": "Eva Chavez",
"job_title": "IT Systems Architect",
"department": "IT",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Latino",
"age": 63,
"hire_date": "2004-01-17",
"annual_salary": 83070,
"bonus": 0,
"country": "Brazil",
"city": "Sao Paulo",
"exit_date": null
},
{
"employee_id": "E02078",
"full_name": "Savannah Lee",
"job_title": "Manager",
"department": "Human Resources",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Asian",
"age": 51,
"hire_date": "2020-07-22",
"annual_salary": 104008,
"bonus": 10,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02079",
"full_name": "Mia Grant",
"job_title": "Solutions Architect",
"department": "IT",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 43,
"hire_date": "2007-02-16",
"annual_salary": 70923,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02080",
"full_name": "Eli Richardson",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Black",
"age": 31,
"hire_date": "2018-04-08",
"annual_salary": 159121,
"bonus": 14,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02081",
"full_name": "Eloise Perry",
"job_title": "Sr. Business Partner",
"department": "Human Resources",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 26,
"hire_date": "2020-12-02",
"annual_salary": 88921,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02082",
"full_name": "Ian Cheng",
"job_title": "Sr. Manager",
"department": "Sales",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 46,
"hire_date": "2015-08-30",
"annual_salary": 126704,
"bonus": 14,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02083",
"full_name": "Penelope Chan",
"job_title": "Analyst II",
"department": "Accounting",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Asian",
"age": 59,
"hire_date": "2012-05-20",
"annual_salary": 57704,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": "2019-11-21"
},
{
"employee_id": "E02084",
"full_name": "Sofia Vasquez",
"job_title": "Director",
"department": "Sales",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Latino",
"age": 52,
"hire_date": "1996-07-29",
"annual_salary": 191455,
"bonus": 24,
"country": "Brazil",
"city": "Sao Paulo",
"exit_date": null
},
{
"employee_id": "E02085",
"full_name": "Anthony Baker",
"job_title": "Solutions Architect",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 31,
"hire_date": "2021-06-03",
"annual_salary": 99937,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02086",
"full_name": "Lucas Luong",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 42,
"hire_date": "2008-03-12",
"annual_salary": 40778,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02087",
"full_name": "Xavier Patel",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 53,
"hire_date": "2021-11-16",
"annual_salary": 187740,
"bonus": 16,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02088",
"full_name": "Robert Soto",
"job_title": "HRIS Analyst",
"department": "Human Resources",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Latino",
"age": 47,
"hire_date": "2008-09-10",
"annual_salary": 72384,
"bonus": 0,
"country": "Brazil",
"city": "Rio de Janeiro",
"exit_date": null
},
{
"employee_id": "E02089",
"full_name": "Nevaeh Jiang",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2016-08-05",
"annual_salary": 143318,
"bonus": 12,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02090",
"full_name": "Chloe Reyes",
"job_title": "Director",
"department": "Human Resources",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Latino",
"age": 45,
"hire_date": "2008-06-18",
"annual_salary": 191304,
"bonus": 17,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02091",
"full_name": "Lucy Edwards",
"job_title": "Director",
"department": "Human Resources",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Black",
"age": 33,
"hire_date": "2015-03-16",
"annual_salary": 175875,
"bonus": 21,
"country": "United States",
"city": "Columbus",
"exit_date": "2022-05-16"
},
{
"employee_id": "E02092",
"full_name": "Luna Edwards",
"job_title": "Manager",
"department": "Sales",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Black",
"age": 42,
"hire_date": "2014-04-13",
"annual_salary": 106726,
"bonus": 9,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02093",
"full_name": "Stella Daniels",
"job_title": "Cloud Infrastructure Architect",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Black",
"age": 37,
"hire_date": "2011-10-30",
"annual_salary": 72637,
"bonus": 0,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02094",
"full_name": "Ayla Ma",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 27,
"hire_date": "2022-12-05",
"annual_salary": 118304,
"bonus": 7,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02095",
"full_name": "Matthew Avila",
"job_title": "Computer Systems Manager",
"department": "IT",
"business_unit": "Manufacturing",
"gender": "Male",
"ethnicity": "Latino",
"age": 55,
"hire_date": "2003-06-17",
"annual_salary": 68592,
"bonus": 8,
"country": "Brazil",
"city": "Sao Paulo",
"exit_date": null
},
{
"employee_id": "E02096",
"full_name": "Gianna Lim",
"job_title": "Analyst",
"department": "Accounting",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Asian",
"age": 46,
"hire_date": "2006-04-01",
"annual_salary": 42532,
"bonus": 0,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02097",
"full_name": "Joseph Tan",
"job_title": "Technical Architect",
"department": "IT",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Asian",
"age": 37,
"hire_date": "2015-08-20",
"annual_salary": 65073,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02098",
"full_name": "Connor Lai",
"job_title": "Engineering Manager",
"department": "Engineering",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 32,
"hire_date": "2019-09-22",
"annual_salary": 111035,
"bonus": 12,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02099",
"full_name": "Ava Owens",
"job_title": "Analyst II",
"department": "Finance",
"business_unit": "Specialty Products",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 28,
"hire_date": "2020-02-07",
"annual_salary": 63066,
"bonus": 0,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02100",
"full_name": "Dylan Aguilar",
"job_title": "Director",
"department": "Engineering",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Latino",
"age": 49,
"hire_date": "2007-03-27",
"annual_salary": 186192,
"bonus": 27,
"country": "Brazil",
"city": "Sao Paulo",
"exit_date": null
},
{
"employee_id": "E02101",
"full_name": "Leah Zheng",
"job_title": "Director",
"department": "Engineering",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 52,
"hire_date": "2016-06-18",
"annual_salary": 182938,
"bonus": 23,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02107",
"full_name": "Parker Joseph",
"job_title": "Systems Analyst",
"department": "IT",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 53,
"hire_date": "2000-01-21",
"annual_salary": 55039,
"bonus": 0,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02639",
"full_name": "Asher Ly",
"job_title": "Analyst II",
"department": "Sales",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 65,
"hire_date": "1998-01-29",
"annual_salary": 63853,
"bonus": 0,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02663",
"full_name": "Josiah Lai",
"job_title": "Sr. Manager",
"department": "Human Resources",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Asian",
"age": 54,
"hire_date": "1995-03-21",
"annual_salary": 154658,
"bonus": 12,
"country": "China",
"city": "Chongqing",
"exit_date": null
},
{
"employee_id": "E02723",
"full_name": "Mateo Vargas",
"job_title": "Network Architect",
"department": "IT",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Latino",
"age": 53,
"hire_date": "1994-04-20",
"annual_salary": 75226,
"bonus": 0,
"country": "Brazil",
"city": "Rio de Janeiro",
"exit_date": null
}
],
"count": 100
}
Debugging
Not retrieving the records?
Try to the following debugging steps.
Find a specific Record
If you are looking to retrieve a single specific Record, it's most likely that you are seeking to retrieve that Record based on the value of its "ID" Field in that Table.
For example, in the [Sample] Employees
Table, you may want to retrieve the Record for an s employee from its employee_id
field (the "ID" field for that Table).
Let's take an example to retrieve the full Record for the employee named Luna Edwards
whose employee_id
is E02092
.
Build the request
Body parameter
To find a single specific Records from its "ID" Field, use the filter
with and
condition:
{
"select":["*"],
"filter":{
"and":[
{
"key":"{ID FIELD}",
"operator":"equal",
"value":"{VALUE}"
}
]
}
}
For example, to retrieve the full Record for the employee named Luna Edwards
whose employee_id
is E02092
:
{
"select":["*"],
"filter":{
"and":[
{
"key":"employee_id",
"operator":"equal",
"value":"E02092"
}
]
}
}
Make the API request
cURL
To make the HTTP request directly using cURL:
- Open a Terminal window.
- Replace the following placeholders in the cURL template below with your own values.
- In the URL:
{YOUR_TEAM_SLUG}
{YOUR_DATABASE_ID}
{YOUR_TABLE_SLUG}
- In the headers:
{YOUR_API_KEY}
for thex-api-key
- Run the command in your Terminal.
- In the URL:
Replace the placeholders with your own values:
curl --X POST 'https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/record/{YOUR_DATABASE_ID}/{YOUR_TABLE_SLUG}/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"{ID FIELD}",
"operator":"equal",
"value":"{VALUE}"
}
]
}
}'
Example for the employee named Luna Edwards
whose employee_id
is E02092
:
curl --X POST 'https://acme.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"employee_id",
"operator":"equal",
"value":"E02092"
}
]
}
}'
Response
A successful response will return the Record, for example:
{
"items": [
{
"employee_id": "E02092",
"full_name": "Luna Edwards",
"job_title": "Manager",
"department": "Sales",
"business_unit": "Research & Development",
"gender": "Female",
"ethnicity": "Black",
"age": 42,
"hire_date": "2014-04-13",
"annual_salary": 106726,
"bonus": 9,
"country": "United States",
"city": "Seattle",
"exit_date": null
}
],
"count": 1
}
Debugging
Not retrieving the records?
Try to the following debugging steps.
Find filtered Records
To obtain a subset of your data depending on certain condition(s), you can apply filters to your query. Filters can be simple conditions such as "Department is Marketing". These are called single filter.
You can multiple conditions combined together such as "Department is Marketing AND Hire Date is after 1st January 2012 AND annual salary is superior than 100,000". These multiple filter conditions where several "and" or "or" are combined together are named composite filters in Morph API.
Single filter
Let's see how to apply a single filter condition with an example. Taking the [Sample] Employees
Table, let's find all the employees who are working for in the Marketing department.
Build the request
Body parameter
To apply a single filter condition to a query, add the filter
body parameter, the and
array condition and define the values for the key
, operator
and value
properties of its first object:
{
"select":["*"],
"filter":{
"and":[
{
"key":"{FIELD NAME}",
"operator":"{OPERATOR}",
"value":"{VALUE}"
}
]
}
}
For our example, to find all the employees who are working for in the Marketing department. This translates in terms of filtering condition as:
{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
}
]
}
}
Make the API request
cURL
To make the HTTP request directly using cURL:
- Open a Terminal window.
- Replace the following placeholders in the cURL template below with your own values.
- In the URL:
{YOUR_TEAM_SLUG}
{YOUR_DATABASE_ID}
{YOUR_TABLE_SLUG}
- In the headers:
{YOUR_API_KEY}
for thex-api-key
- Run the command in your Terminal.
- In the URL:
Replace the placeholders with your own values:
curl --X POST 'https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/record/{YOUR_DATABASE_ID}/{YOUR_TABLE_SLUG}/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"{FIELD}",
"operator":"{OPERATOR}",
"value":"{VALUE}"
}
]
}
}'
Example to find all the employees who are working for in the Marketing department:
curl --X POST 'https://acme.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
}
]
}
}'
Response
A successful response will return all the records matching the specified condition. In our example, we obtain all the employees working in the Marketing department.
{
"items": [
{
"employee_id": "E02015",
"full_name": "Lucas Richardson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 36,
"hire_date": "2018-07-22",
"annual_salary": 118912,
"bonus": 8,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02016",
"full_name": "Jacob Moore",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Black",
"age": 42,
"hire_date": "2021-03-24",
"annual_salary": 131422,
"bonus": 15,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02028",
"full_name": "Brooks Richardson",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 58,
"hire_date": "2020-11-24",
"annual_salary": 151341,
"bonus": 22,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02029",
"full_name": "Ivy Thompson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 50,
"hire_date": "2004-08-11",
"annual_salary": 118900,
"bonus": 5,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02030",
"full_name": "Peyton Wright",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Black",
"age": 41,
"hire_date": "2017-05-13",
"annual_salary": 153370,
"bonus": 10,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02039",
"full_name": "Silas Ross",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 47,
"hire_date": "2016-02-10",
"annual_salary": 48523,
"bonus": 0,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02040",
"full_name": "Jeremiah Cheng",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 26,
"hire_date": "2022-02-05",
"annual_salary": 70946,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02047",
"full_name": "Savannah Morales",
"job_title": "Analyst II",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 48,
"hire_date": "2005-01-26",
"annual_salary": 71542,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02068",
"full_name": "Ethan Sanchez",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Latino",
"age": 34,
"hire_date": "2019-05-15",
"annual_salary": 81646,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02070",
"full_name": "Elias Hsu",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 35,
"hire_date": "2022-01-23",
"annual_salary": 86777,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02071",
"full_name": "Luca Phan",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 39,
"hire_date": "2015-06-17",
"annual_salary": 129949,
"bonus": 9,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02074",
"full_name": "Leonardo Ng",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 32,
"hire_date": "2019-06-10",
"annual_salary": 57727,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02080",
"full_name": "Eli Richardson",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Black",
"age": 31,
"hire_date": "2018-04-08",
"annual_salary": 159121,
"bonus": 14,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02086",
"full_name": "Lucas Luong",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 42,
"hire_date": "2008-03-12",
"annual_salary": 40778,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02087",
"full_name": "Xavier Patel",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 53,
"hire_date": "2021-11-16",
"annual_salary": 187740,
"bonus": 16,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02089",
"full_name": "Nevaeh Jiang",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2016-08-05",
"annual_salary": 143318,
"bonus": 12,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02094",
"full_name": "Ayla Ma",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 27,
"hire_date": "2022-12-05",
"annual_salary": 118304,
"bonus": 7,
"country": "China",
"city": "Shanghai",
"exit_date": null
}
],
"count": 17
}
Debugging
Not retrieving the records?
Try to the following debugging steps.
Composite filters
Let's see how to apply multiple filter conditions taking the example of the [Sample] Employees
Table. Let's find all the employees working in the Marketing department who were hired from the 1st January 2012 and whose annual salary is strictly superior to 100,000.
Build the request
Body parameter
To apply a composite filter to a query, add the filter
body parameter, the and
array condition and define the values for the key
, operator
and value
properties of the objects.
For example with three AND filters:
{
"select":["*"],
"filter":{
"and":[
{
"key":"{FIELD}",
"operator":"{OPERATOR}",
"value":"{VALUE}"
},
// MULTIPLE FILTERS
{
"key":"{FIELD}",
"operator":"{OPERATOR}",
"value":"{VALUE}"
}
]
}
}
For our example, to find all the employees working in the Marketing department who were hired from the 1st January 2012 and whose annual salary is strictly superior to 100,000. This translates in terms of filtering condition as:
{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
},
{
"key":"hire_date",
"operator":"greaterThanOrEqual",
"value":"2012-01-01"
},
{
"key":"annual_salary",
"operator":"greaterThan",
"value":"100000"
}
]
}
}
Make the API request
cURL
To make the HTTP request directly using cURL:
- Open a Terminal window.
- Replace the following placeholders in the cURL template below with your own values.
- In the URL:
{YOUR_TEAM_SLUG}
{YOUR_DATABASE_ID}
{YOUR_TABLE_SLUG}
- In the headers:
{YOUR_API_KEY}
for thex-api-key
- Run the command in your Terminal.
- In the URL:
Replace the placeholders with your own values:
curl --X POST 'https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/record/{YOUR_DATABASE_ID}/{YOUR_TABLE_SLUG}/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"{FIELD}",
"operator":"{OPERATOR}",
"value":"{VALUE}"
},
// MULTIPLE FILTERS
{
"key":"{FIELD}",
"operator":"{OPERATOR}",
"value":"{VALUE}"
}
]
}
}'
Example for the employees working in the Marketing department who were hired from the 1st January 2012 and whose annual salary is strictly superior to 100,000:
curl --X POST 'https://acme.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
},
{
"key":"hire_date",
"operator":"greaterThanOrEqual",
"value":"2012-01-01"
},
{
"key":"annual_salary",
"operator":"greaterThan",
"value":"100000"
}
]
}
}'
Response
A successful response will return all the records matching the specified condition.
In our example, we obtain all the employees working in the Marketing department who were hired from the 1st January 2012 and whose annual salary is strictly superior to 100,000.
{
"items": [
{
"employee_id": "E02015",
"full_name": "Lucas Richardson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 36,
"hire_date": "2018-07-22",
"annual_salary": 118912,
"bonus": 8,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02016",
"full_name": "Jacob Moore",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Black",
"age": 42,
"hire_date": "2021-03-24",
"annual_salary": 131422,
"bonus": 15,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02028",
"full_name": "Brooks Richardson",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 58,
"hire_date": "2020-11-24",
"annual_salary": 151341,
"bonus": 22,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02030",
"full_name": "Peyton Wright",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Black",
"age": 41,
"hire_date": "2017-05-13",
"annual_salary": 153370,
"bonus": 10,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02071",
"full_name": "Luca Phan",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 39,
"hire_date": "2015-06-17",
"annual_salary": 129949,
"bonus": 9,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02080",
"full_name": "Eli Richardson",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Black",
"age": 31,
"hire_date": "2018-04-08",
"annual_salary": 159121,
"bonus": 14,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02087",
"full_name": "Xavier Patel",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 53,
"hire_date": "2021-11-16",
"annual_salary": 187740,
"bonus": 16,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02089",
"full_name": "Nevaeh Jiang",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2016-08-05",
"annual_salary": 143318,
"bonus": 12,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02094",
"full_name": "Ayla Ma",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 27,
"hire_date": "2022-12-05",
"annual_salary": 118304,
"bonus": 7,
"country": "China",
"city": "Shanghai",
"exit_date": null
}
],
"count": 9
}
Debugging
Not retrieving the records?
Try to the following debugging steps.
Sort Records
To obtained ordered records in the response from Morph API, apply sort parameter(s) to your query.
Similarly to filters, you can apply a single sort such as "Ordered by full name in alphabetical order" or multiple sorts such as "Ordered by alphabetical order and from lower to higher annual salary."
Single sort
Let's see how to apply a single sort condition with an example. Taking the example from the Single Filter. In that example using the [Sample] Employees
Table, we applied a single filter to find all the employees who are working for in the Marketing department.
Let's add a single sort to order the these employees by their full name in alphabetical order.
Build the request
Body parameter
To apply a single sort condition to a query, add the sort
body parameter an and define the values for the key
, direction
properties of its first object:
{
"select":["*"],
"sort":[
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
}
]
}
For our example, to sort employees' by their full name in alphabetical order. This translates in terms of filtering condition as:
{
"select":["*"],
"sort":[
{
"key":"full_name",
"direction":"ascending"
}
]
}
For our example, using both a single filter and a single sort to find all the employees who are working for in the Marketing department sorted by their full name in alphabetical order. This translates in terms of filtering condition as:
{
"select":["*"],
"filter":{
"and":[
{
"key":"{FIELD}",
"operator":"{FILTER OPERATOR}",
"value":"{VALUE}"
}
]
},
"sort":[
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
}
]
}
With values:
{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
}
]
},
"sort":[
{
"key":"full_name",
"direction":"ascending"
}
]
}
Make the API request
cURL
To make the HTTP request directly using cURL:
- Open a Terminal window.
- Replace the following placeholders in the cURL template below with your own values.
- In the URL:
{YOUR_TEAM_SLUG}
{YOUR_DATABASE_ID}
{YOUR_TABLE_SLUG}
- In the headers:
{YOUR_API_KEY}
for thex-api-key
- Run the command in your Terminal.
- In the URL:
Replace the placeholders with your own values:
curl --X POST 'https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/record/{YOUR_DATABASE_ID}/{YOUR_TABLE_SLUG}/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"{FIELD}",
"operator":"{FILTER OPERATOR}",
"value":"{VALUE}"
}
]
},
"sort":[
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
}
]
}'
Example to find all the employees who are working for in the Marketing department
curl --X POST 'https://acme.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
}
]
},
"sort":[
{
"key":"full_name",
"direction":"ascending"
}
]
}'
Response
A successful response will return all the records matching the specified condition.
We obtain the same list of employees working in the Marketing department than for in the Single Filter example, except that they are now ordered by their full name in alphabetical order:
{
"items": [
{
"employee_id": "E02094",
"full_name": "Ayla Ma",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 27,
"hire_date": "2022-12-05",
"annual_salary": 118304,
"bonus": 7,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02028",
"full_name": "Brooks Richardson",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 58,
"hire_date": "2020-11-24",
"annual_salary": 151341,
"bonus": 22,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02080",
"full_name": "Eli Richardson",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Black",
"age": 31,
"hire_date": "2018-04-08",
"annual_salary": 159121,
"bonus": 14,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02070",
"full_name": "Elias Hsu",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 35,
"hire_date": "2022-01-23",
"annual_salary": 86777,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02068",
"full_name": "Ethan Sanchez",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Latino",
"age": 34,
"hire_date": "2019-05-15",
"annual_salary": 81646,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02029",
"full_name": "Ivy Thompson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 50,
"hire_date": "2004-08-11",
"annual_salary": 118900,
"bonus": 5,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02016",
"full_name": "Jacob Moore",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Black",
"age": 42,
"hire_date": "2021-03-24",
"annual_salary": 131422,
"bonus": 15,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02040",
"full_name": "Jeremiah Cheng",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 26,
"hire_date": "2022-02-05",
"annual_salary": 70946,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02074",
"full_name": "Leonardo Ng",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 32,
"hire_date": "2019-06-10",
"annual_salary": 57727,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02071",
"full_name": "Luca Phan",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 39,
"hire_date": "2015-06-17",
"annual_salary": 129949,
"bonus": 9,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02086",
"full_name": "Lucas Luong",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 42,
"hire_date": "2008-03-12",
"annual_salary": 40778,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02015",
"full_name": "Lucas Richardson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 36,
"hire_date": "2018-07-22",
"annual_salary": 118912,
"bonus": 8,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02089",
"full_name": "Nevaeh Jiang",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2016-08-05",
"annual_salary": 143318,
"bonus": 12,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02030",
"full_name": "Peyton Wright",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Black",
"age": 41,
"hire_date": "2017-05-13",
"annual_salary": 153370,
"bonus": 10,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02047",
"full_name": "Savannah Morales",
"job_title": "Analyst II",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 48,
"hire_date": "2005-01-26",
"annual_salary": 71542,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02039",
"full_name": "Silas Ross",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 47,
"hire_date": "2016-02-10",
"annual_salary": 48523,
"bonus": 0,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02087",
"full_name": "Xavier Patel",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 53,
"hire_date": "2021-11-16",
"annual_salary": 187740,
"bonus": 16,
"country": "United States",
"city": "Columbus",
"exit_date": null
}
],
"count": 17
}
Debugging
Not retrieving the records?
Try to the following debugging steps.
Composite sorts
Let's see how to apply multiple sort conditions taking the example of the [Sample] Employees
Table.
Using the same subset of employees working in the Marketing department, let's apply two sort conditions to obtain the results order by job titles in alphabetical order and from lower to higher annual salaries.
Build the request
Body parameter
To apply a composite sort condition to a query, add the sort
body parameter and define the values for the key
and direction
properties of the objects:
{
"select":["*"],
"sort":[
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
},
// MULTIPLE SORTS
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
}
]
}
For our example, to sort the employees by job titles in alphabetical order and from lower to higher annual salaries. This translates in terms of sorting condition as:
{
"select":["*"],
"sort":[
{
"key":"job_title",
"direction":"ascending"
},
{
"key":"annual_salary",
"direction":"ascending"
}
]
}
For our example, using both a single filter and a single sort to find all the employees who are working for in the Marketing department sorted by their full name in alphabetical order. This translates in terms of filtering condition as:
{
"select":["*"],
"filter":{
"and":[
{
"key":"{FIELD}",
"operator":"{FILTER OPERATOR}",
"value":"{VALUE}"
}
]
},
"sort":[
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
},
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
}
]
}
With values:
{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
}
]
},
"sort":[
{
"key":"job_title",
"direction":"ascending"
},
{
"key":"annual_salary",
"direction":"ascending"
}
]
}
Make the API request
cURL
To make the HTTP request directly using cURL:
- Open a Terminal window.
- Replace the following placeholders in the cURL template below with your own values.
- In the URL:
{YOUR_TEAM_SLUG}
{YOUR_DATABASE_ID}
{YOUR_TABLE_SLUG}
- In the headers:
{YOUR_API_KEY}
for thex-api-key
- Run the command in your Terminal.
- In the URL:
Replace the placeholders with your own values:
curl --X POST 'https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/record/{YOUR_DATABASE_ID}/{YOUR_TABLE_SLUG}/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
{
"select":["*"],
"sort":[
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
},
// MULTIPLE SORTS
{
"key":"{FIELD}",
"direction":"{SORT OPERATOR}"
}
]
}
}'
Example for the employees working in the Marketing department sorted by job titles in alphabetical order and from lower to higher annual salaries:
curl --X POST 'https://acme.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query' \
--header 'Content-Type: application/json' \
--header 'client-type: widget' \
--header 'x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2' \
--data '{
"select":["*"],
"filter":{
"and":[
{
"key":"department",
"operator":"equal",
"value":"Marketing"
}
]
},
"sort":[
{
"key":"job_title",
"direction":"ascending"
},
{
"key":"annual_salary",
"direction":"ascending"
}
]
}'
Response
A successful response will return all the records matching the specified condition.
In our example, we obtain all the employees working in the Marketing department sorted by job titles in alphabetical order and from lower to higher annual salaries:
{
"items": [
{
"employee_id": "E02086",
"full_name": "Lucas Luong",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 42,
"hire_date": "2008-03-12",
"annual_salary": 40778,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02039",
"full_name": "Silas Ross",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 47,
"hire_date": "2016-02-10",
"annual_salary": 48523,
"bonus": 0,
"country": "United States",
"city": "Austin",
"exit_date": null
},
{
"employee_id": "E02074",
"full_name": "Leonardo Ng",
"job_title": "Analyst",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 32,
"hire_date": "2019-06-10",
"annual_salary": 57727,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02047",
"full_name": "Savannah Morales",
"job_title": "Analyst II",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Latino",
"age": 48,
"hire_date": "2005-01-26",
"annual_salary": 71542,
"bonus": 0,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02028",
"full_name": "Brooks Richardson",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 58,
"hire_date": "2020-11-24",
"annual_salary": 151341,
"bonus": 22,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02087",
"full_name": "Xavier Patel",
"job_title": "Director",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 53,
"hire_date": "2021-11-16",
"annual_salary": 187740,
"bonus": 16,
"country": "United States",
"city": "Columbus",
"exit_date": null
},
{
"employee_id": "E02094",
"full_name": "Ayla Ma",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 27,
"hire_date": "2022-12-05",
"annual_salary": 118304,
"bonus": 7,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02029",
"full_name": "Ivy Thompson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Manufacturing",
"gender": "Female",
"ethnicity": "Caucasian",
"age": 50,
"hire_date": "2004-08-11",
"annual_salary": 118900,
"bonus": 5,
"country": "United States",
"city": "Seattle",
"exit_date": null
},
{
"employee_id": "E02015",
"full_name": "Lucas Richardson",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Caucasian",
"age": 36,
"hire_date": "2018-07-22",
"annual_salary": 118912,
"bonus": 8,
"country": "United States",
"city": "Miami",
"exit_date": null
},
{
"employee_id": "E02071",
"full_name": "Luca Phan",
"job_title": "Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Asian",
"age": 39,
"hire_date": "2015-06-17",
"annual_salary": 129949,
"bonus": 9,
"country": "China",
"city": "Beijing",
"exit_date": null
},
{
"employee_id": "E02040",
"full_name": "Jeremiah Cheng",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 26,
"hire_date": "2022-02-05",
"annual_salary": 70946,
"bonus": 0,
"country": "China",
"city": "Shanghai",
"exit_date": null
},
{
"employee_id": "E02068",
"full_name": "Ethan Sanchez",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Research & Development",
"gender": "Male",
"ethnicity": "Latino",
"age": 34,
"hire_date": "2019-05-15",
"annual_salary": 81646,
"bonus": 0,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02070",
"full_name": "Elias Hsu",
"job_title": "Sr. Analyst",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Asian",
"age": 35,
"hire_date": "2022-01-23",
"annual_salary": 86777,
"bonus": 0,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02016",
"full_name": "Jacob Moore",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Male",
"ethnicity": "Black",
"age": 42,
"hire_date": "2021-03-24",
"annual_salary": 131422,
"bonus": 15,
"country": "United States",
"city": "Phoenix",
"exit_date": null
},
{
"employee_id": "E02089",
"full_name": "Nevaeh Jiang",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Asian",
"age": 45,
"hire_date": "2016-08-05",
"annual_salary": 143318,
"bonus": 12,
"country": "China",
"city": "Chengdu",
"exit_date": null
},
{
"employee_id": "E02030",
"full_name": "Peyton Wright",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Corporate",
"gender": "Female",
"ethnicity": "Black",
"age": 41,
"hire_date": "2017-05-13",
"annual_salary": 153370,
"bonus": 10,
"country": "United States",
"city": "Chicago",
"exit_date": null
},
{
"employee_id": "E02080",
"full_name": "Eli Richardson",
"job_title": "Sr. Manager",
"department": "Marketing",
"business_unit": "Specialty Products",
"gender": "Male",
"ethnicity": "Black",
"age": 31,
"hire_date": "2018-04-08",
"annual_salary": 159121,
"bonus": 14,
"country": "United States",
"city": "Phoenix",
"exit_date": null
}
],
"count": 17
}
Debugging
Not retrieving the records?
Try to the following debugging steps.
Updated 2 months ago