When I Work
App · 20 actions
Read employees, schedules, shifts, time entries and time off; manage positions and schedules.
Actions
| Action | What it does |
|---|---|
| Create position | Create Position. |
| Create schedule | Create Schedule (Location). |
| Delete position | Delete Position. |
| Delete schedule | Delete Schedule (Location). |
| Get position | Get Position. |
| Get profile | Get User Profile. |
| Get schedule | Get Schedule (Location). |
| Get shift | Get Shift. |
| Get site | Get Site. |
| Get time entry | Get Time. |
| Get time off request | Get Time Off Request. |
| Get user | Get User. |
| List positions | List Positions. |
| List schedules | List Schedules (Locations). |
| List shifts | List Shifts. |
| List sites | List Sites. |
| List time entries | List Times. |
| List time off requests | List Time Off Requests. |
| List users | List Users. |
| Update position | Update Position. |
Create position
Create Position.
Inputs
- Name
nametextRequired - Name.
- Color
colortext - Color.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"position": {
"account_id": 1,
"color": "example",
"created_at": "example",
"id": 1,
"name": "example",
"sort": 1,
"tips_tracking": false,
"updated_at": "example"
}
}
}Create schedule
Create Schedule (Location).
Inputs
- Name
nametextRequired - Name.
- Address
addresstext - Address.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"location": {
"account_id": 1,
"address": "example",
"coordinates": [],
"created_at": "example",
"deleted_at": "example",
"id": 1,
"ip_address": "example",
"is_default": false,
"is_deleted": false,
"latitude": 1.0,
"longitude": 1.0,
"max_hours": 1,
"name": "example",
"place": {
"address": "example",
"business_name": "example",
"country": "example",
"id": 1,
"latitude": 1.0,
"locality": "example",
"longitude": 1.0,
"place_id": "example",
"place_type": [],
"postal_code": "example",
"region": "example",
"street_name": "example",
"street_number": "example",
"sub_locality": "example",
"updated_at": "example"
},
"place_confirmed": false,
"place_id": "example",
"radius": 1,
"sort": 1,
"updated_at": "example"
}
}
}Delete position
Delete Position.
Inputs
- Id
idtextRequired - The ID of the position
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"success": false
}
}Delete schedule
Delete Schedule (Location).
Inputs
- Id
idtextRequired - The ID of the schedule
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"success": false
}
}Get position
Get Position.
Inputs
- Id
idtextRequired - The ID of the position
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"position": {
"account_id": 1,
"color": "example",
"created_at": "example",
"id": 1,
"name": "example",
"sort": 1,
"tips_tracking": false,
"updated_at": "example"
}
}
}Get profile
Get User Profile.
Inputs
None.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"user": {
"account_id": 1,
"activated": false,
"created_at": "example",
"email": "example",
"employee_code": "example",
"employment_type": "hourly",
"first_name": "example",
"hourly_rate": 1.0,
"hours_max": 1.0,
"id": 1,
"is_deleted": false,
"is_hidden": false,
"is_payroll": false,
"is_private": false,
"is_trusted": false,
"last_login": "example",
"last_name": "example",
"locations": [],
"login_id": 1,
"middle_name": "example",
"notes": "example",
"phone_number": "example",
"position_rates": {},
"positions": [],
"role": 1,
"start_date": "example",
"type": 1,
"updated_at": "example"
}
}
}Get schedule
Get Schedule (Location).
Inputs
- Id
idtextRequired - The ID of the schedule
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"location": {
"account_id": 1,
"address": "example",
"coordinates": [],
"created_at": "example",
"deleted_at": "example",
"id": 1,
"ip_address": "example",
"is_default": false,
"is_deleted": false,
"latitude": 1.0,
"longitude": 1.0,
"max_hours": 1,
"name": "example",
"place": {
"address": "example",
"business_name": "example",
"country": "example",
"id": 1,
"latitude": 1.0,
"locality": "example",
"longitude": 1.0,
"place_id": "example",
"place_type": [],
"postal_code": "example",
"region": "example",
"street_name": "example",
"street_number": "example",
"sub_locality": "example",
"updated_at": "example"
},
"place_confirmed": false,
"place_id": "example",
"radius": 1,
"sort": 1,
"updated_at": "example"
}
}
}Get shift
Get Shift.
Inputs
- Id
idtextRequired - The ID of the shift
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"repeating_shifts": [],
"shift": {
"account_id": 1,
"acknowledged": false,
"acknowledged_at": "example",
"alerted": false,
"break_time": 1.0,
"breaks": [],
"color": "example",
"created_at": "example",
"creator_id": 1,
"end_time": "example",
"id": 1,
"instances": 1,
"is_approved_without_time": false,
"is_open": false,
"is_shared": false,
"is_trimmed": false,
"linked_users": [],
"location_id": 1,
"notes": "example",
"notified_at": "example",
"openshift_approval_request_id": 1,
"position_id": 1,
"published": false,
"published_date": "example",
"requires_openshift_approval": false,
"shiftchain_key": "example",
"site_id": 1,
"start_time": "example",
"updated_at": "example",
"user_id": 1
},
"shiftchains": []
}
}Get site
Get Site.
Inputs
- Id
idtextRequired - The ID of the site
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"site": {
"account_id": 1,
"address": "example",
"color": "example",
"coordinates": [],
"created_at": "example",
"deleted_at": "example",
"description": "example",
"id": 1,
"is_deleted": false,
"latitude": 1.0,
"location_id": 1,
"longitude": 1.0,
"name": "example",
"place": {
"address": "example",
"business_name": "example",
"country": "example",
"id": 1,
"latitude": 1.0,
"locality": "example",
"longitude": 1.0,
"place_id": "example",
"place_type": [],
"postal_code": "example",
"region": "example",
"street_name": "example",
"street_number": "example",
"sub_locality": "example",
"updated_at": "example"
},
"place_id": "example",
"updated_at": "example"
}
}
}Get time entry
Get Time.
Inputs
- Id
idtextRequired - The ID of the time
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"time": {
"account_id": 1,
"alert_type": 1,
"cash_tips": "example",
"created_at": "example",
"creator_id": 1,
"end_time": "example",
"hourly_rate": 1.0,
"id": 1,
"is_alerted": false,
"is_approved": false,
"length": 1.0,
"location_id": 1,
"modified_by": 1,
"notes": "example",
"paid_break_note": "example",
"position_id": 1,
"rounded_end_time": "example",
"rounded_length": 1.0,
"rounded_start_time": "example",
"shift_id": 1,
"site_id": 1,
"split_time": "example",
"start_time": "example",
"sync_hash": "example",
"sync_id": "example",
"updated_at": "example",
"user_id": 1
}
}
}Get time off request
Get Time Off Request.
Inputs
- Request ID
request_idtextRequired - Request ID to return.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"messages": [],
"request": {
"account_id": 1,
"can_edit": false,
"created_at": "example",
"creator_id": 1,
"end_time": "example",
"hours": 1.0,
"id": 1,
"paid": false,
"start_time": "example",
"status": 0,
"type": 1,
"type_id": 1,
"type_label": "example",
"updated_at": "example",
"user_id": 1,
"user_status": 0
},
"users": []
}
}Get user
Get User.
Inputs
- Id
idtextRequired - The ID of the user
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"user": {
"account_id": 1,
"activated": false,
"created_at": "example",
"email": "example",
"employee_code": "example",
"employment_type": "hourly",
"first_name": "example",
"hourly_rate": 1.0,
"hours_max": 1.0,
"id": 1,
"is_deleted": false,
"is_hidden": false,
"is_payroll": false,
"is_private": false,
"is_trusted": false,
"last_login": "example",
"last_name": "example",
"locations": [],
"login_id": 1,
"middle_name": "example",
"notes": "example",
"phone_number": "example",
"position_rates": {},
"positions": [],
"role": 1,
"start_date": "example",
"type": 1,
"updated_at": "example"
}
}
}List positions
List Positions.
Inputs
- Show deleted
show_deletedtrue/false - Whether to show positions that have been deleted
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"positions": []
}
}List schedules
List Schedules (Locations).
Inputs
- Only unconfirmed
only_unconfirmedtrue/false - Include only unconfirmed schedules/locations
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"locations": []
}
}List shifts
List Shifts.
Inputs
- Employee
employee_idtext - The user id to filter by
- Start
startdate and time - The start of the filter range.
- End
enddate and time - The end of the filter range.
- Location
location_idlist - Schedules to include.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"repeating_shifts": [],
"shiftchains": [],
"shifts": []
}
}List sites
List Sites.
Inputs
- Include deleted
include_deletedtrue/false - Include deleted sites
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"sites": []
}
}List time entries
List Times.
Inputs
- Start
startdate and time - The start of the filter range.
- End
enddate and time - The end of the filter range.
- Employee
employee_idlist - Employees to include.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"times": []
}
}List time off requests
List Time Off Requests.
Inputs
- End
enddateRequired - yyyy-mm-dd formatted end date for the request time-frame.
- Include deleted users
include_deleted_userstrue/false - Return all requests including those made by deleted users.
- Limit
limitnumber - Number of requests to load per page.From 1 to 200.
- Location
location_idtext - Location ID to show requests for.
- Max ID
max_idtext - Return all requests created before the request with the given ID.
- Page
pagenumber - Page of results to load.At least 0.
- Since ID
since_idtext - Return all requests created since the request with given ID.
- Sortby
sortbytext - Field to sort by. Can either be 'created' and sort by the created_at date in descending order, or anything else and sort by status in ascending order, then by the updated_at date in descending order.One of:
created,status. - Start
startdateRequired - yyyy-mm-dd formatted start date for the request time-frame.
- Status
statusnumber - Only return requests with the given status.One of:
0(Pending),1(Canceled),2(Accepted),3(Expired). - Type
typenumber - Type of request to filter by.One of:
0(Unpaid time off),1(Paid time off),2(Sick),3(Holiday). - Employee
employee_idlist - Employees to include.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"messages": [],
"more": false,
"page": 1,
"requests": [],
"total": 1,
"users": []
}
}List users
List Users.
Inputs
- Location
location_idlist - Location ID.
- Show pending
show_pendingtrue/false - Include pending users in results. Defaults to true.
- Only pending
only_pendingtrue/false - Include ONLY pending users in results. Defaults to false.
- Show deleted
show_deletedtrue/false - Include deleted users in results. Defaults to false. Requires administrator, manager, or supervisor access (enforced via can_supervise()); otherwise the request returns 403.
- Only deleted
only_deletedtrue/false - Only include deleted/archived users in results. Defaults to false. Requires administrator, manager, or supervisor access (enforced via can_supervise()); otherwise the request returns 403.
- Search
searchtext - Optional string to search by in users first name, last name, or email.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"users": []
}
}Update position
Update Position.
Inputs
- Id
idtextRequired - The ID of the position
- Name
nametext - Name.
- Color
colortext - Color.
Outputs
dataobject- When I Work response data.
Example output
{
"data": {
"position": {
"account_id": 1,
"color": "example",
"created_at": "example",
"id": 1,
"name": "example",
"sort": 1,
"tips_tracking": false,
"updated_at": "example"
}
}
}