<?php
$ch = curl_init('https://services.leadconnectorhq.com/proposals/document/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({'locationId': 'hTlkh7t8gujsahgg93', 'documentId': 'hTlkh7t8gujsahgg93', 'documentName': 'new Document', 'medium': 'email', 'ccRecipients': [{'id': 'u240JcS0E5qE0ziHnwMm', 'email': 'jim@gmail.com', 'imageUrl': '', 'contactName': 'Jim Anton', 'firstName': 'Jim', 'lastName': 'Anton'}], 'notificationSettings': {'sender': {'fromName': '', 'fromEmail': ''}, 'receive': {'subject': '', 'templateId': ''}}, 'sentBy': '1234567890'}),
]);
$data = json_decode(curl_exec($ch), true);