Page Introduction

Messages namespace

This namespace page contains request/response examples, endpoint matrix, and implementation-ready method details for frontend API clients.

  • Use quick index for direct navigation to endpoint details.
  • Use matrix view to verify auth and method-path combinations.
  • Test namespace calls in Workshop Try-It before integrating UI actions.

Workshop Namespace

Messages

Workshop messaging endpoints (inbox, thread, send).

5Endpoint methods

Endpoint Quick Index

Click an endpoint to jump to details and code examples.

Endpoint Matrix

MethodPathAuthSummary
GET/api/ws/messagesBearerList inbox threads
POST/api/ws/messagesBearerSend message (by booking_id)
GET/api/ws/messages/threadBearerGet thread messages (query param)
GET/api/ws/messages/thread/:booking_idBearerGet thread messages (path param)
POST/api/ws/messages/thread/:booking_id/sendBearerSend message to thread

Detailed Endpoints

GET/api/ws/messages

List inbox threads

Returns the workshop inbox as threads grouped by booking.

Auth: BearerSource: API-DOC/workshop-rules/messages.md

Request Example

This endpoint does not use a JSON body. Send path/query parameters and required headers.

Response Example

{
  "data": {
    "id": 123
  }
}
Node.js Axios example
import axios from "axios";

const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

async function run() {
  const response = await axios({
    method: "get",
    url: `${BASE_URL}/api/ws/messages`,
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${ACCESS_TOKEN}`,
    },
    timeout: 20000,
  });

  console.log(response.data);
}

run().catch((error) => {
  console.error(error.response?.data ?? error.message);
});
cURL example
BASE_URL="${MINBIL_API_BASE_URL:-http://localhost:5000}"
API_KEY="${MINBIL_API_KEY:-YOUR_API_KEY}"
ACCESS_TOKEN="${MINBIL_WS_ACCESS_TOKEN:-YOUR_BEARER_TOKEN}"

curl -X GET "${BASE_URL}/api/ws/messages" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
Fetch example
const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

const response = await fetch(`${BASE_URL}/api/ws/messages`, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
POST/api/ws/messages

Send message (by booking_id)

Sends a message to a booking thread. Supports JSON or multipart/form-data.

Auth: BearerSource: API-DOC/workshop-rules/messages.md

Request Example

{
  "body": {
    "example_field": "example_value"
  }
}

Response Example

{
  "success": true,
  "message": "Operation completed"
}
Node.js Axios example
import axios from "axios";

const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

async function run() {
  const response = await axios({
    method: "post",
    url: `${BASE_URL}/api/ws/messages`,
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${ACCESS_TOKEN}`,
    },
    data: {
      "example_field": "example_value"
    },
    timeout: 20000,
  });

  console.log(response.data);
}

run().catch((error) => {
  console.error(error.response?.data ?? error.message);
});
cURL example
BASE_URL="${MINBIL_API_BASE_URL:-http://localhost:5000}"
API_KEY="${MINBIL_API_KEY:-YOUR_API_KEY}"
ACCESS_TOKEN="${MINBIL_WS_ACCESS_TOKEN:-YOUR_BEARER_TOKEN}"

curl -X POST "${BASE_URL}/api/ws/messages" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \\
  -d '{
  "example_field": "example_value"
}'
Fetch example
const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

const response = await fetch(`${BASE_URL}/api/ws/messages`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
  body: JSON.stringify({
    "example_field": "example_value"
  }),
});

const data = await response.json();
console.log(data);
GET/api/ws/messages/thread

Get thread messages (query param)

Fetch messages in a thread using the query parameter ?id=<booking_id>.

Auth: BearerSource: API-DOC/workshop-rules/messages.md

Request Example

This endpoint does not use a JSON body. Send path/query parameters and required headers.

Response Example

{
  "data": {
    "id": 123
  }
}
Node.js Axios example
import axios from "axios";

const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

async function run() {
  const response = await axios({
    method: "get",
    url: `${BASE_URL}/api/ws/messages/thread`,
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${ACCESS_TOKEN}`,
    },
    timeout: 20000,
  });

  console.log(response.data);
}

run().catch((error) => {
  console.error(error.response?.data ?? error.message);
});
cURL example
BASE_URL="${MINBIL_API_BASE_URL:-http://localhost:5000}"
API_KEY="${MINBIL_API_KEY:-YOUR_API_KEY}"
ACCESS_TOKEN="${MINBIL_WS_ACCESS_TOKEN:-YOUR_BEARER_TOKEN}"

curl -X GET "${BASE_URL}/api/ws/messages/thread" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
Fetch example
const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

const response = await fetch(`${BASE_URL}/api/ws/messages/thread`, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
GET/api/ws/messages/thread/:booking_id

Get thread messages (path param)

Fetch messages in a thread using the path parameter {booking_id}.

Auth: BearerSource: API-DOC/workshop-rules/messages.md

Request Example

This endpoint does not use a JSON body. Send path/query parameters and required headers.

Response Example

{
  "data": {
    "id": 123
  }
}
Node.js Axios example
import axios from "axios";

const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

async function run() {
  // Replace path params before calling endpoint: booking_id
  const response = await axios({
    method: "get",
    url: `${BASE_URL}/api/ws/messages/thread/:booking_id`,
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${ACCESS_TOKEN}`,
    },
    timeout: 20000,
  });

  console.log(response.data);
}

run().catch((error) => {
  console.error(error.response?.data ?? error.message);
});
cURL example
BASE_URL="${MINBIL_API_BASE_URL:-http://localhost:5000}"
API_KEY="${MINBIL_API_KEY:-YOUR_API_KEY}"
ACCESS_TOKEN="${MINBIL_WS_ACCESS_TOKEN:-YOUR_BEARER_TOKEN}"

curl -X GET "${BASE_URL}/api/ws/messages/thread/:booking_id" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
Fetch example
const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

const response = await fetch(`${BASE_URL}/api/ws/messages/thread/:booking_id`, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
POST/api/ws/messages/thread/:booking_id/send

Send message to thread

Sends a message to a specific thread using the path parameter {booking_id}. Supports JSON or multipart/form-data.

Auth: BearerSource: API-DOC/workshop-rules/messages.md

Request Example

{
  "path_params": {
    "booking_id": 123
  },
  "body": {
    "example_field": "example_value"
  }
}

Response Example

{
  "success": true,
  "message": "Operation completed"
}
Node.js Axios example
import axios from "axios";

const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

async function run() {
  // Replace path params before calling endpoint: booking_id
  const response = await axios({
    method: "post",
    url: `${BASE_URL}/api/ws/messages/thread/:booking_id/send`,
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${ACCESS_TOKEN}`,
    },
    data: {
      "example_field": "example_value"
    },
    timeout: 20000,
  });

  console.log(response.data);
}

run().catch((error) => {
  console.error(error.response?.data ?? error.message);
});
cURL example
BASE_URL="${MINBIL_API_BASE_URL:-http://localhost:5000}"
API_KEY="${MINBIL_API_KEY:-YOUR_API_KEY}"
ACCESS_TOKEN="${MINBIL_WS_ACCESS_TOKEN:-YOUR_BEARER_TOKEN}"

curl -X POST "${BASE_URL}/api/ws/messages/thread/:booking_id/send" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \\
  -d '{
  "example_field": "example_value"
}'
Fetch example
const BASE_URL = process.env.MINBIL_API_BASE_URL ?? "http://localhost:5000";
const API_KEY = process.env.MINBIL_API_KEY ?? "YOUR_API_KEY";
const ACCESS_TOKEN = process.env.MINBIL_WS_ACCESS_TOKEN ?? "YOUR_BEARER_TOKEN";

const response = await fetch(`${BASE_URL}/api/ws/messages/thread/:booking_id/send`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
  body: JSON.stringify({
    "example_field": "example_value"
  }),
});

const data = await response.json();
console.log(data);