I have created a widget that pulls data for the logged-in user such as course progress but the widget will display unique data depending on what student is logged in.
I am trying to dynamically pull the user_id of the student logged in viewing the widget but I am getting stuck on what the current variable is for the User ID.
# Retrieve the user_id from query parameters, form data, or args
user_id = request.args.get('user_id') or request.form.get('user_id')
The above (in Python) is not currently working because I believe "user_id" is not the correct variable to call.
Purpose: Once we pull the user_id dynamically, we can call our APIs using that student's unique User ID.
Any help with this would be greatly appreciated.