Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$info = [
'deal' => [
'name' => 'Plan Name',
'amount' => 100,
'stage_name' => 'won',
'closed_date' => '2017-06-02',
'deal_stage_id' => 'DEAL-STAGE-ID',
'sales_account' => [
'name' => 'Account Name',
'website' => 'http://example.org'
]
]
];
$headers = [
'Accept' => 'application/json',
'Content-type' => 'application/json',
'Authorization' => 'Token token=MY-TOKEN-ID'
];
$client = new \GuzzleHttp\Client();
$response = $client->post('https://MY-SUBDOMAIN.freshsales.io/api/deals', [
'json' => $info,
'headers' => $headers]);
$result = $response->getBody()->getContents();
print_r(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment