summaryrefslogtreecommitdiffstats
path: root/docs/recording.md
blob: bef05eae017145118980c24ee6f4e0842ae4b5c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# Call recording API

* API v1: Base endpoint `/ocs/v2.php/apps/spreed/api/v1`: since Nextcloud 26

## Start call recording

* Required capability: `recording-v1`
* Method: `POST`
* Endpoint: `/recording/{token}`
* Data:

| Field  | Type | Description                                                                                          |
| ------ | ---- | ---------------------------------------------------------------------------------------------------- |
| status | int  | Type of call recording (see [Constants - Call recording status](constants.md#call-recording-status)) |

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request` Message: `status`. When the status to start is invalid.
        + `400 Bad Request` Message: `config`. Need to enable the config `recording`.
        + `400 Bad Request` Message: `recording`. Already have a recording in progress.
        + `400 Bad Request` Message: `call`. Call is not activated.
        + `401 Unauthorized` When the participant is a guest.
        + `403 Forbidden` When the user is not a moderator/owner.
        + `412 Precondition Failed` When the lobby is active and the user is not a moderator.

## Stop call recording

* Required capability: `recording-v1`
* Method: `DELETE`
* Endpoint: `/recording/{token}`

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request` Message: `config`. Need to enable the config `recording`.
        + `400 Bad Request` Message: `call`. Call is not activated.
        + `401 Unauthorized` When the participant is a guest.
        + `403 Forbidden` When the user is not a moderator/owner.
        + `412 Precondition Failed` When the lobby is active and the user is not a moderator.

## Store call recording

* Required capability: `recording-v1`
* Method: `POST`
* Endpoint: `/recording/{token}/store`

* Header:

| field                     | type   | Description                                                                                                                   |
| ------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `TALK_RECORDING_RANDOM`   | string | Random string that needs to be concatenated with room token to generate the checksum using the `recording_servers['secret']`. |
| `TALK_RECORDING_CHECKSUM` | string | The checksum generated with `TALK_RECORDING_RANDOM`.                                                                          |

* Data:

| field   | type   | Description                                               |
| ------- | ------ | --------------------------------------------------------- |
| `file`  | string | File with the recording in a multipart/form-data request. |
| `owner` | string | The person that started the recording.                    |

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request` Error: `invalid_file`: File in block list or invalid
        + `400 Bad Request` Error: `empty_file`: Invalid file extension
        + `400 Bad Request` Error: `file_mimetype`: Invalid mimetype
        + `400 Bad Request` Error: `file_name`. :nvalid file name
        + `400 Bad Request` Error: `file_extension`: Invalid file extension
        + `400 Bad Request` Error: `owner_participant`: Owner is not to be a participant of room
        + `400 Bad Request` Error: `owner_invalid`: Owner invalid
        + `400 Bad Request` Error: `owner_permission`: Owner have not permission to store record file
        + `401 Unauthorized` When the validation as recording server failed
        + `404 Not Found` Room not found
        + `429 Too Many Request` Brute force protection

## Dismiss store call recording notification

* Required capability: `recording-v1`
* Method: `DELETE`
* Endpoint: `/recording/{token}/notification`
* Data:

| field       | type   | Description                                                           |
| ----------- | ------ | --------------------------------------------------------------------- |
| `timestamp` | string | Timestamp in seconds and UTC time zone that notification was created. |

* Response:
    - Status code:
        + `200 OK`
        + `403 Forbidden` When the user is not a moderator/owner.
        + `404 Not Found` Room not found

## Share store call recording

* Required capability: `recording-v1`
* Method: `POST`
* Endpoint: `/recording/{token}/share-chat`
* Data:

| field       | type    | Description                                                           |
| ----------- | ------- | --------------------------------------------------------------------- |
| `timestamp` | string  | Timestamp in seconds and UTC time zone that notification was created. |
| `fileId`    | integer | File id of recording to share at the room.                            |

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request` Error: `file`: Shared file is invalid
        + `400 Bad Request` Error: `system`: Internal system error
        + `403 Forbidden` When the user is not a moderator/owne
        + `404 Not Found` Room not found

## Recording server requests

* Required capability: `recording-v1`
* Method: `POST`
* Endpoint: `/recording/backend`

* Header:

| field                     | type   | Description                                                                                                                         |
| ------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| `TALK_RECORDING_RANDOM`   | string | Random string that needs to be concatenated with request body to generate the checksum using the secret configured for the backend. |
| `TALK_RECORDING_CHECKSUM` | string | The checksum generated with `TALK_RECORDING_RANDOM`.                                                                                |

* Data:

    - Body as a JSON encoded string; format depends on the request type, see below.

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request`: When the body data does not match the expected format.
        + `403 Forbidden`: When the request validation failed.

### Started call recording

* Data format:

    ```json
    {
      "type": "started",
      "started": {
        "token": "the-token-of-the-room",
        "status": "the-type-of-recording (see [Constants - Call recording status](constants.md#call-recording-status))",
        "actor": {
          "type": "the-type-of-the-actor",
          "id": "the-id-of-the-actor",
        },
      },
    }
    ```

* Response:
    - (Additional) Status code:
        + `404 Not Found`: When the room is not found.

### Stopped call recording

* Data format:

    ```json
    {
      "type": "stopped",
      "stopped": {
        "token": "the-token-of-the-room",
        "actor": {
          "type": "the-type-of-the-actor",
          "id": "the-id-of-the-actor",
        },
      },
    }
    ```

    - `actor` is optional

* Response:
    - (Additional) Status code:
        + `404 Not Found`: When the room is not found.

### Failed call recording

* Data format:

    ```json
    {
      "type": "failed",
      "failed": {
        "token": "the-token-of-the-room",
      },
    }
    ```

* Response:
    - (Additional) Status code:
        + `404 Not Found`: When the room is not found.