<?php
$ch = curl_init('https://services.leadconnectorhq.com/proposals/templates/send');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'templateId': 'hTlkh7t8gujsahgg93', 'userId': 'hTlkh7t8gujsahgg93', 'sendDocument': true, 'locationId': 'hTlkh7t8gujsahgg93', 'contactId': 'hTlkh7t8gujsahgg93', 'opportunityId': 'hTlkh7t8gujsahgg93'}),
]);
$data = json_decode(curl_exec($ch), true);