Tidy: Blocks

This commit is contained in:
Adam Porter 2021-08-12 09:20:02 -05:00
parent 4df31c910b
commit e6f3ba5ad3
2 changed files with 519 additions and 514 deletions

View file

@ -13,21 +13,26 @@ Then various cleanups were done, some of which are included below:
** Change JSON example blocks to source blocks ** Change JSON example blocks to source blocks
This also changes the type of blocks that are HTTP request examples which appear to contain JSON.
#+BEGIN_SRC elisp #+BEGIN_SRC elisp
(let ((reporter (make-progress-reporter "Changing block types" 0 (buffer-size)))) (let ((reporter (make-progress-reporter "Changing block types" 0 (buffer-size))))
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward (rx bol "#+BEGIN_" (group "EXAMPLE") (0+ blank) eol) nil t) (while (re-search-forward (rx bol "#+BEGIN_" (group "EXAMPLE") (0+ blank) eol) nil t)
(save-restriction
(org-narrow-to-block)
(goto-char (match-end 0)) (goto-char (match-end 0))
(forward-line 1) (forward-line 1)
(when (save-match-data (when (save-match-data
(re-search-forward (rx (0+ blank) "{") (point-at-eol) t)) (or (re-search-forward (rx (0+ blank) "{") (point-at-eol) t)
(re-search-forward (rx bol (0+ blank) "}" (0+ blank) "\n" "#+END") nil t)))
;; Appears to be a JSON block. ;; Appears to be a JSON block.
(goto-char (match-end 1)) (goto-char (match-end 1))
(replace-match "SRC" t t nil 1) (replace-match "SRC" t t nil 1)
(insert " json") (insert " json")
(re-search-forward (rx bol "#+END_" (group "EXAMPLE") (0+ blank) eol) nil) (re-search-forward (rx bol "#+END_" (group "EXAMPLE") (0+ blank) eol) nil)
(replace-match "SRC" t t nil 1)) (replace-match "SRC" t t nil 1)))
(progress-reporter-update reporter (point))))) (progress-reporter-update reporter (point)))))
#+END_SRC #+END_SRC

View file

@ -980,7 +980,7 @@ In the REST API described in this specification, authentication works by the cli
A client should first make a request with no =auth= parameter [[#id21][[1]]]. The homeserver returns an HTTP 401 response, with a JSON body, as follows: A client should first make a request with no =auth= parameter [[#id21][[1]]]. The homeserver returns an HTTP 401 response, with a JSON body, as follows:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
Content-Type: application/json Content-Type: application/json
@ -1000,7 +1000,7 @@ A client should first make a request with no =auth= parameter [[#id21][[1]]]. Th
}, },
"session": "xxxxxx" "session": "xxxxxx"
} }
#+END_EXAMPLE #+END_SRC
In addition to the =flows=, this object contains some extra information: In addition to the =flows=, this object contains some extra information:
@ -1009,7 +1009,7 @@ In addition to the =flows=, this object contains some extra information:
The client then chooses a flow and attempts to complete the first stage. It does this by resubmitting the same request with the addition of an =auth= key in the object that it submits. This dictionary contains a =type= key whose value is the name of the authentication type that the client is attempting to complete. It must also contain a =session= key with the value of the session key given by the homeserver, if one was given. It also contains other keys dependent on the auth type being attempted. For example, if the client is attempting to complete auth type =example.type.foo=, it might submit something like this: The client then chooses a flow and attempts to complete the first stage. It does this by resubmitting the same request with the addition of an =auth= key in the object that it submits. This dictionary contains a =type= key whose value is the name of the authentication type that the client is attempting to complete. It must also contain a =session= key with the value of the session key given by the homeserver, if one was given. It also contains other keys dependent on the auth type being attempted. For example, if the client is attempting to complete auth type =example.type.foo=, it might submit something like this:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/endpoint HTTP/1.1 POST /_matrix/client/r0/endpoint HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -1022,11 +1022,11 @@ The client then chooses a flow and attempts to complete the first stage. It does
"example_credential": "verypoorsharedsecret" "example_credential": "verypoorsharedsecret"
} }
} }
#+END_EXAMPLE #+END_SRC
If the homeserver deems the authentication attempt to be successful but still requires more stages to be completed, it returns HTTP status 401 along with the same object as when no authentication was attempted, with the addition of the =completed= key which is an array of auth types the client has completed successfully: If the homeserver deems the authentication attempt to be successful but still requires more stages to be completed, it returns HTTP status 401 along with the same object as when no authentication was attempted, with the addition of the =completed= key which is an array of auth types the client has completed successfully:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
Content-Type: application/json Content-Type: application/json
@ -1047,13 +1047,13 @@ If the homeserver deems the authentication attempt to be successful but still re
}, },
"session": "xxxxxx" "session": "xxxxxx"
} }
#+END_EXAMPLE #+END_SRC
Individual stages may require more than one request to complete, in which case the response will be as if the request was unauthenticated with the addition of any other keys as defined by the auth type. Individual stages may require more than one request to complete, in which case the response will be as if the request was unauthenticated with the addition of any other keys as defined by the auth type.
If the homeserver decides that an attempt on a stage was unsuccessful, but the client may make a second attempt, it returns the same HTTP status 401 response as above, with the addition of the standard =errcode= and =error= fields describing the error. For example: If the homeserver decides that an attempt on a stage was unsuccessful, but the client may make a second attempt, it returns the same HTTP status 401 response as above, with the addition of the standard =errcode= and =error= fields describing the error. For example:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
Content-Type: application/json Content-Type: application/json
@ -1076,11 +1076,11 @@ If the homeserver decides that an attempt on a stage was unsuccessful, but the c
}, },
"session": "xxxxxx" "session": "xxxxxx"
} }
#+END_EXAMPLE #+END_SRC
If the request fails for a reason other than authentication, the server returns an error message in the standard format. For example: If the request fails for a reason other than authentication, the server returns an error message in the standard format. For example:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
HTTP/1.1 400 Bad request HTTP/1.1 400 Bad request
Content-Type: application/json Content-Type: application/json
@ -1088,7 +1088,7 @@ If the request fails for a reason other than authentication, the server returns
"errcode": "M_EXAMPLE_ERROR", "errcode": "M_EXAMPLE_ERROR",
"error": "Something was wrong" "error": "Something was wrong"
} }
#+END_EXAMPLE #+END_SRC
If the client has completed all stages of a flow, the homeserver performs the API call and returns the result as normal. Completed stages cannot be retried by clients, therefore servers must return either a 401 response with the completed stages, or the result of the API call if all stages were completed when a client retries a stage. If the client has completed all stages of a flow, the homeserver performs the API call and returns the result as normal. Completed stages cannot be retried by clients, therefore servers must return either a 401 response with the completed stages, or the result of the API call if all stages were completed when a client retries a stage.
@ -1403,7 +1403,7 @@ Once a client receives the notificaton that the authentication stage has been co
A client webapp might use the following javascript to open a popup window which will handle unknown login types: A client webapp might use the following javascript to open a popup window which will handle unknown login types:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
/** /**
,* Arguments: ,* Arguments:
,* homeserverUrl: the base url of the homeserver (eg "https://matrix.org") ,* homeserverUrl: the base url of the homeserver (eg "https://matrix.org")
@ -1453,7 +1453,7 @@ A client webapp might use the following javascript to open a popup window which
popupWindow = window.open(url); popupWindow = window.open(url);
} }
#+END_EXAMPLE #+END_SRC
*** [[#id199][5.4.6   Identifier types]] *** [[#id199][5.4.6   Identifier types]]
:PROPERTIES: :PROPERTIES:
@ -1749,7 +1749,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/login HTTP/1.1 POST /_matrix/client/r0/login HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -1762,7 +1762,7 @@ Example request:
"password": "ilovebananas", "password": "ilovebananas",
"initial_device_display_name": "Jungle Phone" "initial_device_display_name": "Jungle Phone"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -2020,7 +2020,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/register?kind=user HTTP/1.1 POST /_matrix/client/r0/register?kind=user HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -2036,7 +2036,7 @@ Example request:
"initial_device_display_name": "Jungle Phone", "initial_device_display_name": "Jungle Phone",
"inhibit_login": false "inhibit_login": false
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -2200,7 +2200,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/register/email/requestToken HTTP/1.1 POST /_matrix/client/r0/register/email/requestToken HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -2212,7 +2212,7 @@ Example request:
"id_server": "id.example.com", "id_server": "id.example.com",
"id_access_token": "string" "id_access_token": "string"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -2335,7 +2335,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/register/msisdn/requestToken HTTP/1.1 POST /_matrix/client/r0/register/msisdn/requestToken HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -2348,7 +2348,7 @@ Example request:
"id_server": "id.example.com", "id_server": "id.example.com",
"id_access_token": "string" "id_access_token": "string"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -2448,7 +2448,7 @@ Additional authentication information for the user-interactive authentication AP
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/password HTTP/1.1 POST /_matrix/client/r0/account/password HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -2461,7 +2461,7 @@ Example request:
"example_credential": "verypoorsharedsecret" "example_credential": "verypoorsharedsecret"
} }
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -2591,7 +2591,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/password/email/requestToken HTTP/1.1 POST /_matrix/client/r0/account/password/email/requestToken HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -2603,7 +2603,7 @@ Example request:
"id_server": "id.example.com", "id_server": "id.example.com",
"id_access_token": "string" "id_access_token": "string"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -2711,7 +2711,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/password/msisdn/requestToken HTTP/1.1 POST /_matrix/client/r0/account/password/msisdn/requestToken HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -2721,7 +2721,7 @@ Example request:
"phone_number": "07700900001", "phone_number": "07700900001",
"send_attempt": 1 "send_attempt": 1
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -2818,7 +2818,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/deactivate HTTP/1.1 POST /_matrix/client/r0/account/deactivate HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -2830,7 +2830,7 @@ Example request:
}, },
"id_server": "example.org" "id_server": "example.org"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -3099,7 +3099,7 @@ ThreePidCredentials
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/3pid HTTP/1.1 POST /_matrix/client/r0/account/3pid HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -3111,7 +3111,7 @@ Example request:
"client_secret": "d0n'tT3ll" "client_secret": "d0n'tT3ll"
} }
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -3190,7 +3190,7 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/3pid/add HTTP/1.1 POST /_matrix/client/r0/account/3pid/add HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -3198,7 +3198,7 @@ Example request:
"sid": "abc123987", "sid": "abc123987",
"client_secret": "d0n'tT3ll" "client_secret": "d0n'tT3ll"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -3303,7 +3303,7 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/3pid/bind HTTP/1.1 POST /_matrix/client/r0/account/3pid/bind HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -3313,7 +3313,7 @@ Example request:
"sid": "abc123987", "sid": "abc123987",
"client_secret": "d0n'tT3ll" "client_secret": "d0n'tT3ll"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -3389,7 +3389,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/3pid/delete HTTP/1.1 POST /_matrix/client/r0/account/3pid/delete HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -3398,7 +3398,7 @@ Example request:
"medium": "email", "medium": "email",
"address": "example@example.org" "address": "example@example.org"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -3462,7 +3462,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/3pid/unbind HTTP/1.1 POST /_matrix/client/r0/account/3pid/unbind HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -3471,7 +3471,7 @@ Example request:
"medium": "email", "medium": "email",
"address": "example@example.org" "address": "example@example.org"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -3558,7 +3558,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/3pid/email/requestToken HTTP/1.1 POST /_matrix/client/r0/account/3pid/email/requestToken HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -3570,7 +3570,7 @@ Example request:
"id_server": "id.example.com", "id_server": "id.example.com",
"id_access_token": "string" "id_access_token": "string"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -3690,7 +3690,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/account/3pid/msisdn/requestToken HTTP/1.1 POST /_matrix/client/r0/account/3pid/msisdn/requestToken HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -3703,7 +3703,7 @@ Example request:
"id_server": "id.example.com", "id_server": "id.example.com",
"id_access_token": "string" "id_access_token": "string"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -4234,7 +4234,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/user/%40alice%3Aexample.com/filter HTTP/1.1 POST /_matrix/client/r0/user/%40alice%3Aexample.com/filter HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -4288,7 +4288,7 @@ Example request:
"sender" "sender"
] ]
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -6957,7 +6957,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/rooms/%21636q39766251%3Aexample.com/state/m.room.member/%40alice%3Aexample.com HTTP/1.1 PUT /_matrix/client/r0/rooms/%21636q39766251%3Aexample.com/state/m.room.member/%40alice%3Aexample.com HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -6966,7 +6966,7 @@ Example request:
"avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF", "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF",
"displayname": "Alice Margatroid" "displayname": "Alice Margatroid"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -7104,7 +7104,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/rooms/%21636q39766251%3Aexample.com/send/m.room.message/35 HTTP/1.1 PUT /_matrix/client/r0/rooms/%21636q39766251%3Aexample.com/send/m.room.message/35 HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -7112,7 +7112,7 @@ Example request:
"msgtype": "m.text", "msgtype": "m.text",
"body": "hello" "body": "hello"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -7243,14 +7243,14 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/rooms/%21637q39766251%3Aexample.com/redact/bai2b1i9%3Amatrix.org/37 HTTP/1.1 PUT /_matrix/client/r0/rooms/%21637q39766251%3Aexample.com/redact/bai2b1i9%3Amatrix.org/37 HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"reason": "Indecent material" "reason": "Indecent material"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -7425,7 +7425,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/createRoom HTTP/1.1 POST /_matrix/client/r0/createRoom HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -7438,7 +7438,7 @@ Example request:
"m.federate": false "m.federate": false
} }
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -7519,14 +7519,14 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/directory/room/%23monkeys%3Amatrix.org HTTP/1.1 PUT /_matrix/client/r0/directory/room/%23monkeys%3Amatrix.org HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"room_id": "!abnjk1jdasj98:capuchins.com" "room_id": "!abnjk1jdasj98:capuchins.com"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -7932,14 +7932,14 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21d41d8cd%3Amatrix.org/invite HTTP/1.1 POST /_matrix/client/r0/rooms/%21d41d8cd%3Amatrix.org/invite HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"user_id": "@cheeky_monkey:matrix.org" "user_id": "@cheeky_monkey:matrix.org"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -8057,7 +8057,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21d41d8cd%3Amatrix.org/join HTTP/1.1 POST /_matrix/client/r0/rooms/%21d41d8cd%3Amatrix.org/join HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -8073,7 +8073,7 @@ Example request:
} }
} }
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -8185,7 +8185,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/join/%23monkeys%3Amatrix.org?server_name=matrix.org&server_name=elsewhere.ca HTTP/1.1 POST /_matrix/client/r0/join/%23monkeys%3Amatrix.org?server_name=matrix.org&server_name=elsewhere.ca HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -8201,7 +8201,7 @@ Example request:
} }
} }
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -8447,7 +8447,7 @@ The reason the user has been kicked. This will be supplied as the =reason= on th
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21e42d8c%3Amatrix.org/kick HTTP/1.1 POST /_matrix/client/r0/rooms/%21e42d8c%3Amatrix.org/kick HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -8455,7 +8455,7 @@ Example request:
"reason": "Telling unfunny jokes", "reason": "Telling unfunny jokes",
"user_id": "@cheeky_monkey:matrix.org" "user_id": "@cheeky_monkey:matrix.org"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -8556,7 +8556,7 @@ The reason the user has been banned. This will be supplied as the =reason= on th
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21e42d8c%3Amatrix.org/ban HTTP/1.1 POST /_matrix/client/r0/rooms/%21e42d8c%3Amatrix.org/ban HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -8564,7 +8564,7 @@ Example request:
"reason": "Telling unfunny jokes", "reason": "Telling unfunny jokes",
"user_id": "@cheeky_monkey:matrix.org" "user_id": "@cheeky_monkey:matrix.org"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -8632,14 +8632,14 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21e42d8c%3Amatrix.org/unban HTTP/1.1 POST /_matrix/client/r0/rooms/%21e42d8c%3Amatrix.org/unban HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"user_id": "@cheeky_monkey:matrix.org" "user_id": "@cheeky_monkey:matrix.org"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -8776,14 +8776,14 @@ The new visibility setting for the room. Defaults to 'public'. One of: ["private
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/directory/list/room/%21curbf%3Amatrix.org HTTP/1.1 PUT /_matrix/client/r0/directory/list/room/%21curbf%3Amatrix.org HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"visibility": "public" "visibility": "public"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -8997,7 +8997,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/publicRooms HTTP/1.1 POST /_matrix/client/r0/publicRooms HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -9009,7 +9009,7 @@ Example request:
"include_all_networks": false, "include_all_networks": false,
"third_party_instance_id": "irc" "third_party_instance_id": "irc"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -9101,7 +9101,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/user_directory/search HTTP/1.1 POST /_matrix/client/r0/user_directory/search HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -9109,7 +9109,7 @@ Example request:
"search_term": "foo", "search_term": "foo",
"limit": 10 "limit": 10
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -9187,14 +9187,14 @@ The new display name for this user.
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/profile/%40alice%3Aexample.com/displayname HTTP/1.1 PUT /_matrix/client/r0/profile/%40alice%3Aexample.com/displayname HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"displayname": "Alice Margatroid" "displayname": "Alice Margatroid"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -9314,14 +9314,14 @@ The new avatar URL for this user.
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/profile/%40alice%3Aexample.com/avatar_url HTTP/1.1 PUT /_matrix/client/r0/profile/%40alice%3Aexample.com/avatar_url HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"avatar_url": "mxc://matrix.org/wefh34uihSDRGhw34" "avatar_url": "mxc://matrix.org/wefh34uihSDRGhw34"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -11109,7 +11109,7 @@ The length of time in milliseconds to mark this user as typing.
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/rooms/%21wefh3sfukhs%3Aexample.com/typing/%40alice%3Aexample.com HTTP/1.1 PUT /_matrix/client/r0/rooms/%21wefh3sfukhs%3Aexample.com/typing/%40alice%3Aexample.com HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -11117,7 +11117,7 @@ Example request:
"typing": true, "typing": true,
"timeout": 30000 "timeout": 30000
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -11431,7 +11431,7 @@ The event ID to set the read receipt location at. This is equivalent to calling
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21somewhere%3Aexample.org/read_markers HTTP/1.1 POST /_matrix/client/r0/rooms/%21somewhere%3Aexample.org/read_markers HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -11439,7 +11439,7 @@ Example request:
"m.fully_read": "$somewhere:example.org", "m.fully_read": "$somewhere:example.org",
"m.read": "$elsewhere:example.org" "m.read": "$elsewhere:example.org"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -11582,7 +11582,7 @@ The status message to attach to this state.
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/presence/%40alice%3Aexample.com/status HTTP/1.1 PUT /_matrix/client/r0/presence/%40alice%3Aexample.com/status HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -11590,7 +11590,7 @@ Example request:
"presence": "online", "presence": "online",
"status_msg": "I am here." "status_msg": "I am here."
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -12449,7 +12449,7 @@ The messages to send. A map from user ID, to a map from device ID to message bod
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/sendToDevice/m.new_device/35 HTTP/1.1 PUT /_matrix/client/r0/sendToDevice/m.new_device/35 HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -12462,7 +12462,7 @@ Example request:
} }
} }
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -12690,14 +12690,14 @@ The new display name for this device. If not given, the display name is unchange
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/devices/QBUAZIFURK HTTP/1.1 PUT /_matrix/client/r0/devices/QBUAZIFURK HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"display_name": "My other phone" "display_name": "My other phone"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -12759,7 +12759,7 @@ Additional authentication information for the user-interactive authentication AP
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
DELETE /_matrix/client/r0/devices/QBUAZIFURK HTTP/1.1 DELETE /_matrix/client/r0/devices/QBUAZIFURK HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -12770,7 +12770,7 @@ Example request:
"example_credential": "verypoorsharedsecret" "example_credential": "verypoorsharedsecret"
} }
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -12853,7 +12853,7 @@ Additional authentication information for the user-interactive authentication AP
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/delete_devices HTTP/1.1 POST /_matrix/client/r0/delete_devices HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -12868,7 +12868,7 @@ Example request:
"example_credential": "verypoorsharedsecret" "example_credential": "verypoorsharedsecret"
} }
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -14272,7 +14272,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/keys/upload HTTP/1.1 POST /_matrix/client/r0/keys/upload HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -14314,7 +14314,7 @@ Example request:
} }
} }
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -14399,7 +14399,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/keys/query HTTP/1.1 POST /_matrix/client/r0/keys/query HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -14410,7 +14410,7 @@ Example request:
}, },
"token": "string" "token": "string"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -14495,7 +14495,7 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/keys/claim HTTP/1.1 POST /_matrix/client/r0/keys/claim HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -14507,7 +14507,7 @@ Example request:
} }
} }
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -14955,7 +14955,7 @@ If true, the homeserver should add another pusher with the given pushkey and App
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/pushers/set HTTP/1.1 POST /_matrix/client/r0/pushers/set HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -14973,7 +14973,7 @@ Example request:
}, },
"append": false "append": false
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -16130,7 +16130,7 @@ Only applicable to =content= rules. The glob- style pattern to match against.
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/pushrules/global/content/nocake?before=someRuleId&after=anotherRuleId HTTP/1.1 PUT /_matrix/client/r0/pushrules/global/content/nocake?before=someRuleId&after=anotherRuleId HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -16140,7 +16140,7 @@ Example request:
"notify" "notify"
] ]
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -16293,14 +16293,14 @@ boolean
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/pushrules/global/content/nocake/enabled HTTP/1.1 PUT /_matrix/client/r0/pushrules/global/content/nocake/enabled HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"enabled": true "enabled": true
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -16428,7 +16428,7 @@ actions
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/pushrules/global/room/%23spam%3Aexample.com/actions HTTP/1.1 PUT /_matrix/client/r0/pushrules/global/room/%23spam%3Aexample.com/actions HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -16437,7 +16437,7 @@ Example request:
"notify" "notify"
] ]
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -16934,7 +16934,7 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21d41d8cd%3Amatrix.org/invite HTTP/1.1 POST /_matrix/client/r0/rooms/%21d41d8cd%3Amatrix.org/invite HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -16944,7 +16944,7 @@ Example request:
"medium": "email", "medium": "email",
"address": "cheeky@monkey.com" "address": "cheeky@monkey.com"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses:
@ -17928,14 +17928,14 @@ A number in a range =[0,1]= describing a relative position of the room under the
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/user/%40alice%3Aexample.com/rooms/%21726s6s6q%3Aexample.com/tags/u.work HTTP/1.1 PUT /_matrix/client/r0/user/%40alice%3Aexample.com/rooms/%21726s6s6q%3Aexample.com/tags/u.work HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"order": 0.25 "order": 0.25
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -18062,14 +18062,14 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/user/%40alice%3Aexample.com/account_data/org.example.custom.config HTTP/1.1 PUT /_matrix/client/r0/user/%40alice%3Aexample.com/account_data/org.example.custom.config HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"custom_account_data_key": "custom_config_value" "custom_account_data_key": "custom_config_value"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -18169,14 +18169,14 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
PUT /_matrix/client/r0/user/%40alice%3Aexample.com/rooms/%21726s6s6q%3Aexample.com/account_data/org.example.custom.room.config HTTP/1.1 PUT /_matrix/client/r0/user/%40alice%3Aexample.com/rooms/%21726s6s6q%3Aexample.com/account_data/org.example.custom.room.config HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"custom_account_data_key": "custom_account_data_value" "custom_account_data_key": "custom_account_data_value"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -18952,7 +18952,7 @@ string
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21637q39766251%3Aexample.com/report/%24something%3Aexample.org HTTP/1.1 POST /_matrix/client/r0/rooms/%21637q39766251%3Aexample.com/report/%24something%3Aexample.org HTTP/1.1
Content-Type: application/json Content-Type: application/json
@ -18960,7 +18960,7 @@ Example request:
"score": -100, "score": -100,
"reason": "this makes me sad" "reason": "this makes me sad"
} }
#+END_EXAMPLE #+END_SRC
Response: Response:
@ -19886,14 +19886,14 @@ Response format:
Example request: Example request:
#+BEGIN_EXAMPLE #+BEGIN_SRC json
POST /_matrix/client/r0/rooms/%21oldroom%3Aexample.org/upgrade HTTP/1.1 POST /_matrix/client/r0/rooms/%21oldroom%3Aexample.org/upgrade HTTP/1.1
Content-Type: application/json Content-Type: application/json
{ {
"new_version": "2" "new_version": "2"
} }
#+END_EXAMPLE #+END_SRC
Responses: Responses: