Hilfe

Hier findet ihr Anleitungen, Erklärungen und alles Wichtige rund um Wortfreunde. Damit ihr das Beste aus eurer Content Arbeit herausholen könnt.

API Endpoints

This page provides a comprehensive overview of all available Wortfreunde API endpoints.

Base URL

All API requests should be made to:

https://api.wortfreunde.ch/v1

Authentication

All endpoints require authentication via API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Available Endpoints

Channels

MethodEndpointDescription
GET/channelsList all channels
GET/channels/{id}Get a specific channel

Posts

MethodEndpointScopeDescription
GET/channels/:channel_id/postsread:postsList all posts by channel
GET/channels/:channel_id/posts/:idread:postsGet a specific post with all details
PATCH/channels/:channel_id/posts/:id/publishwrite:postsConfirm publication of a pending post
PATCH/channels/:channel_id/posts/:id/unpublishwrite:postsRevert a published post to draft

SSO

MethodEndpointScopeDescription
POST/sso_tokenswrite:ssoCreate a one-time SSO login token

Request Format

Headers

All requests should include these headers:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json

Request Body

POST and PUT requests should send JSON data:

{
  "title": "Article Title",
  "content": "Article content...",
  "status": "draft"
}

Response Format

Success Response

{
  "data": {
    "id": "123",
    "title": "Article Title",
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Error Response

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Title is required",
    "details": {
      "field": "title",
      "rule": "required"
    }
  }
}

Pagination

List endpoints support pagination via query parameters:

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page (max: 100)

Example:

GET /channels?page=2&limit=2

Pagination Response

{
  "data": [...],
  "pagination": {
    "page": 1,
    "pages": 1,
    "count": 5,
    "per_page": 20
  }
}

Filtering

Most list endpoints support filtering:

GET /posts?status=published&tag=api

Rate Limiting

API requests are rate-limited based on your plan:

PlanRequests/Hour
Free1,000
Starter10,000
Professional50,000
EnterpriseUnlimited

Rate limit headers are included in all responses:

X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9995
X-RateLimit-Reset: 1640995200

Status Codes

CodeDescription
200Success
201Created
204No Content (successful deletion)
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Validation Error
429Too Many Requests
500Internal Server Error