Hi there,
I’m new to both pipedrive & PHP so any help would be appreciated. I’m currently trying to add a file to a deal but to no avail.
My code is as follows:
if (!empty($result[‘data’][‘id’])) {
$_SESSION[‘deal_id’] = $result[‘data’][‘id’];
$deal = array(
'file' => $_SESSION['file'],
'deal_id' => $_SESSION['deal_id']
);
$url = 'https://api.pipedrive.com/v1/files';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $deal);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);
$result = json_decode($output, true);
}
Thank you!