Goals
Base URL
All API requests should be made to:
https://api.alpha1edtech.com
Get User Goals
Retrieves the list of goals for a student.
Endpoint: GET /users/{userId}/goals
Path Parameters:
userId
(integer, required): The ID of the user
Example Request:
GET /users/1/goals
Example Response:
[
{
"courseId": 128,
"xp": 1000,
"description": "Complete 3rd Grade Language course",
"cutoffDate": "2024-12-31T23:59:59Z"
},
{
"courseId": 129,
"xp": 500,
"description": "Finish Math module",
"cutoffDate": "2024-11-30T23:59:59Z"
}
]
Notes:
This endpoint returns an array of all goals set for the specified user.
Each goal includes the associated course ID, XP target, description, and cutoff date.
Create User Goal
Creates a new goal for a user.
Endpoint: POST /users/{userId}/goals
Path Parameters:
userId
(integer, required): The ID of the user
Request Body:
{
"courseId": 128,
"xp": 1000,
"description": "Complete 3rd Grade Language course",
"cutoffDate": "2024-12-31T23:59:59Z"
}
Parameters:
courseId
(integer, required): The ID of the course associated with the goal.xp
(integer, required): The XP (Experience Points) target for the goal.description
(string, optional): A description of the goal.cutoffDate
(string, required): An ISO 8601 formatted date string indicating when the goal should be completed.
Example Response:
{
"courseId": 128,
"xp": 1000,
"description": "Complete 3rd Grade Language course",
"cutoffDate": "2024-12-31T23:59:59Z"
}
Notes:
The response returns the created goal object, which should match the request body if successful.
Update User Goal
Updates an existing goal for a user.
Endpoint: PATCH /users/{userId}/goals/{goalId}
Path Parameters:
userId
(integer, required): The ID of the usergoalId
(integer, required): The ID of the goal to update
Request Body:
{
"courseId": 128,
"xp": 1500,
"description": "Updated: Complete 3rd Grade Language course",
"cutoffDate": "2025-01-31T23:59:59Z"
}
Parameters:
All parameters are optional, but at least one should be provided to make an update.
courseId
(integer): The ID of the course associated with the goal.xp
(integer): The updated XP target for the goal.description
(string): An updated description of the goal.cutoffDate
(string): An updated ISO 8601 formatted date string for the goal's completion.
Example Response:
{
"courseId": 128,
"xp": 1500,
"description": "Updated: Complete 3rd Grade Language course",
"cutoffDate": "2025-01-31T23:59:59Z"
}
Notes:
The response returns the updated goal object, reflecting any changes made in the request.
Delete User Goal
Deletes a goal for a user.
Endpoint: DELETE /users/{userId}/goals/{goalId}
Path Parameters:
userId
(integer, required): The ID of the usergoalId
(integer, required): The ID of the goal to delete
Example Request:
DELETE /users/1/goals/2
Response:
This endpoint returns no content on successful deletion.
Notes:
After successful deletion, the goal will no longer appear in the Get User Goals response for this user.
Best Practices
Use the Get User Goals endpoint to display a summary of all goals for a user, which can help motivate students by showing their progress and targets.
When creating goals, set realistic XP targets and cutoff dates based on the course difficulty and expected completion time.
Regularly update goals using the Update User Goal endpoint to reflect changes in course structure or student progress.
Use the Delete User Goal endpoint judiciously, perhaps only when a goal is no longer relevant or when replacing it with a more appropriate one.
Consider implementing a notification system that alerts users when they're approaching their goal cutoff dates or when they've achieved their XP targets.
When displaying goals to users, sort them by cutoff date to help prioritize more immediate goals.
Use the course ID in goals to link them directly to course progress, allowing for more integrated progress tracking.
Implement client-side validation for goal creation and updates to ensure all required fields are filled and in the correct format before making API calls.
Remember to replace {userId}
and {goalId}
with actual values in your requests.
Last updated