All auth endpoints return a JWT with the User object encoded within:
JWT Response Body
{
"refresh": "<REFRESH TOKEN>",
"access": "<ACCESS TOKEN>"
}Decoded User object
{
"email": "example@site.com",
"username": "Bob",
"email_verified": true,
"active_band_id": "5e54b079-4302-41e6-bc53-1cffb3a45545",
"active_tour_id": "7cbf34ac-d750-4973-93a7-012433ced43b",
}
Path
/auth/login
POST
Request Body:
{
"email": "example@site.com",
"password": "password1@"
}
Path
/auth/refresh
POST
Request Body:
{
"refresh": "<REFRESH TOKEN>"
}
Path
/auth/user
PATCH
Request Body:
{
"username": "Robert",
"active_band_id": "aa32f727-82ea-470f-882b-4649aee2a36d",
"active_tour_id": "aa32f727-82ea-470f-882b-4649aee2a36d",
}
Path
/auth/register
POST
Request Body:
{
"email": "bob@bob.com",
"password": "password1@",
"username": "Bobert"
}
Path
/auth/verify
POST
Request Body:
{
"verification_code": "592353"
}GET
Response Body:
{
"detail": "An email with a new verification code has been sent to dan.stoffels@gmail.com. "
}
Path
/auth/password
POST
Request Body:
{
"old_password": "PxwbSaef6Eh1",
"new_password": "Spades42!"
}
Path
/bands
Request Body
{
"name": "Bob's Band"
}Params
include
?include=tours
?include=dates
?include=all
tours returns the band resource with a nested array of its tours.
dates returns the band resource with a nested array of its tours, each with a nested array of their tour dates.
all returns the band resource with nested tours, dates and all nested date resources.
archived_tours
?archived_tours=true
past_dates
?past_dates=true
- params:
- archives: Set true to include archived bands
- GET -> [Band]
- GET -> Band
- PATCH -> Band
- body: {name|is_archived}
- DELETE
- POST -> Band
- body: {email, is_admin}
- PATCH -> Band
- body {is_admin}
- DELETE -> Band
TOURS Tour: { id, name, is_archived, tour_users: [TourUser] *dates: [Date] }
TourUser: { id, banduser: BandUser }
- params: (for all non-nested tour endpoints excl. /users)
- include: Options for nesting depth. No nesting by default.
- options: all, dates
- past-dates: Set true to include past dates.
- include: Options for nesting depth. No nesting by default.
- params:
- archived_tours: Set true to include archived tours
- POST -> [Tour]
- body: {name}
- GET -> [Tour]
- GET -> Tour
- PATCH -> Tour
- body: {name, is_archived}
- DELETE
- POST -> Tour
- body: {email, is_admin}
- DELETE -> Tour
DATES
Date: { id, date: YYYY-MM-DD, notes, is_show_day, is_confirmed, title, tour_id, place: Place *timeslots: [Timeslot] *prospects: [Prospect] *contacts: [DateContact] }
- params
- past-dates: Set true to include past dates.
- POST -> Tour
- body: {date}
- GET -> Date
- PATCH -> Date
- body: {date|notes|is_show_day|is_confirmed|title|place_id}
- DELETE
TIMESLOTS
Timeslot: { id, description, start_time: HH:MM:SS, starts_after_midnight: bool, origin: Place, end_time: HH:MM:SS, ends_after_midnight: bool, destination: Place, details, type_options: ['Event', 'Travel', 'Flight', 'Meeting'] type: (type_option - default: 'Event') }
- POST -> Date
- body: {description, start_time, starts_after_midnight|origin|end_time|ends_after_midnight|destination|details|type}
- PATCH -> Date
- body: {description|start_time|starts_after_midnight|origin|end_time|ends_after_midnight|destination|details|type}
- DELETE -> Date
PLACES Places are fetched directly from the Google Place API by place_id, formatted and stored in the database, when fetched for the first time.
Place: { id, name, formatted_address, political_address, lat, lng, }
- GET -> Place
- GET -> Google Places API predictions obj
- GET -> Google Directions API directions obj