From: Dave Miller Date: Fri, 26 Sep 2025 19:25:17 +0000 (-0400) Subject: Bug 1920627: Give API key examples in API docs (#202) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6525e6d90f15fed7d87f591f38f5578ce403dc1b;p=thirdparty%2Fbugzilla.git Bug 1920627: Give API key examples in API docs (#202) --- diff --git a/docs/en/rst/api/core/v1/general.rst b/docs/en/rst/api/core/v1/general.rst index 06ef5b2fbc..7118c4f585 100644 --- a/docs/en/rst/api/core/v1/general.rst +++ b/docs/en/rst/api/core/v1/general.rst @@ -113,6 +113,27 @@ any call, and you will be logged in as that user if the key is correct and has not been revoked. You can set up an API key by using the 'API Key' tab in the Preferences pages. +Examples: + +If using a GET request, make it a query param: + + :samp:`https://mysite/rest/bug/1?api_key={MY_API_KEY}` + +If using a POST or PUT request, put it in your JSON payload: + +.. code-block:: js + + { + "api_key": "MY_API_KEY", + "status": "RESOLVED", + "resolution": "FIXED" + } + +Note that it's generally not a good idea to put API keys in the query params, +as that allows it to be recorded in server logs. API calls that would normally +be sent as a GET request can also be sent as a POST request with the api_key +being the only content in your JSON payload. + **Login and Password** You can specify ``Bugzilla_login`` and ``Bugzilla_password`` or simply