Get member favourites
GET /api/members/{memberId}/favourites
Success: 200 OK
- Products: Operator (
FOH), Consumer (CONSUMER) (any one of these products, not all) - Features: Online Bookings (
ONLINEBOOK), Online Joining (ONLINEJOIN), Front of House Generic Access (FOHGENERIC) (any one of these features, not all)
Overview
Lists everything a member has marked as a favourite — their home site, the activities they care about, and whatever else the operator has configured as a favourite type. Use it to personalise what you show a member when they open your app.
The response is grouped by favourite type, not a flat list. Each element is one type with a values array of the member's favourites of that type, so a member with three favourite sites gives you one element containing three values, not three elements. Plan for that shape before you write your parsing.
The member must exist: an unknown id gives 404 with a message about the member, whereas a member who simply has no favourites gives 200 and an empty array. Filtering to a type the member has nothing under also gives an empty array, not a 404.
A favourite added or removed through the API is reflected here straight away, so you will see your own writes; but this is not a paged or ordered feed and no ordering is guaranteed.
This endpoint is strictly single-member: a primary member's token cannot read a linked member's favourites, and attempting it gives 403.
Endpoint
GET {base_url}/api/members/{memberId}/favourites
{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
memberId | integer (int32) | Yes | The member whose favourites you want. Must be greater than 0; 0 and -999 are rejected with 400. With a member-scoped token this must be the token's own member — linked members are explicitly not allowed here, unlike some other member endpoints. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
favouriteTypeIds | string | No | Restricts the response to particular favourite types, as a comma-separated list of numeric ids — for example 1,3. Take the ids from Get all favourite types; they are operator-defined and vary between tenants. Omit the parameter, or send it empty, to get every type. Every element in the list must parse as an integer or the whole call fails with 400 naming the offending value, so do not send type names here, and do not leave a trailing comma. Ids the member has nothing under are simply absent from the response. |
Sample request
curl -X GET '{base_url}/api/members/{memberId}/favourites' \
-H 'Authorization: Bearer {accessToken}' \
-H 'X-Use-SSO: true'Response fields
| Field | Type | Description |
|---|---|---|
[].typeId | integer (int32) | The favourite type this group is for, matching an id from Get all favourite types. Each type appears at most once in the response. |
[].typeName | string | The operator's label for the type, such as SITE. Carried through from the type configuration so you do not have to call the types endpoint just to render a heading. |
[].values | array of object | The member's favourites of this type. Never empty — a type the member has no favourites under is left out of the response entirely, rather than appearing with an empty array. A member may hold several favourites of the same type. |
[].values[].id | integer (int32) | The favourite record's own id. This is the id you pass to Get member favourite by ID and to the delete endpoint — not typeId, and not the value. |
[].values[].value | string | What was favourited, as free text whose meaning depends on the type: for a site type it is the site reference, for an activity type the activity reference. The platform does not resolve it to a name for you, so you need the corresponding configuration endpoint to display it. |
Sample response
[
{
"typeId": 12345,
"typeName": "string",
"values": [
{
"id": 12345,
"value": "string"
}
]
}
]Errors
| Status | Meaning | When |
|---|---|---|
400 | Bad request | An entry in favouriteTypeIds is not a whole number. The body is Invalid favourite type ID "{value}"., naming the first bad entry — a trailing comma produces this too, because the empty segment does not parse. |
400 | Bad request | memberId is 0 or negative. The body is {memberId} is an invalid member ID. |
403 | Forbidden | The token belongs to a different member. Linked members do not help here: this endpoint disallows them. The body is The given member ID of {memberId} does not belong to the logged in member. |
404 | Not found | memberId does not exist. The body is The member does not exist. A member with no favourites returns 200 and [] instead. |
500 | Internal server error | An unexpected server-side failure while reading the favourites. |