1

Using the Bugzilla 5.0 REST API, how do I send the API key in a header?

The following works with a 200 response and creates a bug:

curl -Ski -X POST -H "Content-Type: application/json"
-H "Accept: application/json"
--data "@$HOME/bug_attrs.json"
"https://fmd-bugzil-01tst.vrt.sourcefire.com/rest/bug?Bugzilla_api_key=ibMexQ7suwgyiYNskgxgBDqrXGLV5Jkogj1KSYL0"

But sending it in the header returns a 401:

curl -Ski -X POST -H "Content-Type: application/json"
-H "Accept: application/json"
-H "X-BUGZILLA-API-KEY: ibMexQ7suwgyiYNskgxgBDqrXGLV5Jkogj1KSYL0"
--data "@$HOME/bug_attrs.json"
"https://fmd-bugzil-01tst.vrt.sourcefire.com/rest/bug"

How do I send the API Key in the headers instead of the Query string?

1 Answer 1

2
+100

I think you are using stable version of Bugzilla, version 5.0.4, according to the documentation for Rest API 5.0.4, it does not support X-BUGZILLA-API-KEY header for authentication.

However, latest version 5.1.2 has support for allowing api key in the header.

Alternatively, authentication credentials can be provided via one of the following headers:

X-BUGZILLA-LOGIN

X-BUGZILLA-PASSWORD

X-BUGZILLA-API-KEY

X-BUGZILLA-TOKEN

Credentials passed as part of the query string take precedence over the header credentials.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.