I have spent countless hours trying to figure how to use the jsonrpc.cgi
service for Bugzilla 4.4.12 and cannot seem to get past this. My ultimate
goal is to post new bugs into bugzilla using the jsonrpc.cgi webservice but
have just gotten nowhere..
After trying for sometime on my own installation I thought that perhaps my
installation was bad so I have tried on the landfill.bugzilla.org
installation and come up with the exact same error so there is something
wrong with the way that I am handling the submission or something..
In its simplest terms, I can properly use the service with "GET" and can
return the time and even users of the Bugzilla database but when I try to
"POST" to the jsonrpc.cgi I am stopped dead in my tracks..
Here is the code that I have
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => '
CURLOPT_USERAGENT => 'Codular Sample cURL Request',
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => array(
Bugzilla_login => 'username',
Bugzilla_password => 'password'
// Send the request & save response to $resp
$response = curl_exec($curl);
The response is as follows
HTTP/1.1 100 Continue HTTP/1.1 403 Date: Fri, 21 Apr 2017 00:28:09 GMT
Server: Apache X-xss-protection: 1;
max-age=604800 X-frame-options: SAMEORIGIN X-content-type-options: nosniff
HttpOnly Transfer-Encoding: chunked Content-Type: application/json;
charset=UTF-8 No data.
Note that a Cookie Bugzilla_login_request_Cookie is returned so it appears
that something is getting through to the service regardless of the 403
error.. even so, if I pass this cookie back to the jsonrpc.cgi as a cookie
header I still get a 403.
What am I doing wrong? It must be something silly that I am doing but I am
just stuck and need a push.
heh.. That was it.. that got me past the 403 error at least now I see error messages in the building of my JSON which is MUCH better than what I was seeing before.. Thank you so much.. I owe you a beer.. I figured it was something that I was missing..
SOOOOO.. You did save my weekend :-) Thank you so much.. I did get all this to work perfectly!! Thank you again.. I just had to add the Content Type Header and then the word "method" before by actual methods and everthing fell into place..