Technologies Getting Started API Endpoints
ThriveWell API provides the tools needed to track daily changes in chronic health conditions and to establish patterns for those symptoms. Doctors and patients can use the daily journal and symptom logs to track symptoms and their severity every day as well as the potential environmental and physiological triggers for those symptoms.
Overtime, patients and care providers can see which triggers and most likely linked to symptom flair ups and tailor health management plans around those triggers.
This documentation provides detailed information on all API endpoints and request / response formats. To make things easier, examples of request and response has been provided.
- C#
- EF Core
- .NET
- pgAdmin
- Visual Studio
- Swagger
- Postman
To get started with the Cocktail Club API, follow these steps: Set Up Postman:
-
Download and install Postman Import the ThriveWell Postman collection into Postman by using the Import button and selecting the provided JSON file
-
Next, fork this repository and clone it to your local machine. Note: This repository uses EF Core and PgAdmin. After that, you'll need to run the following commands inside you project terminal in Visual studio:
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 6.0
dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0
dotnet user-secrets init
dotnet user-secrets set "ThriveWellDbConnectionString" "Host=localhost;Port=5432;Username=postgres;Password=<your_postgresql_password>;Database=ThriveWell"
dotnet ef database update
-
Run the solution in Visual Studio to launch Swagger and copy your localhost URI to use in Postman.
-
Configure Environment Variables: Set the url variable to the base URL of your API. This is typically http://localhost:7069 for local development. Set the uid variable to the user ID you will be using for testing.
-
Explore the Endpoints: The collection includes pre-configured requests for various API operations. You can use these requests to interact with the API and see how it works.
The primary database entities for this API are user-specific. A UID is required for CRUD capabilties. This can be accomplished one of two ways: Creating a unique UID for each user, comprised of letters and numbers. This is only recommended for API testing purposes. Creating a client-side application which user's Google Authentication. Google will give each user's a unique UID which can then be passed to the API for use as the database UID. This is highly recommended for security and privacy when using in a published application.
Here you list all prerequisites necessary for running your project. For example:
- Postman
- .NET 8
- pgAdmin
- Visual Studio
How to clone your project
git clone your-project-url-in-github
The following endpoints are available in the ThriveWell API.
route | description |
---|---|
GET /journals/user/{uid} | retrieves all of a user's journal entries |
GET /journals/user/{uid}/{year}/{month} | retrieves all of a user's journal entries from a specific month and year |
GET /journals/{id} | retrieves a user's specific journal entry |
POST /journals | creates a new journal entry for a user |
PUT /journals/{id} | edits a user's journal entry |
DELETE /journals/{id} | deletes a specific journal entry |
route | description |
---|---|
GET /symptoms/user/{uid} | retrieves all of a user's symptom |
GET /symptoms/{id} | retrieves a user's specific symptom |
POST /symptoms | creates a new symptom for a user |
PUT /symptoms/{id} | edits a specific symptom |
DELETE /symptoms/{id} | deletes a specific symptom |
route | description |
---|---|
GET /triggers/user/{uid} | retrieves all of a user's trigger |
GET /triggers/{id} | retrieves a user's specific trigger |
GET /triggers/user/{uid}/topfive | retrieves a user's top five recurring triggers from the last 30 days |
POST /triggers | creates a new trigger for a user |
PUT /triggers/{id} | edits a specific trigger |
DELETE /triggers/{id} | deletes a specific trigger |
route | description |
---|---|
GET /logs/user/{uid} | retrieves all of a user's symptom logs |
GET /logs/{uid}/date/{year}/{month}/{day} | retrieves all of a user's symptom logs by a specific date |
GET /logs/{uid}/thirydays | retrieves all of a user's symptom logs from the last 30 days |
GET /logs/{id} | retrieves a user's specific symptom log |
POST /logs | creates a new symptom log for a user |
PUT /logs/{id} | edits a specific log |
DELETE /logs/{id} | deletes a specific log |
route | description |
---|---|
POST /symptom-trigger | create a new symptom trigger for a user's symptom log |
DELETE /symptom-trigger/{id} | deletes a specific symptom trigger from a symptom log |