WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto
at atb-53-theme-resolution 95 lines 2.3 kB view raw
1meta { 2 name: Get Topic 3 type: http 4 seq: 1 5} 6 7get { 8 url: {{appview_url}}/api/topics/{{topic_id}} 9} 10 11params:path { 12 topic_id: 1 13} 14 15params:query { 16 ~offset: 0 17 ~limit: 25 18} 19 20assert { 21 res.status: eq 200 22 res.body.topicId: isDefined 23 res.body.post: isDefined 24 res.body.replies: isArray 25 res.body.locked: isDefined 26 res.body.pinned: isDefined 27 res.body.total: isDefined 28 res.body.offset: isDefined 29 res.body.limit: isDefined 30} 31 32docs { 33 Get a topic (thread starter post) with paginated replies. 34 35 Path params: 36 - id: Topic post ID (bigint as string) 37 38 Query params: 39 - offset: Number of replies to skip (optional, default 0, clamped to >= 0) 40 - limit: Max replies to return (optional, default 25, max 250) 41 42 Returns: 43 { 44 "topicId": "1", 45 "locked": false, 46 "pinned": false, 47 "total": 42, 48 "offset": 0, 49 "limit": 25, 50 "post": { 51 "id": "1", 52 "did": "did:plc:...", 53 "rkey": "...", 54 "title": "Topic title", 55 "text": "Topic text", 56 "forumUri": "at://did:plc:.../space.atbb.forum.forum/self", 57 "createdAt": "2024-01-01T00:00:00.000Z", 58 "author": { 59 "did": "did:plc:...", 60 "handle": "user.bsky.social" 61 } 62 }, 63 "replies": [ 64 { 65 "id": "2", 66 "did": "did:plc:...", 67 "rkey": "...", 68 "title": null, 69 "text": "Reply text", 70 "parentPostId": "1", 71 "createdAt": "2024-01-01T00:00:00.000Z", 72 "author": { 73 "did": "did:plc:...", 74 "handle": "user.bsky.social" 75 } 76 } 77 ] 78 } 79 80 Pagination notes: 81 - total is the reply count after SQL-level moderation (bannedByMod=false), but before 82 in-memory filters (active user bans, hidden posts). Treat as an upper bound. 83 - To page through replies: increment offset by limit on each Load More click 84 - For bookmark/deep-link support: request offset=0 and limit=(desired_offset + page_size) 85 86 Moderation enforcement (fail-open: errors in mod lookups show all content): 87 - Replies from banned users are excluded from the current page 88 - Replies hidden by mod "delete" action are excluded (restored by "undelete") 89 - locked/pinned reflect most recent lock/pin action per topic 90 91 Error codes: 92 - 400: Invalid topic ID format 93 - 404: Topic not found 94 - 500: Server error 95}