An Express + Node.js API for Training Bot
TODO: Write background section
This project has an app.json
file, which allows us to offer "one-click deployment" to Heroku. This will allow you to get your own version of Training Bot up and running both quickly and painlessly.
NOTE: Before clicking the button below you'll want to make sure you've completed the prerequisite setup steps in the complete documentation.
Most routes require authentication, and Training Bot handles authentication by looking for a valid JWT's on the Authorization
header of a given request.
Valid JWTs are provided by the Auth0 integration with our React application. However -- for testing -- You can get a token programattically using the Auth0 Management API.
Heroku base URL https://trainingbot-3.herokuapp.com/
route | methods | description | Docs |
---|---|---|---|
api/auth/ |
POST | Takes a valid JWT provided by Auth0 and logs the user in | JS Docs |
route | methods | description | Docs |
---|---|---|---|
api/users/:id |
DELETE | Deletes a specific user based on the ID parameter | JS Doc |
route | methods | description | Docs |
---|---|---|---|
api/team-members/ |
GET, POST | Get all Team Members associated with an authenticated User and/or Create a new Team Member associated with an authenticated User | JS Doc |
api/team-members/:id |
GET, PUT, DELETE | Read, Update, and Delete specific Team Members | JS Doc |
api/team-members/:id/unassign/:ts_id |
DELETE | Unassign a specified Team Member from a Training Series | JS Doc |
route | methods | description | Docs |
---|---|---|---|
api/training-series/ |
GET, POST | Get all the training series associated with an authenticated User and/or Create a new training series associated with an authenticated User | JS Doc |
api/training-series/:id |
GET, POST, DELETE | Read, Update, and Delete specific training series | JS Doc |
api/training-series/:id/messages |
GET | Get all the messages for a specific training series | JS Doc |
api/training-series/:id/assignees |
GET | Get the team members for the specific training series | JS Doc |
route | methods | description | Docs |
---|---|---|---|
api/messages/ |
GET, POST | Get all Messages associated with an authenticated User and/or Create a new Message associated with an authenticated User | JS Doc |
api/messages/:id |
GET, PUT, DELETE | Read, Update, and Delete specific Messages | JS Doc |
route | methods | description | Docs |
---|---|---|---|
api/stripe/ |
POST | allows user to update/change their stripe plan. | JS Doc |
api/stripe/register |
POST | register the user with stripe's API to get a stripe ID | JS Doc |
api/stripe/unsubscribe |
POST | allows user to unsubscribe from their current plan. | JS Doc |
api/stripe/plans |
GET | allows user to see available plans (basic, premium, pro) | JS Doc |
api/stripe/subscriptions |
GET | Allows the user to access the three subscription that go with the three plans | JS Doc |
api/stripe/customer/plan |
GET | Shows the user what their current plan is | JS Doc |
api/stripe/paymentintent |
POST | required by the stripe API to be able to collect credit card payments. | JS Doc |
route | methods | description | Docs |
---|---|---|---|
api/slack/oauth |
POST | Creates authenticated Slack Token in the database after oauth validation | JS Doc |
api/slack/ |
GET | Get all Slack users from the authenticated Slack workspace | JS Doc |
api/slack/:id/history |
GET | Get all messages in specific DM chat history with specified Team Member | JS Doc |
api/slack/sendMessageNow |
POST | Bypass Notification timer and immediately send specified Team Member a Slack Message, for testing purposes only | JS Doc |
route | methods | description | Docs |
---|---|---|---|
api/notifications/ |
GET, POST | Get all Notifications associated with an authenticated User and/or Create a new Notification associated with an authenticated User | JS Doc |
api/notifications/:id |
GET | Get specific Notifications | JS Doc |
api/notifications/:id/response |
GET | Get all Responses associated with an authenticated User for specific Notification | JS Doc |
api/notifications/:id/delete |
DELETE | Delete specific Notifications | JS Doc |
route | methods | description | Docs |
---|---|---|---|
api/responses |
GET | Get all Responses for authenticated User | JS Doc |
api/responses/:id |
GET, DELETE | Get or delete specific Response | JS Doc |
api/responses/email |
POST | Create a new email Response | JS Doc |
api/responses/sms |
POST | Create a new text Response | JS Doc |
api/responses/slack |
POST | Create a new Slack Response | JS Doc |
@dsnair | @tfolbrecht | @chandlerben | @JoeBugajski |
MIT © 2019 Training Bot