Editable Company Settings - Huddle/huddle-apis GitHub Wiki
The GET operation shows which fields are editable and provides a template for the PUT operation, which updates the company settings. The link for editing the settings can be found by retrieving the settings.
Note: This document uses the
/peopleAPI prefix. A newer/membershipequivalent is also available — see CompanyNew.
| Method | Path | Purpose | Details |
|---|---|---|---|
GET |
/people/companies/123/settings/edit |
Retrieve the editable company settings | Jump |
PUT |
/people/companies/{companyId}/settings/edit |
Creating or updating the settings | Jump |
If the company settings has not been created for a Company then a default template, which has as disabled, will be returned.
In this example we are asking for the setting from the company with id 123
GET /people/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/xml<settings>
<setting>
<name>MobilePin</name>
<enabled>true</enabled>
</setting>
</settings>GET /people/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+json
Content-Type: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty{
settings: [
{
"name" : "MobilePin",
"enabled" : true
}
]
}| Case | Response |
|---|---|
| 401 Unauthorized | Invalid authorization token |
| 404 Not Found | Not a company manager |
| 404 Not Found | Company does not exist |
A PUT to the settings API will create or update it (overwriting the previous settings setup for the company) to the contents of the request. The Actor must be a Company Manager to update the company settings.
If the company settings has not been created for a Company then a default template, which has the settings as disabled, will be returned.
PUT /people/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/xml<companysettings>
<settings>
<setting>
<name>MobilePin</name>
<enabled>true</enabled>
</setting>
</settings>
</companysettings>PUT /people/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+json
Content-Type: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty{
settings: [
{
"name" : "MobilePin",
"enabled" : true
}
]
}| Case | Response |
|---|---|
| 400 Unauthorized | Invalid company settings type |
| 401 Unauthorized | Invalid authorization token |
| 404 Not Found | Not a company manager |
| 404 Not Found | Company does not exist |