Planning
Set the work profile of an employee
/v1/planning/team/{employee_id}/work-profileReplaces the weekly hours and the creators of an employee. From today, their profile shifts follow: the old ones stop tonight, one weekly series per hours and creator starts today. Shifts set by hand do not move. The planning never gives access to a creator. Confirm with the user first.
write:planningcurl -X PUT 'https://api.fansquare.so/v1/planning/team/9926b1f9-74a9-4ab5-a716-1c14f6bcc475/work-profile' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"slots": [
{
"named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
"start_time": "string",
"end_time": "string",
"week_days": [
"MO"
]
}
],
"creator_ids": [
"m81IhLxdhzDGYs54rNp2"
]
}'{
"slots": [
{
"named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
"start_time": "string",
"end_time": "string",
"week_days": [
"MO"
]
}
],
"creator_ids": [
"m81IhLxdhzDGYs54rNp2"
]
}Parameters
Headers
Fansquare-VersionstringrequiredAPI version to pin. Accepts the mineral name or the release date of a version.
Path
employee_idstringrequiredFansquare user id.
min length 1max length 128
Body
application/json
slotsarray of objectsrequiredThe whole weekly profile (it replaces the current one). Empty: no hours any more.
max items 12named_shift_idstringA named shift.
format uuidstart_timestringWithout named_shift_id: start, HH:mm (agency time).
pattern ^([01]\d|2[0-3]):[0-5]\d$end_timestringWithout named_shift_id: end, HH:mm (agency time).
pattern ^([01]\d|2[0-3]):[0-5]\d$week_daysarray of stringsrequiredDays of these hours.
ValuesMOTUWETHFRSASUmin items 1max items 7
creator_idsarray of stringsrequiredThe creators of the profile, all of them.
min length 1max items 100
Response
OK, application/json
slotsarray of objectsrequiredThe saved hours.
named_shift_idstring | nullrequiredA named shift, or null for hours given directly.
start_timestringrequiredStart, HH:mm.
end_timestringrequiredEnd, HH:mm.
week_daysarray of stringsrequiredDays of these hours: MO, TU, WE, TH, FR, SA, SU.
creator_idsarray of stringsrequiredThe saved creators.
curl -X PUT 'https://api.fansquare.so/v1/planning/team/9926b1f9-74a9-4ab5-a716-1c14f6bcc475/work-profile' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"slots": [
{
"named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
"start_time": "string",
"end_time": "string",
"week_days": [
"MO"
]
}
],
"creator_ids": [
"m81IhLxdhzDGYs54rNp2"
]
}'{
"slots": [
{
"named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
"start_time": "string",
"end_time": "string",
"week_days": [
"MO"
]
}
],
"creator_ids": [
"m81IhLxdhzDGYs54rNp2"
]
}