Member - Huddle/huddle-apis GitHub Wiki

Summary

Note: This document uses the /people API prefix. A newer /membership equivalent is also available — see CompanyNew.

A member is one person’s membership in a company. These operations are served by the People API. URLs follow the pattern /people/companies/{companyId}/members/{memberId} (and .../edit for the editable form). Membership and other services surface the same targets via link relations (for example members list entries expose self, edit, delete). Discover the member URI from Members or from company/workspace flows.

For company-manager permissions, see CompanyManagers.

Operations

Method Path Purpose Details
GET /people/companies/{companyId}/members/{memberId} Get member Jump
GET /people/companies/{companyId}/members/{memberId}/edit Get editable member Jump
PUT /people/companies/{companyId}/members/{memberId}/edit Update member Jump
DELETE /people/companies/{companyId}/members/{memberId} Delete member Jump

Path segments companyId and memberId are numeric identifiers for the company and the member.


Get member

When retrieving members of a company, each entry includes a self link. GET that URI to load the full member representation.

Request

GET /people/companies/123/members/456 HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

For timezone values see Timezones. For language codes see Language Codes. In XML/JSON the locale field is language (not languageCode).

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<member>
  <link rel="self" href="..." />
  <link rel="edit" href="..." />
  <link rel="delete" href="..." />
  <link rel="company" href="..." />
  <link rel="user" href="..." />
  <link rel="avatar" href="..." />
  <link rel="profile" href="..." />
  <link rel="companyManager" href="..." />

  <firstName>Andy</firstName>
  <lastName>McLoughlin</lastName>
  <displayName>AndyMcLoughlin</displayName>
  <company>Huddle</company>
  <companyUrl>http://www.huddle.com</companyUrl>
  <role>Founder</role>
  <businessAddress>Some Address, Some City, A12 3BC</businessAddress>
  <telephone>(01234)567890</telephone>
  <mobile>(07891)234567</mobile>
  <imAddress>andym</imAddress>
  <professionalWebsite>http://www.linkedin.com/in/andymcloughlin</professionalWebsite>
  <timezone>Europe/London</timezone>
  <language>en-GB</language>
  <internal>true</internal>
  <companyManager>true</companyManager>
  <lastLoginDate>2013-04-04T23:50:34</lastLoginDate>
</member>

Use Accept: application/vnd.huddle.data+json for JSON.

Other responses

Case Response
Invalid or missing authorization 401 Unauthorized
Company missing, user not in company, or not manager/admin 404 Not Found or 403 Forbidden
Member does not exist 404 Not Found

Get editable member

If the actor may edit the member, the member advertises an edit link. GET it to retrieve the editable subset of fields (see Editing resources).

Request

GET /people/companies/123/members/456/edit HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<member>
  <link rel="self" href="..." />
  <link rel="parent" href="..."/>

  <firstName>Andy</firstName>
  <lastName>McLoughlin</lastName>
  <company>Huddle</company>
  <companyUrl>http://www.huddle.com</companyUrl>
  <role>Founder</role>
  <businessAddress>Some Address, Some City, A12 3BC</businessAddress>
  <telephone>(01234)567890</telephone>
  <mobile>(07891)234567</mobile>
  <imAddress>andym</imAddress>
  <professionalWebsite>http://www.linkedin.com/in/andymcloughlin</professionalWebsite>
  <timezone>Europe/London</timezone>
  <language>en-GB</language>
</member>

Other responses

Case Response
Member missing or deleted 404 Not Found
Not manager/admin 404 / 403

Update member

Change fields on the representation returned from the edit resource, then PUT the same edit URI.

Request

PUT /people/companies/123/members/456/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherooty
<member>
  <firstName>Alastair</firstName>
  <lastName>Mitchell</lastName>
  <company>Huddle</company>
  <companyUrl>http://www.huddle.com</companyUrl>
  <role>Founder</role>
  <businessAddress>Some Address, Some City, A12 3BC</businessAddress>
  <telephone>(01234)567890</telephone>
  <mobile>(07891)234567</mobile>
  <imAddress>alim</imAddress>
  <professionalWebsite>http://www.linkedin.com/in/andymcloughlin</professionalWebsite>
  <timezone>Europe/London</timezone>
  <language>en-GB</language>
</member>

Response

On success the API returns 204 No Content. A Link header may include rel="parent" pointing at the member or list.

This response uses standard error codes and response headers.

HTTP/1.1 204 No Content
Link: <...>; rel="parent"

Malformed or invalid body may yield 400 Bad Request. See ErrorHandling and ResponseHeaders.


Delete member

Send DELETE to the delete link from the member or list item.

Example shape (use the actual href from the response):

DELETE /people/companies/123/members/456 HTTP/1.1
Authorization: Bearer frootymcnooty/vonbootycherooty

The API requires company manager or administrator, except for permitted system identities in the company.

Response

HTTP/1.1 204 No Content

Related

⚠️ **GitHub.com Fallback** ⚠️