Skip to main content

Documentation Index

Fetch the complete documentation index at: https://api.docs.onlydrams.app/llms.txt

Use this file to discover all available pages before exploring further.

ENDPOINTS
GET /odis/v1/communities/:community_id/posts
GET /odis/v1/communities/:community_id/posts/:id
POST /odis/v1/communities/:community_id/posts
PATCH /odis/v1/communities/:community_id/posts/:id
DELETE /odis/v1/communities/:community_id/posts/:id
POST /odis/v1/communities/:community_id/posts/:id/publish
POST /odis/v1/communities/:community_id/posts/:id/archive
POST /odis/v1/communities/:community_id/posts/:id/polls/:poll_id/vote
DELETE /odis/v1/communities/:community_id/posts/:id/polls/:poll_id/vote

Overview

Community posts are content created by community owners for their members. Posts support rich content including HTML text, external links, images, and interactive polls.

Authentication

Authorization levels:
  • Community Owner: Full access to create, edit, and delete posts
  • Admin: Full access to all community posts
  • Community Member: Read access to posts visible to their tier
  • Authenticated User: Read access to public community information

Community Post Object

{
  "id": 1,
  "title": "Welcome to the Community!",
  "content": "<p>This is the first post...</p>",
  "status": "published",
  "published_at": "2024-11-01T10:00:00Z",
  "link_url": "https://example.com/article",
  "link_title": "Related Article",
  "link_description": "Check out this article...",
  "visible_to_all_tiers": true,
  "has_poll": true,
  "has_link": true,
  "has_images": true,
  "image_count": 3,
  "image_urls": ["https://...", "https://..."],
  "visible_tier_names": ["All Tiers"],
  "content_preview": "This is the first post...",
  "user": {
    "id": 100,
    "username": "whisky_master"
  },
  "community": {
    "id": 1,
    "name": "Whisky Enthusiasts"
  },
  "poll": {
    "id": 1,
    "question": "What's your favorite whisky type?",
    "multiple_choice": false,
    "expires_at": "2024-11-15T00:00:00Z",
    "total_votes": 42
  },
  "created_at": "2024-11-01T09:30:00Z",
  "updated_at": "2024-11-01T10:00:00Z"
}

Post Status

Posts have three possible statuses:
  • draft - Not visible to members, work in progress
  • published - Visible to members based on tier visibility settings
  • archived - Hidden from members but preserved

Content Types

Posts must have at least one of:
  • Text Content: HTML-formatted content (max 10,000 characters)
  • External Link: URL with optional title and description
  • Poll: Interactive voting component
Posts can also include:
  • Images: Multiple images (uploaded as base64)
  • Mixed Content: Combination of text, links, images, and polls

Tier Visibility

Control which members can view posts:
  • All Tiers: Set visible_to_all_tiers: true
  • Specific Tiers: Set visible_to_all_tiers: false and provide visible_tier_ids array
  • Access Control: Members can only see posts visible to their subscribed tier

Polls

Posts can include interactive polls with:
  • Question: Main poll question (max 500 characters)
  • Options: 2-10 answer choices
  • Voting Mode: Single choice or multiple choice
  • Expiration: Optional expiration date
  • Results: Visible to all voters

Images

Multiple images can be attached to posts:
  • Format: Base64-encoded strings
  • Supported Types: PNG, JPEG, GIF, WebP
  • Storage: Automatically uploaded to cloud storage
  • Display: Image URLs returned in post object