Skip to content

Create better and more intuitive endpoints #5

@bryokim

Description

@bryokim

Current api uses query parameters over path parameters.
Create a new api version that uses both for more human readable urls and that are easier to use.

Tasks

  • Use path parameters for the book, chapter, and verse. (/api/v2/bible/book/chapter/verse)

/api/v2/bible/genesis/1/1

  • Provide bible_version and book_group as query parameters as is the current case. bible_version defaults to NIV and book_group defaults to Any.

/api/v2/bible/genesis/1/1-2?bible_version=NIV

  • Provide a boolean query parameter, strict, that toggles whether to strictly check if the book given is in the book_group specified. strict defaults to False if not given. If strict is False, then the book is used and the book_group ignored.

/api/v2/bible/random/genesis?book_group=Poetry&strict

  • The random verse will be mapped to the endpoint /api/v2/bible/random/book/chapter. It will accept book, chapter and verse path parameters and bible_version, book_group , strict and verse_range query parameters. The verse_range query parameter can be set to determine the number of verses to return. verse range defaults to 1.

/api/v2/bible/random
/api/v2/bible/random/genesis?verse_range=2

  • The daily verse will be mapped to the endpoint /api/v2/bible/today. Accepts the bible_version query parameter.

/api/v2/bible/today?bible_version=KJV

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions