code: def get(self, request, username, course_key, subsection_id):
          
          def get_completion(course_completions, all_blocks, block_id):
              """
              Recursively get the aggregate completion for a subsection,
              given the subsection block and a list of all blocks.
  
              Parameters:
                  course_completions: a dictionary of completion values by block IDs
                  all_blocks: a dictionary of the block structure for a subsection
                  block_id: an ID of a block for which to get completion
              """
              block = all_blocks.get(block_id)
              child_ids = block.get('children', [])
              if not child_ids:
                  return course_completions.get(block.serializer.instance, 0)
  
              completion = 0
              total_children = 0
              for child_id in child_ids:
                  completion += get_completion(course_completions, all_blocks, child_id)
                  total_children += 1
  
              return int(completion == total_children)
  
          user_id = User.objects.get(username=username).id
          block_types_filter = [
              'course',
              'chapter',
              'sequential',
              'vertical',
              'html',
              'problem',
              'video',
              'discussion',
              'drag-and-drop-v2'
          ]
  
          blocks = get_blocks(
              request,
              UsageKey.from_string(subsection_id),
              nav_depth=2,
              requested_fields=[
                  'children'
              ],
              block_types_filter=block_types_filter
          )
  
          course_completions = BlockCompletion.get_course_completions(user_id, CourseKey.from_string(course_key))
          aggregated_completion = get_completion(course_completions, blocks['blocks'], blocks['root'])
  
          return Response({"completion": aggregated_completion}, status=status.HTTP_200_OK)
docs: Returns completion for a (user, subsection, course).