> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List a task's assignments

export const Link = ({href, children, className, ...props}) => {
  const [localizedHref, setLocalizedHref] = useState(href);
  const supportedLocales = useMemo(() => ['ja'], []);
  useEffect(() => {
    const getLocaleFromPath = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      if (match) {
        const potentialLocale = match[1];
        if (supportedLocales.includes(potentialLocale)) {
          return potentialLocale;
        }
      }
      return null;
    };
    const hasLocalePrefix = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      return match ? supportedLocales.includes(match[1]) : false;
    };
    const currentPath = window.location.pathname;
    const currentLocale = getLocaleFromPath(currentPath);
    if (href && href.startsWith('/') && !hasLocalePrefix(href)) {
      if (currentLocale) {
        setLocalizedHref(`/${currentLocale}${href}`);
      } else {
        setLocalizedHref(href);
      }
    } else {
      setLocalizedHref(href);
    }
  }, [href, supportedLocales]);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

To list all of the assignments for a specific tasks, call the
<Link href="/reference/get-task-assignments-id">`GET /tasks/:task_id/assignments`</Link> with the task
`id`.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X GET "https://api.box.com/2.0/task_assignments/12345" \
       -H "authorization: Bearer <ACCESS_TOKEN>"
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.taskAssignments.getTaskAssignmentById(taskAssignment.id!);
  ```

  ```python Python v10 theme={null}
  client.task_assignments.get_task_assignment_by_id(task_assignment.id)
  ```

  ```csharp .NET v10 theme={null}
  await client.TaskAssignments.GetTaskAssignmentByIdAsync(taskAssignmentId: NullableUtils.Unwrap(taskAssignment.Id));
  ```

  ```swift Swift v10 theme={null}
  try await client.taskAssignments.getTaskAssignmentById(taskAssignmentId: taskAssignment.id!)
  ```

  ```java Java v10 theme={null}
  client.getTaskAssignments().getTaskAssignmentById(taskAssignment.getId())
  ```

  ```java Java v5 theme={null}
  String assignmentID = "4256974";
  BoxTaskAssignment.Info assignmentInfo = new BoxTaskAssignment(api, assignmentID).getInfo();
  ```

  ```py Python v4 theme={null}
  assignment= client.task_assignment('12345').get()
  print(f'Assignment ID is {assignment.id} and assignment type is {assignment.type}')
  ```

  ```csharp .NET v6 theme={null}
  BoxTaskAssignment assignment = await client.TasksManager.GetTaskAssignmentAsync("12345");
  ```

  ```js Node v4 theme={null}
  client.tasks.getAssignment('12345')
   .then(assignment => {
    /* assignment -> {
     type: 'task_assignment',
     id: '12345',
     item: 
     { type: 'file',
      id: '33333',
      sequence_id: '0',
      etag: '0',
      sha1: '7840095ee096ee8297676a138d4e316eabb3ec96',
      name: 'script.js' },
     assigned_to: 
     { type: 'user',
      id: '22222',
      name: 'Sample Assignee',
      login: 'assignee@exmaple.com' },
     message: null,
     completed_at: null,
     assigned_at: '2013-05-10T11:43:41-07:00',
     reminded_at: null,
     resolution_state: 'incomplete',
     assigned_by: 
     { type: 'user',
      id: '33333',
      name: 'Example User',
      login: 'user@example.com' } }
    */
   });
  ```
</CodeGroup>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
  { label: "Assign a task to a user", href: "/guides/tasks/assignments/assign", badge: "GUIDE" },
  { label: "Unassign a task", href: "/guides/tasks/assignments/unassign", badge: "GUIDE" },
  { label: "Get task assignment information", href: "/guides/tasks/assignments/get", badge: "GUIDE" }
]}
/>
