Hi,
I want to initiate a pipeline in a customized function on my website. However, I only got 500 response. Is there anything wrong with my code?
Here is the php code:
$ch = curl_init("https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/pipelines/");
$userpwd = "username:password";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, $userpwd);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
));
$vars = json_decode(array(
"target" => array(
"ref_type" => "branch",
"type" => "pipeline_ref_target",
"ref_name" => "develop"
)
));
curl_setopt($ch, CURLOPT_POSTFIELDS,$vars);
curl_exec($ch);
curl_close($ch);
Here is my response data:
{
"code": 500,
"message": "There was an error processing your request. It has been logged (ID fd114d958c0e63e1)."
}
I can feel that I need to check the log to view error detail. I tried Bitbucket Server, but can not access to my current repo. Can anybody point out what I'm missing here? I'm new to Bitbucket product. Please forgive me if I made some silly mistakes.
Thanks a lot!
Could you please elaborate so that the next person having this problem knows what to do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.