Recommendations - Huddle/huddle-apis GitHub Wiki

Summary

Recommendations are a relevance-ordered list of documents suggested for a user. The resource is served by the Files API; public URLs use the /files/ prefix.

The userId in the path must be the currently authenticated user; you cannot request another user’s list.

Operations

Method Path Purpose Details
GET /files/documents/recommendations/123 Get recommended documents Jump

Get recommended documents

Request

Method Path
GET /files/documents/recommendations/{userId}

Optional query keys (present on the URI template only; not used to slice results in the current implementation): page, pagesize.

Example (XML)

Request

GET /files/documents/recommendations/123 HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherooty

Response (recommendations present)

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<recommendations>
  <link rel="self" href="https://api.example.com/files/documents/recommendations/123" />
  <recommendation>
    <document>
      <link rel="self" href="https://api.example.com/files/documents/1001" />
    </document>
  </recommendation>
  <recommendation>
    <document>
      <link rel="self" href="https://api.example.com/files/documents/1002" />
    </document>
  </recommendation>
</recommendations>

Each recommendation uses the compact shape: a document element whose link entries identify the document (typically rel="self"). Titles, descriptions, and workspace blocks are not emitted by the current Files API view builder (a fuller RecommendationFullView type exists in code but is not used for this endpoint today).

Response (no recommendations)

HTTP/1.1 204 No Content

Example (JSON)

Request

GET /files/documents/recommendations/123 HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
  "links": [
    { "rel": "self", "href": "https://api.example.com/files/documents/recommendations/123" }
  ],
  "recommendations": [
    {
      "document": {
        "links": [
          { "rel": "self", "href": "https://api.example.com/files/documents/1001" }
        ]
      }
    },
    {
      "document": {
        "links": [
          { "rel": "self", "href": "https://api.example.com/files/documents/1002" }
        ]
      }
    }
  ]
}

Properties

Name Description
recommendation One suggested document, as a compact document with links.
document Use GET on the document self URI for full metadata (Document).

Link relations

Name Description Methods
self This recommendations list GET

Status codes

Code Meaning
200 OK Body contains recommendations
204 No Content No recommendations for this user
401 Unauthorized Missing or invalid token
403 Forbidden Authenticated user is not allowed to read this resource (e.g. userId does not match the token)

Responses may be cacheable per Files API policy (private, short max-age in typical setups).

Schema (informal)

recommendations = element recommendations {
  link+,
  recommendation*
}

recommendation = element recommendation {
  element document {
    link+
  }
}

See also

  • Document — full document representation behind each self link
⚠️ **GitHub.com Fallback** ⚠️