Editable Company - Huddle/huddle-apis GitHub Wiki
The Editable Company is a representation of Companies within Huddle that shows what properties can be edited and allows them to be updated.
A GET to this endpoint shows which properties are editable and provides a template for the PUT. The link for this can be found by retrieving the Company.
GET /people/companies/123/edit HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/xml
<company>
<name>Huddle</name>
</company>
GET /people/companies/123/edit HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"name" : "Huddle"
}
Case | Response |
---|---|
401 Unauthorized | Invalid authorization token |
403 Forbidden | Actor is not Company Manager or Admin |
404 Not Found | Company does not exist |
A PUT to this endpoint will update the Company to the specified properties.
In this example we are updating the name of Company 123 to Huddle.
PUT /people/companies/123/edit HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<company>
<name>Huddle</name>
</company>
HTTP/1.1 200 OK
Content-Type: application/xml
<company>
<name>Huddle</name>
</company>
PUT /people/companies/123/edit HTTP/1.1
Accept: application/vnd.huddle.data+json
Content-Type: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
{
"name": "Huddle"
}
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"name" : "Huddle"
}
Case | Response |
---|---|
400 Bad Request | Name is not there or over 255 characters |
401 Unauthorized | Invalid authorization token |
403 Forbidden | Actor is not Company Manager or Admin |
404 Not Found | Company does not exist |
409 Conflict | Name is already in use |