Tuber API

Endpoints

Hotels

GET /api/hotels

Retrieve a list of hotels.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/hotels

Example Response

[{
    "id": 1,
    "name": "The Gaylord",
    "description": "An awesome venue in Maryland!"
}]
Query Parameters
  • full (string) – If true returns a list of objects. If false, returns a list of id numbers.

Shifts

GET /api/events/<id>/jobs/available

Retrieve the list of shifts that are available to either the current user or a specific badge.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/events/<id>/jobs/available

Example Response

[
    {
        "job": {
            "id": 1,
            "name": "Do the thing",
            "description": "",
            "department": null,
            "documentation": "",
            "method": {},
            "signuprules": {},
            "sticky": false,
            "schedules": [],
            "scheduleevents": [],
            "roles": [],
            "shifts": [1]
        },
        "shifts": [
            {
                "blocks": [
                    "Shift is full."
                ],
                "id": 1,
                "job": 1,
                "schedule": null,
                "schedule_event": null,
                "starttime": "2020-05-22T21:15:52.159726",
                "duration": 3600.0,
                "slots": 4,
                "filledslots": 0,
                "weighting": 1.0
            }
        ]
    }
]
Query Parameters
  • badge (string) – If provided then the result will be the shifts available to the given badge.

POST /api/events/<id>/shifts/<id>/signup

Sign up for the given shift. If you want to sign up a different badge then the post body should be an object with key badge set the the desired badge id.

Example Request

$ curl -H "X-Auth-Token: <Token>" --header 'Content-Type: application/json' -X POST --data '{"badge": 4}' https://tuber.magfest.org/api/events/<id>/shifts/<id>/signup

Example Response

{
    "shift": {
        "id": 1,
        "job": 1,
        "schedule": null,
        "schedule_event": null,
        "starttime": "2020-05-22T21:15:52.159726",
        "duration": 3600.0,
        "slots": 4,
        "filledslots": 0,
        "weighting": 1.0
    },
    "shift_signup": {
        "id": 1,
        "badge": 1,
        "job": 1,
        "shift": 1,
        "schedule": null,
        "scheduleevent": null,
        "starttime": "2020-05-22T21:15:52.159726",
        "duration": 3600.0
    },
    "shift_assignment": {
        "id": 1,
        "badge": 1,
        "shift": 1,
        "signuptime": "2020-05-22T21:15:52.159726"
    }
}
POST /api/events/<id>/jobs/<id>/dryrun

This endpoint lets you check what the resulting shifts based on a hypothetical job definition. Calling this endpoint will not commit anything to the database, but will let you see what would have resulted from a PATCH to the corresponding job.

Example Request

$ curl -H "X-Auth-Token: <Token>" --header 'Content-Type: application/json' -X POST --data '{"method": {"name": "copy"}}' https://tuber.magfest.org/api/events/<id>/jobs/<id>/dryrun

Example Response

[{
    "id": 1,
    "job": 1,
    "schedule": null,
    "schedule_event": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "slots": 4,
    "filledslots": 0,
    "weighting": 1.0
}]

Schedule Events

GET /api/scheduleevents

Retrieve a list of scheduleevents.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/scheduleevents

Example Response

[{
    "id": 1,
    "name": "Someone's panel",
    "description": "",
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "schedule": 1
}]
Query Parameters
  • full (string) – If true returns a list of objects. If false, returns a list of id numbers.

GET /api/scheduleevents/<id>

Retrieve a single scheduleevent.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/scheduleevents/1

Example Response

{
    "id": 1,
    "name": "Someone's panel",
    "description": "",
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "schedule": 1
}
POST /api/scheduleevents

Create a new scheduleevent object.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X POST --header "Content-Type: application/json" --data '{"name": "Someone's panel"}' https://tuber.magfest.org/api/scheduleevents

Example Response

{
    "id": 1,
    "name": "Someone's panel",
    "description": "",
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "schedule": 1
}
PATCH /api/scheduleevents/<id>

Update a scheduleevent.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X PATCH --header "Content-Type: application/json" --data '{"description": "Really Cool"}' https://tuber.magfest.org/api/scheduleevents/<id>

Example Response

{
    "id": 1,
    "name": "Someone's panel",
    "description": "Really Cool",
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "schedule": 1
}
DELETE /api/scheduleevents/<id>

Delete a scheduleevent.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X DELETE https://tuber.magfest.org/api/scheduleevents/1

Example Response

{
    "id": 1,
    "name": "Someone's panel",
    "description": "",
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "schedule": 1
}

Jobs

GET /api/events/1/jobs

Retrieve a list of jobs.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/events/1/jobs

Example Response

[{
    "id": 1,
    "name": "Do the thing",
    "description": "",
    "department": null,
    "documentation": "",
    "method": {},
    "signuprules": {},
    "sticky": false,
    "schedules": [],
    "scheduleevents": [],
    "roles": [],
    "shifts": []
}]
Query Parameters
  • full (string) – If true returns a list of objects. If false, returns a list of id numbers.

GET /api/events/1/jobs/<id>

Retrieve a single job.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/events/1/jobs/1

Example Response

{
    "id": 1,
    "name": "Do the thing",
    "description": "",
    "department": null,
    "documentation": "",
    "method": {},
    "signuprules": {},
    "sticky": false,
    "schedules": [],
    "scheduleevents": [],
    "roles": [],
    "shifts": []
}
POST /api/events/1/jobs

Create a new job object.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X POST --header "Content-Type: application/json" --data '{"name": "Do the thing"}' https://tuber.magfest.org/api/events/1/jobs

Example Response

{
    "id": 1,
    "name": "Do the thing",
    "description": "",
    "department": null,
    "documentation": "",
    "method": {},
    "signuprules": {},
    "sticky": false,
    "schedules": [],
    "scheduleevents": [],
    "roles": [],
    "shifts": []
}
PATCH /api/events/1/jobs/<id>

Update a job.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X PATCH --header "Content-Type: application/json" --data '{"description": "Really Cool"}' https://tuber.magfest.org/api/events/1/jobs/<id>

Example Response

{
    "id": 1,
    "name": "Do the thing",
    "description": "Really Cool",
    "department": null,
    "documentation": "",
    "method": {},
    "signuprules": {},
    "sticky": false,
    "schedules": [],
    "scheduleevents": [],
    "roles": [],
    "shifts": []
}
DELETE /api/events/1/jobs/<id>

Delete a job.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X DELETE https://tuber.magfest.org/api/events/1/jobs/1

Example Response

{
    "id": 1,
    "name": "Do the thing",
    "description": "",
    "department": null,
    "documentation": "",
    "method": {},
    "signuprules": {},
    "sticky": false,
    "schedules": [],
    "scheduleevents": [],
    "roles": [],
    "shifts": []
}

Shifts

GET /api/shifts

Retrieve a list of shifts.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/shifts

Example Response

[{
    "id": 1,
    "job": 1,
    "schedule": null,
    "schedule_event": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "slots": 4,
    "filledslots": 0,
    "weighting": 1.0
}]
Query Parameters
  • full (string) – If true returns a list of objects. If false, returns a list of id numbers.

GET /api/shifts/<id>

Retrieve a single shift.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/shifts/1

Example Response

{
    "id": 1,
    "job": 1,
    "schedule": null,
    "schedule_event": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "slots": 4,
    "filledslots": 0,
    "weighting": 1.0
}
POST /api/shifts

Create a new shift object.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X POST --header "Content-Type: application/json" --data '{"job": 1, "schedule": 2, "slots": 4}' https://tuber.magfest.org/api/shifts

Example Response

{
    "id": 1,
    "job": 1,
    "schedule": 2,
    "schedule_event": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0,
    "slots": 4,
    "filledslots": 0,
    "weighting": 1.0
}
PATCH /api/shifts/<id>

Update a shift.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X PATCH --header "Content-Type: application/json" --data '{"duration": 7200.0}' https://tuber.magfest.org/api/shifts/<id>

Example Response

{
    "id": 1,
    "job": 1,
    "schedule": 2,
    "schedule_event": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 7200.0,
    "slots": 4,
    "filledslots": 0,
    "weighting": 1.0
}
DELETE /api/shifts/<id>

Delete a shift.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X DELETE https://tuber.magfest.org/api/shifts/1

Example Response

{
    "id": 1,
    "job": 1,
    "schedule": 2,
    "schedule_event": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 7200.0,
    "slots": 4,
    "filledslots": 0,
    "weighting": 1.0
}

Shift Assignments

GET /api/shiftassignments

Retrieve a list of shiftassignments.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/shiftassignments

Example Response

[{
    "id": 1,
    "badge": 1,
    "shift": 1,
    "signuptime": "2020-05-22T21:15:52.159726"
}]
Query Parameters
  • full (string) – If true returns a list of objects. If false, returns a list of id numbers.

GET /api/shiftassignments/<id>

Retrieve a single shiftassignment.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/shiftassignments/1

Example Response

{
    "id": 1,
    "badge": 1,
    "shift": 1,
    "signuptime": "2020-05-22T21:15:52.159726"
}
POST /api/shiftassignments

Create a new shiftassignment object.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X POST --header "Content-Type: application/json" --data '{"badge": 1, "shift": 1}' https://tuber.magfest.org/api/shiftassignments

Example Response

{
    "id": 1,
    "badge": 1,
    "shift": 1,
    "signuptime": "2020-05-22T21:15:52.159726"
}
DELETE /api/shiftassignments/<id>

Delete a shiftassignment.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X DELETE https://tuber.magfest.org/api/shiftassignments/1

Example Response

{
    "id": 1,
    "badge": 1,
    "shift": 1,
    "signuptime": "2020-05-22T21:15:52.159726"
}

Shift Signups

GET /api/shiftsignups

Retrieve a list of shiftsignups.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/shiftsignups

Example Response

[{
    "id": 1,
    "badge": 1,
    "job": 1,
    "shift": 1,
    "schedule": null,
    "scheduleevent": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0
}]
Query Parameters
  • full (string) – If true returns a list of objects. If false, returns a list of id numbers.

GET /api/shiftsignups/<id>

Retrieve a single shiftsignup.

Example Request

$ curl -H "X-Auth-Token: <Token>" https://tuber.magfest.org/api/shiftsignups/1

Example Response

{
    "id": 1,
    "badge": 1,
    "job": 1,
    "shift": 1,
    "schedule": null,
    "scheduleevent": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0
}
POST /api/shiftsignups

Create a new shiftsignup object.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X POST --header "Content-Type: application/json" --data '{"shift": 2}' https://tuber.magfest.org/api/shiftsignups

Example Response

{
    "id": 1,
    "badge": 1,
    "job": 1,
    "shift": 2,
    "schedule": null,
    "scheduleevent": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0
}
PATCH /api/shiftsignups/<id>

Update a shiftsignup.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X PATCH --header "Content-Type: application/json" --data '{"shift": 1}' https://tuber.magfest.org/api/shiftsignups/<id>

Example Response

{
    "id": 1,
    "badge": 1,
    "job": 1,
    "shift": 1,
    "schedule": null,
    "scheduleevent": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0
}
DELETE /api/shiftsignups/<id>

Delete a shiftsignup.

Example Request

$ curl -H "X-Auth-Token: <Token>" -X DELETE https://tuber.magfest.org/api/shiftsignups/1

Example Response

{
    "id": 1,
    "badge": 1,
    "job": 1,
    "shift": 1,
    "schedule": null,
    "scheduleevent": null,
    "starttime": "2020-05-22T21:15:52.159726",
    "duration": 3600.0
}

Resources

Hotels

Emails

Badges

Events

Users

shifts

tuber.api.shifts.reschedule_job(job, schedule_event=None)

Regenerates the shifts associated with this job. If a schedule_event is passed then it will only regenerate overlapping shifts.