Shift

Shifts are for volunteers. Shifts are accessed via /api/shift.

Properties

See "Object Properties" in Introduction for basic shared properties.

Complete details in ShiftProperties. It also has these extra read-only properties:

times_range

A description of the shift's time like "2:00 PM to 5:00 PM".

duration_in_hours

The duration of the shift in hours. Partial hours are included, e.g. "5.25", if the shift is 5 hours and 15 minutes long.

Related Objects

See "Related Objects" in Introduction for how to use them.

convention

The Convention this shift belongs to.

conventionday

The ConventionDay on which this shift is scheduled.

shifttype

The ShiftType on which the shift is based.

Relationships

See "Relationships" in Introduction for how to use them.

badgetypes

The list of BadgeTypes supporting the shift (via "shiftbadgetypes").

shiftbadgetypes

The list of ShiftBadgeTypes for this shift. These associate a shift with a badge type; these are not the associated Badge Types themselves. Note that these exist only when the shift's Convention has been set to require volunteers to have a badge for the same day that they wish to volunteer.

volunteers

The list of Volunteers who have applied for the shift (via "volunteershifts").

volunteershifts

The list of VolunteerShifts associated with the shift.

Queryable
volunteer.firstname

The firstname field in the VolunteerShift's related Volunteer record. You must include parameter _include_related_objects=volunteer with the request for this to work.

volunteer.lastname

The lastname field in the VolunteerShift's related Volunteer record. You must include parameter _include_related_objects=volunteer with the request for this to work.

Qualifiers
status
volunteer_id

Includes

See "Includes" in Introduction for how to use them.

has_scheduled_volunteers

Returns a "1" or a "0" (zero). "1" means the shift has scheduled volunteers, "0" means it has no scheduled volunteers.

room

Return the Room, if any, associated to the shift via its ShiftType.

scheduled_volunteers

Returns the list of volunteers who are scheduled for the shift.

unscheduled_volunteers_count

The count of VolunteerShifts associated with the shift with status "unscheduled" (pending volunteer applications).

Services

The services used to fetch and manipulate shifts.

Search Shifts

Searching across all conventions is not enabled. To search within a single convention's shifts, see "Relationships" in Convention.

Create Shift

 POST /api/shift
Required Params
session_id
name

The shift name must be unique within its Convention.

quantity_of_volunteers

This must be an integer.

start_time

The start_time must be within the time range of the shift's ConventionDay.

end_time

The end_time must be within the time range of the shift's ConventionDay, and must be after the start_time.

convention_id
conventionday_id

Returns the same as a normal read.

Read Shift

 GET /api/shift/xxx

Returns:

 {
   "id" : "xxx",
   "name" : "Sunday Morning Shift",
   ...
 }

Update Shift

 PUT /api/shift/xxx

Returns the same as a normal read.

Delete Shift

 DELETE /api/shift/xxx

You cannot delete a Shift which has a related VolunteerShift with status "scheduled".

Returns:

 {
   "success" : 1
 }

Add Shift Log Entry

 POST /api/shift/xxx/add-log-entry

Adds a text line to the shift's log. Requires the user to have volunteers privilege.

Required Params
shift_log_entry

Returns the same as a normal read.

Not-Applied Volunteers

 GET /api/shift/xxx/volunteers/not-applied

The list of convention volunteers who have not applied for the shift. This is a convenient way to identify volunteers who could work on the shift, if more are needed.

Optional Params
query

A search string. Searches in volunteer firstname, lastname, email_address, and phone_number.

Returns:

 {
    "paging" : {...},
    "items" : [
        {
          "id" : "xxx",
          "firstname" : "Joe",
          "lastname" : "Volunteer",
          ...
        },
        ...
    ]
 }

Copy Shift

 POST /api/shift/xxx/copy

This will create a copy of the shift. The only thing different about the new shift will be the name, which will be the name of the copied shift with "(copy [copy number])" appended.

Returns the copy in the same format as a normal read.