From a5374c7df7aefccc2ca48b70c94ee41ea7ce895f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 30 Jan 2018 21:24:39 +0000 Subject: [PATCH 1/5] Document new rooms/$/event/$ API for fetching a single event (no ctx) --- api/client-server/sync.yaml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/api/client-server/sync.yaml b/api/client-server/sync.yaml index 34659dd0..95cd181c 100644 --- a/api/client-server/sync.yaml +++ b/api/client-server/sync.yaml @@ -366,3 +366,46 @@ paths: } tags: - Room participation + "/rooms/{roomId}/event/{eventId}": + get: + summary: Get a single event by event ID. + description: |- + Get a single event based on ``roomId/eventId``. You must have permission to + retrieve this event e.g. by being a member in the room for this event. + operationId: getOneRoomEvent + security: + - accessToken: [] + parameters: + - in: path + type: string + name: roomId + description: The ID of the room the event is in. + required: true + x-example: "!asfDuShaf7Gafaw:matrix.org" + - in: path + type: string + name: eventId + description: The event ID to get. + required: true + x-example: "$asfDuShaf7Gafaw:matrix.org" + responses: + 200: + description: The full event. + examples: + application/json: { + "content": { + "body": "Hello world!", + "msgtype": "m.text" + }, + "room_id": "!wfgy43Sg4a:matrix.org", + "sender": "@bob:matrix.org", + "event_id": "$asfDuShaf7Gafaw:matrix.org", + "type": "m.room.message" + } + schema: + allOf: + - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" + 404: + description: The event was not found or you do not have permission to read this event. + tags: + - Room participation From ebea850838711e434d9f6282b5f2ffdb75fc730c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 30 Jan 2018 21:28:16 +0000 Subject: [PATCH 2/5] Add new event fetch API to changelog --- changelogs/client_server.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelogs/client_server.rst b/changelogs/client_server.rst index 1e930e77..b0057681 100644 --- a/changelogs/client_server.rst +++ b/changelogs/client_server.rst @@ -7,6 +7,8 @@ Unreleased changes - ``POST /user_directory/search`` (`#1096 `_). + - ``GET /rooms/{roomId}/event/{eventId}`` + (`#1110 `_). - Spec clarifications: From c5816a80afb6ae469552d619c28a1b2cfd6aaf0d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 7 Feb 2018 08:22:37 +0000 Subject: [PATCH 3/5] move /rooms/{roomId}/event/{eventId} and update depr notice --- api/client-server/old_sync.yaml | 2 +- api/client-server/rooms.yaml | 43 +++++++++++++++++++++++++++++++++ api/client-server/sync.yaml | 43 --------------------------------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/api/client-server/old_sync.yaml b/api/client-server/old_sync.yaml index dd633069..d475aba3 100644 --- a/api/client-server/old_sync.yaml +++ b/api/client-server/old_sync.yaml @@ -407,7 +407,7 @@ paths: retrieve this event e.g. by being a member in the room for this event. This endpoint was deprecated in r0 of this specification. Clients - should instead call the |/rooms/{roomId}/context/{eventId}|_ API. + should instead call the |/rooms/{roomId}/event/{eventId}|_ API. operationId: getOneEvent security: - accessToken: [] diff --git a/api/client-server/rooms.yaml b/api/client-server/rooms.yaml index 176d9fc9..88c2b9d9 100644 --- a/api/client-server/rooms.yaml +++ b/api/client-server/rooms.yaml @@ -27,6 +27,49 @@ produces: securityDefinitions: $ref: definitions/security.yaml paths: + "/rooms/{roomId}/event/{eventId}": + get: + summary: Get a single event by event ID. + description: |- + Get a single event based on ``roomId/eventId``. You must have permission to + retrieve this event e.g. by being a member in the room for this event. + operationId: getOneRoomEvent + security: + - accessToken: [] + parameters: + - in: path + type: string + name: roomId + description: The ID of the room the event is in. + required: true + x-example: "!asfDuShaf7Gafaw:matrix.org" + - in: path + type: string + name: eventId + description: The event ID to get. + required: true + x-example: "$asfDuShaf7Gafaw:matrix.org" + responses: + 200: + description: The full event. + examples: + application/json: { + "content": { + "body": "Hello world!", + "msgtype": "m.text" + }, + "room_id": "!wfgy43Sg4a:matrix.org", + "sender": "@bob:matrix.org", + "event_id": "$asfDuShaf7Gafaw:matrix.org", + "type": "m.room.message" + } + schema: + allOf: + - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" + 404: + description: The event was not found or you do not have permission to read this event. + tags: + - Room participation "/rooms/{roomId}/state/{eventType}/{stateKey}": get: summary: Get the state identified by the type and key. diff --git a/api/client-server/sync.yaml b/api/client-server/sync.yaml index 95cd181c..34659dd0 100644 --- a/api/client-server/sync.yaml +++ b/api/client-server/sync.yaml @@ -366,46 +366,3 @@ paths: } tags: - Room participation - "/rooms/{roomId}/event/{eventId}": - get: - summary: Get a single event by event ID. - description: |- - Get a single event based on ``roomId/eventId``. You must have permission to - retrieve this event e.g. by being a member in the room for this event. - operationId: getOneRoomEvent - security: - - accessToken: [] - parameters: - - in: path - type: string - name: roomId - description: The ID of the room the event is in. - required: true - x-example: "!asfDuShaf7Gafaw:matrix.org" - - in: path - type: string - name: eventId - description: The event ID to get. - required: true - x-example: "$asfDuShaf7Gafaw:matrix.org" - responses: - 200: - description: The full event. - examples: - application/json: { - "content": { - "body": "Hello world!", - "msgtype": "m.text" - }, - "room_id": "!wfgy43Sg4a:matrix.org", - "sender": "@bob:matrix.org", - "event_id": "$asfDuShaf7Gafaw:matrix.org", - "type": "m.room.message" - } - schema: - allOf: - - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" - 404: - description: The event was not found or you do not have permission to read this event. - tags: - - Room participation From 4d90d2b4952c1740e9ec53e2fe10dc07db5bad24 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 7 Feb 2018 08:26:27 +0000 Subject: [PATCH 4/5] fix depr link --- specification/client_server_api.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/client_server_api.rst b/specification/client_server_api.rst index 464d20ae..1041dc15 100644 --- a/specification/client_server_api.rst +++ b/specification/client_server_api.rst @@ -1447,6 +1447,9 @@ have to wait in milliseconds before they can try again. .. |/rooms/{roomId}/context/{eventId}| replace:: ``/rooms/{roomId}/context/{eventId}`` .. _/rooms/{roomId}/context/{eventId}: #get-matrix-client-%CLIENT_MAJOR_VERSION%-rooms-roomid-context-eventid +.. |/rooms/{roomId}/event/{eventId}| replace:: ``/rooms/{roomId}/event/{eventId}`` +.. _/rooms/{roomId}/event/{eventId}: #get-matrix-client-%CLIENT_MAJOR_VERSION%-rooms-roomid-event-eventid + .. |/account/3pid| replace:: ``/account/3pid`` .. _/account/3pid: #post-matrix-client-%CLIENT_MAJOR_VERSION%-account-3pid From 04eb6c7b6517e48c3f485bc0a90a854a8d0a29cc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 7 Feb 2018 08:27:39 +0000 Subject: [PATCH 5/5] link to both context and event in depr notice as per review --- api/client-server/old_sync.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/client-server/old_sync.yaml b/api/client-server/old_sync.yaml index d475aba3..c502c239 100644 --- a/api/client-server/old_sync.yaml +++ b/api/client-server/old_sync.yaml @@ -407,7 +407,8 @@ paths: retrieve this event e.g. by being a member in the room for this event. This endpoint was deprecated in r0 of this specification. Clients - should instead call the |/rooms/{roomId}/event/{eventId}|_ API. + should instead call the |/rooms/{roomId}/event/{eventId}|_ API + or the |/rooms/{roomId}/context/{eventId}|_ API. operationId: getOneEvent security: - accessToken: []