Staff
-
Return all of the user's staff
GET /api/1/staff.jsonFormats
json jsonpReturns an array of staff objects belonging to authenticated user. The authenticated user is included in the results. Can take a URL-encoded, SQL-like query string and order string which can help filter and order the results that will be returned. So the query string:
active = "true"which lookes like this when URL encoded:
/api/1/staff.json?where=active%3D"true"&order=last_name+ascwill return all active staff ordered by last name in ascending order.
Click here for more information on the API query string.
Errors
- 401 Unauthorized
- 403 Forbidden - returned if an authenticated user isn't allowed to list staff members
Example
GET /api/1/staff 200 { "response": [ { "active": "true", "email_address": "19anita.pacocha@oreilly.info", "first_name": "Lola", "hourly_rate_cents": null, "last_name": "Kuphal", "login": "user19", "time_zone": "Australia/Perth", "uuid": "07f971d7-e6ae-437c-bdb5-12e45a12cb81", "type": "manager" }, { "active": "true", "email_address": "20angelita.brown@marquardt.com", "first_name": "Geovanni", "hourly_rate_cents": 10000, "last_name": "Pollich", "login": "user20", "time_zone": "Australia/Perth", "uuid": "a00ca7ce-20b6-4b2f-9153-46f6b8e5b6bc", "type": "staff" }, { "active": "true", "email_address": "21lisa_johnston@moriette.com", "first_name": "Keyon", "hourly_rate_cents": 7000, "last_name": "Okuneva", "login": "user21", "time_zone": "Australia/Perth", "uuid": "eea4f769-9581-4b8d-ae47-79a1cd0ca304", "type": "staff" }, { "active": "true", "email_address": "22keara@wuckert.info", "first_name": "Bettie", "hourly_rate_cents": 9500, "last_name": "Grady", "login": "user22", "time_zone": "Australia/Perth", "uuid": "262ae5f3-49ad-429e-85b0-2002ca3b6723", "type": "staff" } ], "count": 4 }Parameters
-
where
An SQL-like query string which can filter the results that will be returned
-
order
An SQL-like order string, that sets the order of the returned objects
-
Return a single staff member
GET /api/1/staff/:uuid.jsonFormats
json jsonpReturns a single staff member object belonging the authenticated user.
Errors
- 401 Unauthorized
- 403 Forbidden - returned if an authenticated user isn't allowed to view staff members
- 404 Record Not Found - returned if an staff member with the specified UUID is not found
Example
GET /api/1/staff/141621a3-1731-4133-be13-7a936ba7da6a 200 { "response": { "active": "true", "email_address": "24alayna_corwin@osinski.org", "first_name": "Kian", "hourly_rate_cents": 10000, "last_name": "Rath", "login": "user24", "time_zone": "Australia/Perth", "uuid": "141621a3-1731-4133-be13-7a936ba7da6a", "type": "staff" } } -
Create a new staff member
POST /api/1/staff.jsonFormats
json jsonpCreates a new staff member. Requires a valid user object to be posted.
Please Note: This may cause a charge for the user. If this is the case, they will receive an email asking them to confirm the creation of a new user
Errors
- 401 Unauthorized
- 402 Payment Required - if the authenticated user is on a plan with a maximum number of staff, and this user will take them over this limit, they will need to upgrade their plan.
- 403 Forbidden - returned if an authenticated user isn't allowed to create staff members
- 422 Invalid Record - if the staff member fails validation. An error message will be returned, declaring the error.
Example
POST /api/1/staff { "staff": { "active": "true", "email_address": "5jewel_kovacek@mertz.com", "first_name": "Sage", "hourly_rate_cents": null, "last_name": "Dicki", "login": "user5", "time_zone": "Australia/Perth", "type": "staff" } } 200 { "response": { "active": "true", "email_address": "5jewel_kovacek@mertz.com", "first_name": "Sage", "hourly_rate_cents": null, "last_name": "Dicki", "login": "user5", "time_zone": "Australia/Perth", "uuid": "694b9cd4-aa9a-47a1-b76c-1bca7c19a640", "type": "staff" } }Parameters
-
staff
A staff member JSON object.
-
uuid
A UUID to identify the user. If null, one will be generated
-
login
User’s login
-
first_name
User’s first name
-
last_name
User’s first name
-
email_address
User’s email address
-
time_zone
Time zone of the staff
-
active
Indicates whether the user is active or not. Note: This is a string.
-
type
Indicates the user type. When updating or creating, you can only set the type to ‘manager’ or ‘staff’.
-
hourly_rate_cents
The user’s hourly rate in cents
-
-
Update a staff member
PUT /api/1/staff/:uuid.jsonFormats
json jsonpUpdate an existing staff member. Requires a valid staff object to be posted. Missing attributes from the object will be merged with the existing staff member.
Please Note: If the updated user becomes active, this may cause a charge for the user. If this is the case, they will receive an email asking them to confirm the creation of a new user
Errors
- 401 Unauthorized
- 402 Payment Required - if the authenticated user is on a plan with a maximum number of staff, and this user will take them over this limit, they will need to upgrade their plan.
- 403 Forbidden - returned if an authenticated user isn't allowed to update staff members
- 404 Record Not Found - returned if an staff member with the specified UUID is not found
- 422 Invalid Record - if the staff member fails validation. An error message will be returned, declaring the error.
Example
PUT /api/1/staff/161e6c57-a86a-4ab8-b6c0-8a7831e4cd44 { "staff": { "active": "true", "email_address": "28christopher@towne.biz", "first_name": "Archibald", "hourly_rate_cents": 10000, "last_name": "Zulauf", "login": "user28", "time_zone": "Australia/Perth", "uuid": "161e6c57-a86a-4ab8-b6c0-8a7831e4cd44", "type": "staff" } } 200Parameters
-
staff
A staff member JSON object.
-
uuid
A UUID to identify the user. If null, one will be generated
-
login
User’s login
-
first_name
User’s first name
-
last_name
User’s first name
-
email_address
User’s email address
-
time_zone
Time zone of the staff
-
active
Indicates whether the user is active or not. Note: This is a string.
-
type
Indicates the user type. When updating or creating, you can only set the type to ‘manager’ or ‘staff’.
-
hourly_rate_cents
The user’s hourly rate in cents
-
-
Delete a staff member
DELETE /api/1/staff/:uuid.jsonFormats
json jsonpDeletes the staff member associated with the supplied uuid
Errors
- 401 Unauthorized
- 403 Forbidden - returned if an authenticated user isn't allowed to delete staff members
- 404 Record Not Found - returned if an staff member with the specified UUID is not found
Example
DELETE /api/1/staff/c7a4dc35-4501-44a0-9a71-b94c6a5dd9a0 200
-
Enable a staff member
POST /api/1/staff/:uuid/enable.jsonFormats
json jsonpEnables the staff member.
Please Note: If the updated user becomes active, this may cause a charge for the user. If this is the case, they will receive an email asking them to confirm the creation of a new user
Errors
- 401 Unauthorized
- 402 Payment Required - if the authenticated user is on a plan with a maximum number of staff, and this user will take them over this limit, they will need to upgrade their plan.
- 403 Forbidden - returned if an authenticated user isn't allowed to update staff members
- 404 Record Not Found - returned if an staff member with the specified UUID is not found
Example
POST /api/1/staff/b8833788-448c-4292-90c3-05e496479412/enable {} 200 -
Disable a staff member
POST /api/1/staff/:uuid/disable.jsonFormats
json jsonpDisables the staff member.
Errors
- 401 Unauthorized
- 403 Forbidden - returned if an authenticated user isn't allowed to update staff members
- 404 Record Not Found - returned if an staff member with the specified UUID is not found
Example
POST /api/1/staff/a0cfe730-11a8-4dc5-8c34-e4a9beb42585/disable {} 200