-
Notifications
You must be signed in to change notification settings - Fork 8
TeamsNew
The Membership Team API is a representation of a given Team within Huddle.
The Membership Team API is in Alpha
Operation | Status |
---|---|
List of Teams in Workspace | Alpha |
Retrieve a Team | Alpha |
Create a Team | Alpha |
Update a Team | Alpha |
Delete a Team | Alpha |
Add Members to a Team | Alpha |
Retrieve Team Members | Alpha |
Remove Members from a Team | Alpha |
The following example requests teams for workspace with id 123.
Request:
GET /workspaces/123/teams HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty
Filters are query string parameters that are used to filter the list of teams returned, e.g.
GET /workspaces/123/teams?name=my&hasUser=123&pagesize=20&skip=0
Parameter | Default value | Additional Notes |
---|---|---|
name |
Searches for team names within a workspace which begin with the name query string. | |
hasUser |
Checks wether or not a given user belongs to a team or not, indicated by the optional property userIsMember . |
|
pagesize |
20 |
The maximum number of elements to return, between 1 - 100. |
skip |
0 |
The number of elements to skip. |
Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "create-team", "href": "..." },
{ "rel" : "bulk-invitation", "href": "..." }
{ "rel" : "first", "href" : "..." },
{ "rel" : "previous", "href" : "..." },
{ "rel" : "next", "href" : "..." },
],
"teams": [
{
"links": [
{ "rel" : "self", "href": "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "add-member", "href" : "..." },
{ "rel" : "update", "href" : "..." },
{ "rel" : "delete", "href" : "..." },
{ "rel" : "remove", "href" : "..." }
],
"name": "My Team 1",
"description": "Description of My Team 1",
"userIsMember": true, // optional property, will appear query param hasUser is passed
},
{
"links": [
{ "rel" : "self", "href": "..." },
{ "rel" : "parent", "href" : "..." },
...
],
"name": "My Team 2",
"description": "Description of My Team 2",
"userIsMember": false
}
]
}
Name | Description |
---|---|
teams | The list of the teams for the workspace |
Property | Name | Description | Methods |
---|---|---|---|
self |
The URI of this collection of teams | GET |
|
parent |
The URI of the workspace the teams collection belongs to | GET |
|
create-team |
If you have permission, the URI to create a new Team | POST |
|
bulk-invitation |
If you have permission, the URI to bulk invite people to Teams | POST |
|
first |
The URI of the first page of teams. | GET |
|
previous |
The URI of the previous page of teams. | GET |
|
next |
The URI of the next page of teams. | GET |
|
teams |
parent |
The URI of the workspace the team belongs to | GET |
teams |
self |
The URI of the team | GET |
teams |
add-member |
The URI to add members to a team | POST |
teams |
update |
The URI to update team details | PATCH |
teams |
delete |
The URI to delete the team | DELETE |
teams |
remove-members |
The URI to remove members from a team | POST |
Case | Response |
---|---|
Invalid authorization token | 401 Unauthorized |
Insufficient permissions to get teams | 403 Forbidden |
Workspace does not exist | 404 Not Found |
You can GET a given team and it will display the information for that team.
The following example requests information for a team with ID 456 within a workspace with id 123.
Request:
GET /teams/456 HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty
Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "members", "href" : "...", "count": 3 },
{ "rel" : "add-member", "href" : "..." },
{ "rel" : "update", "href": "..." },
{ "rel" : "delete", "href": "..." }
],
"name" : "My Important team",
"description" : "My team description"
}
Name | Description |
---|---|
name | The name of the team |
Name | Description | Methods |
---|---|---|
self | The URI of this team | GET |
parent | The URI of the workspace the team belongs to | GET |
members | The URI of the members that belongs to this team | GET |
add-member | If you have permission, the URI to add user to Team | POST |
Case | Response |
---|---|
Invalid authorization token | 401 Unauthorized |
Actor has insufficient permissions | 403 Forbidden |
Team or Workspace does not exist | 404 Not Found |
The following example requests a team to be created for a workspace with id 123. A workspace cannot contain duplicate team names.
Request:
POST /workspaces/123/teams HTTP/1.1
Accept: application/vnd.huddle.data+json
Content-Type: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty
{
"name": "My first team!",
"description": "Description of my first team!"
}
Response:
HTTP/1.1 201 Created
Content-Type: application/vnd.huddle.data+json
Location: /workspaces/123/teams/456
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "add-member", "href" : "..." }
],
"name" : "My first team!",
"description": "Description of my first team!"
}
Name | Description |
---|---|
name | The name of the team |
Refer to General HTTP Status Codes.
Below are responses related to this resource:
Case | Response |
---|---|
Actor has insufficient permissions | 403 Forbidden |
Workspace does not exist | 404 Not Found |
Name already exists | 409 Conflict |
You can UPDATE the name and description of a team.
Request:
PATCH /workspaces/123/teams/456 HTTP/1.1
Content-Type: application/json
Authorization: Bearer frootymcnooty/vonbootycherooty
{
"name": "New name for Team 1",
"description": "New description of Team 1"
}
Response:
If successful, this method will return with a 200 OK status code. The response body will be the updated Team. This response uses the standard error codes and returns standard response headers.
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
...
],
"name": "New name for Team 1",
"description": "New description of Team 1"
}
Name | Description |
---|---|
Name | Team Name |
Description | Team Description |
Refer to General HTTP Status Codes. Below are responses related to this resource:
Case | Response |
---|---|
Invalid authorization token | 401 Unauthorized |
Actor has insufficient permission | 403 Forbidden |
Actor is not a member of the workspace | 403 Forbidden |
New Team name matches and existing team name | 409 Conflict |
You can DELETE a given team that has no Team Members associated with it.
Request:
DELETE /workspaces/123/team/456
Authorization: Bearer frootymcnooty/vonbootycherooty
Response:
HTTP/1.1 204 No Content
Refer to General HTTP Status Codes. Below are responses related to this resource:
Case | Response |
---|---|
Invalid authorization token | 401 Unauthorized |
Actor has insufficient permission | 403 Forbidden |
Workspace does not exist | 404 Not Found |
Team has one or more members | 409 Conflict |
You can POST users (only their self
link needs to be included) to add them as team members
The following example adds a user to the team with ID 456
Request:
POST /workspaces/123/teams/456/members HTTP/1.1
Accept: application/vnd.huddle.data+json
Content-Type: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty
{
"links": [{
"rel": "member",
"href": "..."
}]
}
Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
Link: /workspaces/123/teams/456
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "add-member", "href" : "..." },
{ "rel" : "remove-members", "href" : "..." },
{ "rel" : "first", "href" : "..." },
{ "rel" : "next", "href" : "..." },
{ "rel" : "previous", "href" : "..." }
],
"members" : [
{
"name" : "Serious Sam",
"email" : "[email protected]",
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "avatar", "href" : "..." },
{ "rel": "alternate", "href": "..." }
]
},
...
]
}
Name | Description |
---|---|
links | An array containing the "self" link of the user to add |
Refer to General HTTP Status Codes. Below are responses related to this resource:
Case | Response |
---|---|
Actor has insufficient permission | 403 Forbidden |
Email address is not on allow list | 400 Bad Request |
Team does not exist | 404 Not Found |
Users not provided or invalid | 400 Bad Request |
You can GET all team members and the metadata of the members in a team.
The following example requests information for members of a team with id 456 within a workspace with id 123.
Request:
GET /workspaces/123/teams/456/members HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty
Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "add-member", "href" : "..." },
{ "rel" : "first", "href" : "..." },
{ "rel" : "next", "href" : "..." },
{ "rel" : "previous", "href" : "..." }
],
"members" : [
{
"name" : "Serious Sam",
"email" : "[email protected]",
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "avatar", "href" : "..." },
{ "rel": "alternate", "href": "..." }
]
},
...
]
}
Query string parameters are used to filter the team members in a team. Returns empty list of members
if no members were found that match your query.
Request:
GET /workspaces/123/teams/456/members?q=ser&pagesize=20&skip=0 HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty
Parameter | Default value | Additional notes |
---|---|---|
q |
Match a team member on firstname , lastname , email
|
|
pagesize |
20 |
|
skip |
0 |
Response shape is the same as in Retrieve Team Members
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "add-member", "href" : "..." },
{ "rel" : "first", "href" : "..." },
{ "rel" : "next", "href" : "..." },
{ "rel" : "previous", "href" : "..." }
],
"members" : [
{
"name" : "Serious Sam",
"email" : "[email protected]",
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "avatar", "href" : "..." },
{ "rel": "alternate", "href": "..." }
]
},
...
]
}
Name | Description |
---|---|
members | The list of team members |
Property | Name | Description | Methods |
---|---|---|---|
self | The URI of these members | GET | |
parent | The URI of the team the members belong to | GET | |
add-member | If you have permission, the URI to add user to Team | POST | |
first | The URI to move to the first page | GET | |
next | The URI to move to the next page | GET | |
previous | The URI to move to the previous page | GET | |
members | self | The URI of the user | GET |
members | avatar | The URI of the user's avatar | GET |
members | alternate | The URI of the user's profile | GET |
Case | Response |
---|---|
Invalid authorization token | 401 Unauthorized |
Actor has insufficient permissions | 403 Forbidden |
Team or Workspace does not exist | 404 Not Found |
Only Workspace Managers have the permissions to remove members from a team (including themselves).
The following example removes a member from a team. The team ID in this example is 456.
Request:
POST /workspaces/123/teams/456/members/remove HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer frootymcnooty/vonbootycherooty
{
"links": [{
"rel": "member",
"href": "..."
}]
}
Response:
HTTP/1.1 200 OK
Content-Location: /workspaces/123/teams/456/members
Content-Type: application/json
{
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "parent", "href" : "..." },
{ "rel" : "add-member", "href" : "..." },
{ "rel" : "remove-members", "href" : "..." },
{ "rel" : "first", "href" : "..." },
{ "rel" : "next", "href" : "..." },
{ "rel" : "previous", "href" : "..." }
],
"members" : [
{
"name" : "Serious Sam",
"email" : "[email protected]",
"links" : [
{ "rel" : "self", "href" : "..." },
{ "rel" : "avatar", "href" : "..." },
{ "rel": "alternate", "href": "..." }
]
}
]
}
Name | Description |
---|---|
links | An array containing the "self" links of the members to remove |
Refer to General HTTP Status Codes. Below are responses related to this resource:
Case | Response |
---|---|
Actor has insufficient permission | 403 Forbidden |
Team does not exist | 404 Not Found |
- Basic concepts
-
Resources
- Actor
- Approvals
- BulkProcess
- Calendar
- Membership
- Company
- Document
- Document library settings
- Folder
- Paged Folder
- Pins
- Integrations
- Form
- Friends
- Invitation
- Link
- Document Lock
- Folder Lock
- Localisation
- MemberAutocomplete
- Notifications
- Offline item
- PeopleBulkProcess
- Permissions
- Presence
- PublishedDocuments
- Recents
- Recommendations
- Recycle Bin
- Search
- Share
- Tasks (Todos), File Requests, Approvals
- Tasks on Documents
- Actions
- UserApprovals
- User
- VersionHistory
- Workspace
- Workspaces
- SamlPartners
- Logout
- Impersonation
- Administration
- WebHooks