Hi Everyone,
Just trying to use API to change the pipeline in HubSpot.
I keep getting an error using this API put call: $data = '{
“pipelineId”: “default”,
“stages”: [
{
“stageId”: “49fafda2-f166-4650-956a-1dc5f5514357”,
“label”: “Initial Qualification”,
“probability”: 0.1,
“active”: true,
“displayOrder”: 0,
“closedWon”: false
},
{
“stageId”: “customclosedwonstage”,
“label”: “Success! Closed Won”,
“probability”: 1,
“active”: true,
“displayOrder”: 1,
“closedWon”: true
},
{
“label”: “A new dealstage”,
“probability”: 1,
“active”: true,
“displayOrder”: 2,
“closedWon”: true
},
{
“stageId”: “newcustomdealstage”,
“label”: “Another new dealstage”,
“probability”: 1,
“active”: true,
“displayOrder”: 3,
“closedWon”: true
}
],
“label”: “New Custom Business Pipeline”,
“active”: true,
“displayOrder”: 10
}
';
$ch = curl_init(‘http://api.hubapi.com/deals/v1/pipelines/default?hapikey=eda09c2e-2029-49bd-b8d9-XXXX’);
curl_setopt($ch, CURLOPT_PUT, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$res = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
var_dump($res, $error);
error: string(34) “Recv failure: Connection was reset”
Api call doesn’t change anything in my pipeline. However, it is supposed to change the pipeline stage.
I used this example: Accounts Dashboard | HubSpot
This doesn’t work as well.
Anybody knows why this is happening or how to do it right?
Thanks,
Geri
