From 229cdfce90de3dce7ea113b1d992d34f0f9a7760 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Thu, 21 Dec 2017 22:43:35 -0330 Subject: [PATCH] markdown: Add a macro for invalid API key JSON response. The JSON response for when an invalid API key is used to initiate an API call seems to be identical in every case, so this macro can be reused all the time. --- templates/zerver/api/private-message.md | 9 +-------- templates/zerver/api/stream-message.md | 9 +-------- .../zerver/help/include/invalid-api-key-json-response.md | 8 ++++++++ 3 files changed, 10 insertions(+), 16 deletions(-) create mode 100644 templates/zerver/help/include/invalid-api-key-json-response.md diff --git a/templates/zerver/api/private-message.md b/templates/zerver/api/private-message.md index e01e5e49aa..56a1332459 100644 --- a/templates/zerver/api/private-message.md +++ b/templates/zerver/api/private-message.md @@ -128,11 +128,4 @@ address is invalid: } ``` -A typical failed JSON response for when the API key is invalid: - -``` -{ - 'msg':'Invalid API key', - 'result':'error' -} -``` +{!invalid-api-key-json-response.md!} diff --git a/templates/zerver/api/stream-message.md b/templates/zerver/api/stream-message.md index afdab1b7cc..f2fe8d7083 100644 --- a/templates/zerver/api/stream-message.md +++ b/templates/zerver/api/stream-message.md @@ -147,11 +147,4 @@ A typical failed JSON response for when the target stream does not exist: } ``` -A typical failed JSON response for when the API key is invalid: - -``` -{ - 'msg':'Invalid API key', - 'result':'error' -} -``` +{!invalid-api-key-json-response.md!} diff --git a/templates/zerver/help/include/invalid-api-key-json-response.md b/templates/zerver/help/include/invalid-api-key-json-response.md new file mode 100644 index 0000000000..94e45328c7 --- /dev/null +++ b/templates/zerver/help/include/invalid-api-key-json-response.md @@ -0,0 +1,8 @@ +A typical failed JSON response for when the API key is invalid: + +``` +{ + 'msg':'Invalid API key', + 'result':'error' +} +```