From 144c50971a1a3d081b9648e5f402713aeace7307 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Mon, 10 Aug 2026 20:41:54 +0800 Subject: [PATCH] fix(core-api): take the chat sender from the channel's own participants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send Message posts {{chat_participant_id}} as its sender, and that was only set by Add Participant — which runs at 8000, five requests after Send Message at 3000. So the sender was an unresolved variable and the API answered "Sender of chat message not found", taking Create Read Receipt and Delete Message down with it. Creating a channel already adds the creator as a participant, and the response carries them: participants[0].id. Capturing from there fixes all three without touching the folder's order, which reads correctly as documentation — create a channel, send a message, then manage participants. Reordering so a participant had to be added before a message could be sent would have made the docs worse to fix a test. Co-Authored-By: Claude Opus 5 --- .../Chat Channels/Create Chat Channel.request.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/postman/collections/Fleetbase Core API/Chat Channels/Create Chat Channel.request.yaml b/postman/collections/Fleetbase Core API/Chat Channels/Create Chat Channel.request.yaml index 3e84794..0be3859 100644 --- a/postman/collections/Fleetbase Core API/Chat Channels/Create Chat Channel.request.yaml +++ b/postman/collections/Fleetbase Core API/Chat Channels/Create Chat Channel.request.yaml @@ -19,5 +19,13 @@ scripts: var json_response = pm.response.json(); let cv = pm.environment; cv.set("chat_channel_id", json_response.id); + + // The creator is added as a participant when the channel is created, and + // Send Message needs a participant as its sender. Taking it from here means + // the folder keeps its documentation order — create, send, then manage + // participants — instead of having to add a participant before sending. + if (Array.isArray(json_response.participants) && json_response.participants.length) { + cv.set("chat_participant_id", json_response.participants[0].id); + } language: text/javascript order: 2000 \ No newline at end of file