MemberAutocomplete - Huddle/huddle-apis GitHub Wiki
The Members Autocomplete API provides fast, as-you-type member suggestions for a company.
This endpoint is linked from Membership company resources via rel="memberautocomplete", but the endpoint URL is on the members API path.
| Method | Path | Purpose | Details |
|---|---|---|---|
GET |
/members/companies/123/autocomplete?q=isi&hits=10 |
Autocomplete Members | Jump |
Returns members that match the beginning of first name, last name, or email.
Results are constrained to the requested companyId, and the caller must be a member of that company.
When the caller is an external member, the endpoint returns 200 OK with an empty members array.
GET /members/companies/123/autocomplete?q=isi&hits=10 HTTP/1.1
Accept: application/vnd.huddle.data+xml (or+json)
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml<membersAutocomplete>
<link rel="self" href="/members/companies/123/autocomplete?q=isi&hits=10" />
<members>
<actor rel="member" name="Isidore McHohenheim" email="[email protected]">
<link rel="avatar" href="/members/users/456/avatar?h=..." type="image/jpg" />
<link rel="profile" href="https://my.huddle.example/user/456" />
<identity email="[email protected]" />
</actor>
</members>
</membersAutocomplete>HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json{
"links": [
{ "rel": "self", "href": "/members/companies/123/autocomplete?q=isi&hits=10" }
],
"members": [{
"links": [
{ "rel": "avatar", "href" : "/members/users/456/avatar?h=...", "type" : "image/jpg" },
{ "rel": "profile", "href": "https://my.huddle.example/user/456" }
],
"name": "Isidore McHohenheim",
"email": "[email protected]",
"rel": "member",
"identity": {
"email": "[email protected]"
}
}]
}Note: member entries include avatar and profile links, and do not include self or alternate links.
| Name | Description | Methods | Optional |
|---|---|---|---|
| q | The query to complete on | GET | No |
| hits | The number of results to return. Defaults to 10. Max 20. | GET | Yes |
| Name | Description | Methods |
|---|---|---|
| self | The URI of the resource | GET |
| Case | Response |
|---|---|
q is empty, whitespace, or fewer than 2 characters |
400 Bad Request |
hits is less than 1 |
400 Bad Request |
hits is more than 20 |
400 Bad Request |
| Company autocomplete is disabled for the target company | 403 Forbidden |
| Caller is not a member of the target company | 404 Not Found |
POST, DELETE, or PUT used |
405 Method Not Allowed |
| Search backend is unavailable | 503 Service Unavailable |