EditableWhitelist - Huddle/huddle-apis GitHub Wiki
The GET operation shows which fields are editable and provides a template for the PUT operation, which updates the Whitelist. The link for editing the Whitelist can be found by retrieving the Whitelist.
If a Whitelist has not been created for a Company then a default EditableWhitelist, which is disabled and has no workspaces or entries, will be returned.
GET /people/companies/123/whitelist/edit
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<whitelist>
<enabled>true</enabled>
<entries>
<entry>huddle.net</entry>
<entry>[email protected]</entry>
</entries>
<workspaces>
<link href="..." rel="workspace"/>
</workpaces>
</whitelist>
GET /people/companies/123/whitelist/edit
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"enabled": true,
"entries": [
"huddle.net",
"[email protected]"
],
"workspaces": [{
"rel": "workspace",
"href": ".."
}]
}
Case | Response |
---|---|
Invalid authorization token | 401 Unauthorized |
Not a Company Manager | 403 Forbidden |
A PUT to the Whitelist API will create or update it (overwriting the previous Whitelist setup for the company) to the contents of the request.
All emails and email domains should be well formed and a maximum of 500 entries can be added to the Whitelist.
Adding no workspaces will make the Whitelist apply to all workspaces.
The Actor must be a Company Manager to update the Whitelist.
PUT /people/companies/123/whitelist/edit
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<whitelist>
<enabled>true</enabled>
<entries>
<entry>@huddle.net</entry>
<entry>[email protected]</entry>
</entries>
<workspaces>
<link href="..." rel="workspace"/>
</workpaces>
</whitelist>
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<whitelist>
<enabled>true<enabled>
<entries>
<entry>huddle.net<entry>
<entry>[email protected]</entry>
</entries>
<workspaces>
<link href="..." rel="workspace"/>
</workpaces>
</whitelist>
PUT /people/companies/123/whitelist/edit
Content-Type: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
{
"enabled": true,
"entries": [
"@huddle.net",
"[email protected]"
],
"workspaces": [{
"rel": "workspace",
"href": ".."
}]
}
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"enabled": true,
"entries": [
"huddle.net",
"[email protected]"
],
"workspaces": [{
"rel": "workspace",
"href": ".."
}]
}
Case | Response |
---|---|
Invalid authorization token | 401 Unauthorized |
Not a Company Manager | 403 Forbidden |
Greater than 500 entries in the Whitelist | 400 Bad Request |
Any of the entries are invalid email addresses or domains | 400 Bad Request |
Whitelist does not exist | 404 Not Found |