Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

indietour api

   

Authentication

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",
}

 

Login

Path

/auth/login

POST

Request Body:

{
    "email": "example@site.com",
    "password": "password1@"
}

 

Refresh JWT

Path

/auth/refresh

POST

Request Body:

{
    "refresh": "<REFRESH TOKEN>"
}

 

Update User

Path

/auth/user

PATCH

Request Body:

{
    "username": "Robert",
    "active_band_id": "aa32f727-82ea-470f-882b-4649aee2a36d",
    "active_tour_id": "aa32f727-82ea-470f-882b-4649aee2a36d",
}   

 

Register New User

Path

/auth/register

POST

Request Body:

{
    "email": "bob@bob.com",
    "password": "password1@",
    "username": "Bobert"
}

 

Verify User Email

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. "
}

 

Change Password

Path

/auth/password

POST

Request Body:

{
    "old_password": "PxwbSaef6Eh1",
    "new_password": "Spades42!"
}

   

Band

Collection

Path

/bands

POST

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]

Resource

/bands/<band_id>

  • GET -> Band
  • PATCH -> Band
    • body: {name|is_archived}
  • DELETE

/bands/<band_id>/users

  • POST -> Band
    • body: {email, is_admin}

/bands/<band_id>/users/<banduser_id>

  • 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.

/bands/<band_id>/tours (filtered by band_id)

  • params:
    • archived_tours: Set true to include archived tours
  • POST -> [Tour]
    • body: {name}
  • GET -> [Tour]

/bands/<band_id>/tours/<tour_id>

  • GET -> Tour
  • PATCH -> Tour
    • body: {name, is_archived}
  • DELETE

/bands/<band_id>/tours/<tour_id>/users

  • POST -> Tour
    • body: {email, is_admin}

/bands/<band_id>/tours/<tour_id>/users/<touruser_id>

  • 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] }

/bands/<band_id>/tours/<tour_id>/dates (filtered by tour_id)

  • params
    • past-dates: Set true to include past dates.
  • POST -> Tour
    • body: {date}

/bands/<band_id>/tours/<tour_id>/dates/<date_id>

  • 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') }

/bands/<band_id>/tours/<tour_id>/dates/<date_id>/timeslots

  • POST -> Date
    • body: {description, start_time, starts_after_midnight|origin|end_time|ends_after_midnight|destination|details|type}

/bands/<band_id>/tours/<tour_id>/dates/<date_id>/timeslots/

  • 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, }

/places/

  • GET -> Place

/places/autocomplete (proxy)

  • GET -> Google Places API predictions obj

/places/directions (proxy)

  • GET -> Google Directions API directions obj

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages