$notesCollection = new NotesCollection();
$commonNote = new CommonNote();
$commonNote->setEntityId($addedLead->getId())
->setCreatedBy(0)
->setText($comment);
$notesCollection->add($commonNote);
try {
$leadNotesService = $apiClient->notes(EntityTypesInterface::LEADS);
$notesCollection = $leadNotesService->add($notesCollection);
} catch (AmoCRMApiException $e) {
echo "Error";
$leadCustomFieldsValues = new CustomFieldsValuesCollection();
$field= new TextCustomFieldValuesModel();
$field->setFieldId(010101);
$field->setValues(
(new TextCustomFieldValueCollection())
->add((new TextCustomFieldValueModel())->setValue("Text")
);