Users
Users are central to ShkolaFit — they represent the individuals interacting with the system. On this page, we'll dive into the different user endpoints you can use to manage users programmatically. We'll look at how to query, update, and manage user information.
The user model
The user model contains all the information about the users within the ShkolaFit system. It includes attributes such as the user's ID, username, email, and metadata about their activities.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the user.
- Name
username
- Type
- string
- Description
The username of the user.
- Name
email
- Type
- string
- Description
The email address of the user.
- Name
avatar_url
- Type
- string
- Description
The avatar image URL for the user.
- Name
last_login_at
- Type
- timestamp
- Description
Timestamp of the user's last login.
- Name
created_at
- Type
- timestamp
- Description
Timestamp of when the user was created.
- Name
updated_at
- Type
- timestamp
- Description
Timestamp of when the user details were last updated.
- Name
status
- Type
- string
- Description
The current status of the user (e.g., "active", "inactive").
Fetch User Details
This endpoint allows you to retrieve details about a specific user based on the provided user_id
. You must also provide a valid tokenID
to authenticate the request.
Required attributes
- Name
user_id
- Type
- string
- Description
The unique identifier of the user you want to fetch details for.
- Name
tokenID
- Type
- string
- Description
The user's token ID for authentication.
Request
curl -G "https://api.shkolafit.com/v1/fetchMyData" \
-d "user_id=12345" \
-d "tokenID=b9d32969-e8aa-42fd-8755-61f6a6ef8f8d"
Response
{
"apirequest": {
"tid": "b9d32969-e8aa-42fd-8755-61f6a6ef8f8d",
"trequestmade": "get_user_details:12345",
"ttimemade": "2025-01-22T13:41:06.689Z",
"trequestcost": 1
},
"requestresult": {
"user_id": "12345",
"data": {
"username": "john_doe",
"email": "johndoe@example.com",
"avatar_url": "https://assets.shkolafit.chat/avatars/john_doe.jpg",
"last_login_at": "2025-01-22T13:41:06.689Z",
"created_at": "2025-01-22T13:41:06.689Z",
"updated_at": "2025-01-22T13:41:06.689Z",
"status": "active"
}
}
}
Fetch User Financial Details
This endpoint allows you to retrieve financial details of the authenticated user based on the provided tokenID
.
Required attributes
- Name
tokenID
- Type
- string
- Description
The user's token ID for authentication.
Request
curl -G "https://api.shkolafit.com/v1/fetchMyFinances" \
-d "tokenID=b9d32969-e8aa-42fd-8755-61f6a6ef8f8d"
Response
{
"apirequest": {
"tid": "b9d32969-e8aa-42fd-8755-61f6a6ef8f8d",
"trequestmade": "get_my_finances",
"ttimemade": "2025-01-22T13:41:06.689Z",
"trequestcost": 1
},
"requestresult": {
"data": {
"total_due": 500.00,
"last_payment_date": "2025-01-01T00:00:00.000Z",
"next_payment_due": "2025-02-01T00:00:00.000Z",
"payment_history": [
{
"amount": 200.00,
"date": "2024-12-01T00:00:00.000Z",
"method": "Credit Card"
},
{
"amount": 300.00,
"date": "2024-11-01T00:00:00.000Z",
"method": "Credit Card"
}
]
}
}
}
Fetch User API Requests
This endpoint allows you to retrieve all API requests made by the authenticated user, based on the provided tokenID
.
Required attributes
- Name
tokenID
- Type
- string
- Description
The user's token ID for authentication.
Request
curl -G "https://api.shkolafit.com/v1/fetchMyRequests" \
-d "tokenID=b9d32969-e8aa-42fd-8755-61f6a6ef8f8d"
Response
{
"apirequest": {
"tid": "b9d32969-e8aa-42fd-8755-61f6a6ef8f8d",
"trequestmade": "get_my_requests",
"ttimemade": "2025-01-22T13:41:06.689Z",
"trequestcost": 1
},
"requestresult": {
"requests": [
{
"tid": "b9d32969-e8aa-42fd-8755-61f6a6ef8f8d",
"trequestmade": "get_user_details:12345",
"ttimemade": "2025-01-21T12:41:06.689Z",
"trequestcost": 1
},
{
"tid": "b9d32969-e8aa-42fd-8755-61f6a6ef8f8d",
"trequestmade": "get_my_finances",
"ttimemade": "2025-01-20T15:00:00.000Z",
"trequestcost": 1
}
]
}
}