# Shifts
Shifts endpoint is a great way to know about the shifts of your employees, such as when they clocked in or out during the business day.
# The Shift Object
# Sample
{
"branch": {
"id": "8f7ab00a"
},
"user": {
"id": "8f7ab326"
},
"id": "8d9af3e6",
"business_date": "2019-04-18",
"clocked_in_at": "2019-04-18 08:43:22",
"clocked_out_at": "2019-04-18 04:51:14",
"created_at": "2019-05-04 10:42:44",
"updated_at": "2019-05-04 10:42:44"
}
# Attributes
| Field | Type | Rule | Description |
|---|---|---|---|
id | string | Unique identifier for the shift. | |
business_date* | string | The business date of the shift. | |
branch* | string | includable | The Branch object attached to the shift. |
user* | object | includable | The User object attached to the shift. |
clocked_in_at | string | Shift clock in time YYYY-MM-DD HH-MM-SS in UTC. | |
clocked_out_at | string | Shift clock out time YYYY-MM-DD HH-MM-SS in UTC | |
created_at | string | sortable | Time YYYY-MM-DD HH-MM-SS in UTC at which the object was created. |
updated_at | string | sortable | Time YYYY-MM-DD HH-MM-SS in UTC at which the object was updated. |
# List Shifts
GET /shifts
# Scope
operations.read
# Filterablles
user_idbranch_idbusiness_datecreated_onupdated_on
# Response
{
"data": [
{
"branch": {
"id": "8f7ab00a"
},
"user": {
"id": "8f7ab326"
},
"id": "8d9af3e6",
"business_date": "2019-04-18",
"clocked_in_at": "2019-04-18 08:43:22",
"clocked_out_at": "2019-04-18 04:51:14",
"created_at": "2019-05-04 10:42:44",
"updated_at": "2019-05-04 10:42:44"
}
]
}
# Get Shift
GET /shifts/{shiftId}
# Scope
operations.read
# Response
{
"data": {
"branch": {
"id": "8f7ab00a"
},
"user": {
"id": "8f7ab326"
},
"id": "8d9af3e6",
"business_date": "2019-04-18",
"clocked_in_at": "2019-04-18 08:43:22",
"clocked_out_at": "2019-04-18 04:51:14",
"created_at": "2019-05-04 10:42:44",
"updated_at": "2019-05-04 10:42:44"
}
}
# Create Shfit
POST /shifts
# Scope
operations.write
# Request
{
"business_date": "2019-04-18",
"user_id": "8d82ff0c",
"branch_id": "8d84b5d2",
"clocked_in_at": "2019-04-18 08:43:22",
"clocked_out_at": "2019-04-18 04:51:14"
}
# Response
{
"data": {
"branch": {
"id": "8f7ab00a"
},
"user": {
"id": "8f7ab326"
},
"id": "8d9af3e6",
"business_date": "2019-04-18",
"clocked_in_at": "2019-04-18 08:43:22",
"clocked_out_at": "2019-04-18 04:51:14",
"created_at": "2019-05-04 10:42:44",
"updated_at": "2019-05-04 10:42:44"
}
}