DBooks Backed Documentation 2: Accounts and Create Resource Endpoints
Repository
https://github.com/feekayo/dbooks-api
Details
This Documentation describes the Accounts & Create functions and routes of the Dbooks API.
Here, we're trying to provide prospective developers with information about communicating with our WebAPI and some of its functionality (create and accounts functions)
The accounts function endpoints include
- https://dbooks-api.herokuapp.com/login
- https://dbooks-api.herokuapp.com/logout/:session_id
- https://dbooks-api.herokuapp.com/update/pen_name/:session_id
While the create function endpoints include
- https://dbooks-api.herokuapp.com/create/book/:session_id
- https://dbooks-api.herokuapp.com/create/like/:session_id
- https://dbooks-api.herokuapp.com/create/vote/:session_id
- https://dbooks-api.herokuapp.com/create/chapter/:session_id
- https://dbooks-api.herokuapp.com/create/rental/:session_id
- https://dbooks-api.herokuapp.com/create/review/:session_id
Components
There are 4 major http request types used in this project. They include
- PUT:- For create requests
- POST:- For updates
- GET:- For reads
- DELETE:- For delete requests
These 4 http requests are used widely in the application.
THE ACCOUNTS FUNCTIONS
The Login Route
This route is used for logging into DBooks, after confirmation of steemconnect login
https://dbooks-api.herokuapp.com/login
This route requires a GET http request. A singular parameter is required
- steemit_username
The response expected here include
- response data log: holds server message to client
- response data success: holds operation success flags; these flags include
i. 0: Operation failed
ii. 1: Operation success - response.data.session_id: session id
- response data pen_name: pen name of session user
- response.data.user_id: user_id of session user
The Logout Route
Used for logging out of dbooks.org
https://dbooks-api.herokuapp.com/logout/:session_id
This route requires a singular POST http request. The parameter required is
1.user_id
The response gotten includes
- response.data.log: holds server message to client
- response.data.success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success - response.data.session_id: client session id
- response.data.pen_name: pen name of session user
- response.data.user_id: user_id of session user
The Update Pen name Route
This route is used for updating a user's pen name
https://dbooks-api.herokuapp.com/logout/:session_id
This route requires a POST http request. The parameters required include
- user_id
- pen_name
The response received contains
- response.data.log: holds server message to client
- response data success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success
iii. 2: Operation failed, session reset required
THE CREATE FUNCTIONS
The Create Book Endpoint
This endpoint is used for creating books on the backend.
https://dbooks-api.herokuapp.com/create/book/:session_id
The route requires a PUT http request. The parameters required include
- user_id:- The ID of the session user
- title:- The Book Title
- bucket:- The Amazon bucket where the book cover is saved
- object:- The object of book cover
- genre:- The Book Genres
- synopsis:- A short synopsis of the book
- language:- Language book was written in
The responses expected include
- response.data.log: holds server message to client
- response.data.success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success
iii. 2: Operation failed; but session reset required
The Create Favorite Endpoint
This endpoint is used for adding books to a user's favorites list
https://dbooks-api.herokuapp.com/create/like/:session_id
This route requires a PUT http request. The parameters required include
- book_id:- The ID of book
- user_id:- The ID of the session user
The responses expected include
- response.data.log: holds server message to client
- response.data.success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success
iii. 2: Operation failed; but session reset required
The Create Chapter Endpoint
This endpoint is used for adding Chapters to a book
https://dbooks-api.herokuapp.com/create/chapter/:session_id
This route requires a PUT http request. The parameters required include
- user_id:- The ID of session user
- book_id:- The ID of book
- chapter_number:- The chapter number of the book
- chapter_content:- The Content of the Chapter
- steemit_published:- true/false; depending on whether the chapter is to be pushed to the steem blockchain
- author: steemit username of book writer
- steemit_permlink:- permlink of chapter
The responses expected include
- response.data.log: holds server message to client
- response.data.success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success
iii. 2: Operation failed; but session reset required
The Create Vote Endpoint
This endpoint is used for keeping track of votes made on the application
https://dbooks-api.herokuapp.com/create/votes/:session_id
This route requires a PUT http request. The required parameters include
- permlink:- Steemit Chapter Permlink
- user_id:- The ID of session user
The responses expected include
- response.data.log: holds server message to client
- response.data.success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success
iii. 2: Operation failed; but session reset required
The Create Rental Endpoint
This endpoint is used for saving and tracking book rentals
https://dbooks-api.herokuapp.com/create/rental/:session_id
This route requires a PUT http request. The required parameters include
- steemit_user_name:- steemit user name of book writer
- claim_user_id:- The user id of the book writer
- user_id:- The session users user id
- book_id:- The book ID of book
- price:- Price of book
The responses expected include
- response.data.log: holds server message to client
- response data success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success
iii. 2: Operation failed; but session reset required
The Create Review Endpoint
This endpoint is used for creating a review/rating for a book
https://dbooks-api.herokuapp.com/create/review/:session_id
This route requires a PUT http request. These parameters include
- author:- steemit user name of book writer
- permlink:- review permlink
- user_id:- The session users user id
- book_id:- The book ID of book
- content- Review Content
- rating:- Rating
The responses expected include
- response.data.log: holds server message to client
- response.data.success: holds operation success flags
i. 0: Operation failed
ii. 1: Operation success
iii. 2: Operation failed; but session reset required
Differences.
Addition of new infornation about route endpoints for Accounts and Create functions
Documentation
Official Documentation hosted on:
https://github.com/feekayo/dbooks-api/wiki/Account-Functions
https://github.com/feekayo/dbooks-api/wiki/Create-Functions
@feekayo thanks friend information
I would say you to improve on your documentation using better markdown and utilizing tools for documentation like mkdocs, jsdocs or some other.
Please try to bring more quality in contributions.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Hey @feekayo
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!