🔌 Linked Wellness Content API

REST API Documentation v1.0

📋 Overview

The Linked Wellness Content API provides programmatic access to website content. This API is read-only and requires authentication via API key.

Base URL: https://api.linkedwellness.ie/api
Default Environment: master (unless specified otherwise)

🔑 Authentication

All API endpoints require a valid API key. You can provide it in two ways:

Method 1: Header (Recommended)

X-API-Key: your-api-key-here

Method 2: Query Parameter

?api_key=your-api-key-here
⚠️ Important: API access is only available from api.linkedwellness.ie domain. Requests from other domains will be rejected.

📡 API Endpoints

GET /api/content

Get all content with optional filters

Query Parameters:

website_env Optional
Filter by environment: corporate, or master. Defaults to master if not specified.
route Optional
Filter by route path (e.g., /, /student-life)
type Optional
Filter by content type: page, section, quiz
key Optional
Filter by content key

Example Request:

curl -H "X-API-Key: your-api-key" \ https://api.linkedwellness.ie/api/content
GET /api/content/route/{route}

Get all content for a specific route

Path Parameters:

route Required
The route path (e.g., /student-life, /working-life)

Query Parameters:

website_env Optional
Filter by environment. Defaults to master.

Example Request:

curl -H "X-API-Key: your-api-key" \ https://api.linkedwellness.ie/api/content/route/student-life
GET /api/content/key/{key}

Get specific content by its key

Path Parameters:

key Required
The content key (e.g., welcome.title)

Query Parameters:

website_env Optional
Filter by environment. Defaults to master.

Example Request:

curl -H "X-API-Key: your-api-key" \ https://api.linkedwellness.ie/api/content/key/welcome.title
GET /api/content/environment/{env}

Get all content for a specific environment

Path Parameters:

env Required
Environment name: corporate, or master

Example Request:

curl -H "X-API-Key: your-api-key" \ https://api.linkedwellness.ie/api/content/environment/master
GET /api/content/{id}

Get content by database ID

Path Parameters:

id Required
The content database ID

Example Request:

curl -H "X-API-Key: your-api-key" \ https://api.linkedwellness.ie/api/content/1

💻 Code Examples

JavaScript/Fetch

const apiKey = 'your-api-key-here'; // Get all content fetch('https://api.linkedwellness.ie/api/content', { headers: { 'X-API-Key': apiKey } }) .then(response => response.json()) .then(data => console.log(data));

Python

import requests api_key = 'your-api-key-here' headers = {'X-API-Key': api_key} response = requests.get( 'https://api.linkedwellness.ie/api/content', headers=headers ) data = response.json() print(data)

PHP

$apiKey = 'your-api-key-here'; $url = 'https://api.linkedwellness.ie/api/content'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'X-API-Key: ' . $apiKey ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $data = json_decode($response, true); curl_close($ch);

📤 Response Format

Success Response

{ "success": true, "data": [...], "count": 10 }

Error Responses

Status Code Description Response
401 Unauthorized API key is required or invalid
403 Forbidden Access denied - API only available from api.linkedwellness.ie
404 Not Found Resource not found

⚠️ Important Notes

📞 Support

For detailed documentation, API key generation, or support, please contact the API administrator.