Authentication 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 these requests do not
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 /identity/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/xml
<settings>
<setting>
<name>MobilePin</name>
<enabled>true</enabled>
</setting>
</settings>
GET /identity/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+json
Content-Type: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
{
settings: [
{
"name" : "TwoFactorAuth",
"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 /identity/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+xml
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/xml
<companysettings>
<settings>
<setting>
<name>TwoFactorAuth</name>
<enabled>true</enabled>
</setting>
</settings>
</companysettings>
PUT /identity/companies/123/settings/edit HTTP/1.1
Accept: application/vnd.huddle.data+json
Content-Type: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
{
settings: [
{
"name" : "TwoFactorAuth",
"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 |