$data['request']['unsorted'] = array(
'category' => 'forms',
'add' => array (
array(
'source' => $frome,
'source_uid' => NULL,
'data' => array(
'leads' => array(
array(
'price' => $price,
'date_create' => time(),
'name' => $tema,
'tags' => 'sdmall',
'notes' => array(
array(
'text' => $comments,
'note_type' => 4,
'element_type' => 2,
),
),
),
),
'contacts' => array(
array(
'name'=> $name,
'custom_fields'=>array(
)
)
),
'companies' => array(),
),
'source_data' => array(
'data' => array(
'name_1' => array(
'type' => 'text',
'id' => 'name',
'element_type' => '1',
'name' => 'Имя',
'value' => $name,
),
'1708122_1' => array(
'type' => 'multitext',
'id' => '1708122',
'element_type' => '1',
'name' => 'Телефон',
'value' => array(
$phone
),
),
'1708124_1' => array(
'type' => 'multitext',
'id' => '1708124',
'element_type' => '1',
'name' => 'Email',
'value' => array(
$email
),
)
),
'form_id' => 318,
'form_type' => 1,
'origin' => array(
'ip' => $ip,
'datetime' => 'Tue Nov 03 2015 13:02:24 GMT+0300 (Russia Standard Time)',
'referer' => '',
),
'date' => time(),
'from' => $frome,
'form_name' => $tema,
),
),
),
);
$link='https://'.$subdomain.'.amocrm.ru/api/unsorted/add/?api_key='.$user['USER_HASH'].'&login='.$user['USER_LOGIN'];
leads['request']['leads']['add']=array(
array(
'price' => $price,
'date_create' => time(),
'name' => $tema,
'status_id' => 22185907,
'tags' => 'sdmall',
'notes' => array(
array(
'text' => $comments,
'note_type' => 4,
'element_type' => 2,
),
'custom_fields'=>array(
array(
'id'=>1708122,
'values'=>array(
array(
'value'=>$phone,
'enum'=>'Телефон',
)
)
),
)
)
)
);