TaskAssignments - Huddle/huddle-apis GitHub Wiki

Summary

Assignment of Users to Tasks, can be used to indicate who should fulfill a File Request.

Status

Operation
Retrieve an assignment
Retrieve assignments for a task
Add assignee(s) to a task
Replacing assignees on a task
Un-assign task from user

Operations

Retrieve an assignment

Link relations

Name Description Methods
self The URI of the Asssignment. GET
parent The URI of the Task. GET
delete The URI to delete the Assignment. DELETE

Example

Request

GET /tasks/12345/assignments/23 HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty

JSON Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
    "links": [
        { "rel": "self", "href": "..." },
        { "rel": "parent", "href": "..." },
        { "rel": "delete", "href": "..." }
    ],
    "created": "Thu, 15 Sep 2016 12:38:28 GMT",
    "actors": [{
        "name": "Jimmy Snake",
        "email": "[email protected]",
        "rel": "assignee",
        "links": [
            { "rel": "self", "href": ".." },
            { "rel": "avatar", "href": "..", "type": "image/jpeg" },
            { "rel": "alternate", "href": "..", "type": "text/html" }
        ]
    },{
        "name": "John Dow",
        "email": "[email protected]",
        "rel": "assigner",
        "links": [
            { "rel": "self", "href": ".." },
            { "rel": "avatar", "href": "..", "type": "image/jpeg" },
            { "rel": "alternate", "href": "..", "type": "text/html" }
        ]
    }]
}

XML Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<assignment>
    <link rel="self" href="..." />
    <link rel="parent" href="..." />
    <link rel="delete" href="..." />
    <created>2007-10-10T09:02:17Z</created>
    <actor name="Peter Gibson" email="[email protected]" rel="assignee">
        <link rel="self" href="..." />
        <link rel="avatar" href="..." type="image/jpeg" />
        <link rel="alternate" href="..." type="text/html" />
    </actor>
    <actor name="JOhn Dow" email="[email protected]" rel="assigner">
        <link rel="self" href="..." />
        <link rel="avatar" href="..." type="image/jpeg" />
        <link rel="alternate" href="..." type="text/html" />
    </actor>
</assignment>

Error Responses

Case Response Code Error Code
Assignment does not exist 404 Not Found AssignmentNotFound
Task does not exist 404 Not Found TaskNotFound
Task is deleted 404 Not Found TaskDeleted
User is not a member of the Workspace 403 Forbidden WorkspaceMembershipRequired
Workspace is locked 403 Forbidden WorkspaceLocked
Workspace is deleted 404 Not Found WorkspaceDeleted

Retrieve assignments for a task

This is limited to your 500 most recent assignments.

Link relations

Name Description Methods
self The URI of the Assignment on the Task. GET
parent The URI of the Task. GET
create The URI to add an Assignment to the Task. POST
replace The URI to replace the assignees on the Task POST

Example

Request

GET /tasks/12345/assignments HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty

JSON Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
    "links": [
        { "rel": "self", "href": "..." },
        { "rel": "parent", "href": "..." },
        { "rel": "create", "href": "..." },
        { "rel": "replace", "href": "..." }
    ],
    "assignments": [{
        "links": [
            { "rel": "self", "href": "..." },
            ... other assignment links ...
        ],
        ... other assignment elements ...
    }]
}

XML Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<assignments>
    <link rel="self" href=".." />
    <link rel="parent" href=".." />
    <link rel="create" href=".." />
    <link rel="replace" href=".." />
    <items>
        <assignment>
            <link rel="self" href="..." />
            ... other assignment elements ...
        </assignment>
    </items>
</assignments>
Case Response Code Error Code
Task does not exist 404 Not Found TaskNotFound
Task is deleted 404 Not Found TaskDeleted
User is not a member of the Workspace 403 Forbidden WorkspaceMembershipRequired
Workspace is locked 403 Forbidden WorkspaceLocked
Workspace is deleted 404 Not Found WorkspaceDeleted

Add assignees to a task

Adds one or more assignees to the task, you can also add all the members of a team to a task. If a user exists in multiple teams, only one assignment is added per user.

Example

JSON Request

POST /tasks/12345/assignments HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
[{
  "links":
    [{
      "rel": "assignee",
      "href": "..."
    }]
},
{
  "links":
    [{
      "rel": "assignee",
      "href": "..."
    }]
},
{
  "links":
    [{
      "rel": "team",
      "href": "..."
    }]
}]

XML Request

POST /tasks/12345/assignments HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<assignments>
    <assignment>
        <link rel="assignee" href=".." />
    </assignment>
    <assignment>
        <link rel="assignee" href=".." />
    </assignment>
    <assignment>
        <link rel="team" href=".." />
    </assignment>
</assignments>

Response

If successful, this method will return an empty response with a Created status code and a Location header containing the URI of the created assignment if only one assignment is created. If more than one assignments are created Location header contains link to the task assignments. This response uses the standard error codes and returns standard response headers.

When single assignment is made
HTTP/1.1 201 Created
Location: /tasks/12345/assignments/1
When multiple assignments are made
HTTP/1.1 201 Created
Location: /tasks/12345/assignments

Error Responses

Case Response Code Error Code
Task does not exist 404 Not Found TaskNotFound
Task is deleted 404 Not Found TaskDeleted
Not a user URI 400 Bad Request Invalid
Assignee is not a member of the Workspace 400 Bad Request AssigneeWorkspaceMembershipRequired
Assigner is not a member of the Workspace 403 Forbidden WorkspaceMembershipRequired
Workspace is locked 403 Forbidden WorkspaceLocked
Workspace is archived 403 Forbidden WorkspaceArchived
Workspace is deleted 404 Not Found WorkspaceDeleted
User is not the Task Owner or Workspace Manager 403 Forbidden InsufficientPermissions
User not found 404 Not Found UserNotFound
Team not found 404 Not Found TeamNotFound
Number of assignments for task exceeded (Max 500) 400 Bad Request TaskAssignmentLimitExceeded

Replacing assignees on a task

Replaces the current assignees with the new list of assignees which adds and removes existing assignees as needed. Assignees can be provided individually or from one or multiple teams.

Example

JSON Request

POST /tasks/12345/assignments/replace HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
[{
  "links":
    [{
      "rel": "assignee",
      "href": "..."
    }]
},
{
  "links":
    [{
      "rel": "assignee",
      "href": "..."
    }]
},
{
  "links":
    [{
      "rel": "team",
      "href": "..."
    }]
}]

XML Request

POST /tasks/12345/assignments/replace HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<assignments>
    <assignment>
        <link rel="assignee" href=".." />
    </assignment>
    <assignment>
        <link rel="assignee" href=".." />
    </assignment>
    <assignment>
        <link rel="team" href=".." />
    </assignment>
</assignments>

Response

If successful, this method will return an empty response with a 204 No Content status code and a Location header containing a link to the task assignments. This response uses the standard error codes and returns standard response headers.

When replace assignments are made
HTTP/1.1 204 No Content
Location: /tasks/12345/assignments

Error Responses

Case Response Code Error Code
Task does not exist 404 Not Found TaskNotFound
Task is deleted 404 Not Found TaskDeleted
Not a user URI 400 Bad Request Invalid
Assignee is not a member of the Workspace 400 Bad Request AssigneeWorkspaceMembershipRequired
Assigner is not a member of the Workspace 403 Forbidden WorkspaceMembershipRequired
Workspace is locked 403 Forbidden WorkspaceLocked
Workspace is archived 403 Forbidden WorkspaceArchived
Workspace is deleted 404 Not Found WorkspaceDeleted
User is not the Task Owner or Workspace Manager 403 Forbidden InsufficientPermissions
User not found 404 Not Found UserNotFound
Team not found 404 Not Found TeamNotFound
Number of assignments for task exceeded (Max 500) 400 Bad Request TaskAssignmentLimitExceeded

Un-assign task from user

Example

Request

DELETE /tasks/12345/assignments/23 HTTP/1.1
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

If successful, this method will return an empty response with a No Content status code. This response uses the standard error codes and returns standard response headers.

HTTP/1.1 204 No Content

Error Responses

Case Response Code Error Code
Task does not exist 404 Not Found TaskNotFound
Task is deleted 404 Not Found TaskDeleted
User is not a member of the Workspace 403 Forbidden WorkspaceMembershipRequired
Workspace is locked 403 Forbidden WorkspaceLocked
Workspace is archived 403 Forbidden WorkspaceArchived
Workspace is deleted 404 Not Found WorkspaceDeleted
User is not the Task Owner or Workspace Manager 403 Forbidden InsufficientPermissions
⚠️ **GitHub.com Fallback** ⚠️