Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Не работает сохранение из примера #10

Open
chukaev opened this issue Feb 5, 2019 · 0 comments
Open

Не работает сохранение из примера #10

chukaev opened this issue Feb 5, 2019 · 0 comments
Labels

Comments

@chukaev
Copy link

chukaev commented Feb 5, 2019

<?php
try {
    $amo = new \DrillCoder\AmoCRM_Wrap\AmoCRM('test', 'test@test.ru', '011c2d7f862c688286b43ef552fb17f4');
    $contact = new \DrillCoder\AmoCRM_Wrap\Contact();
    $contact->setName('Петя')
            ->addPhone(79998887766); //Создаём контакт, который будет создан в црм после принятия заявки в неразобранном
    $contact2 = new \DrillCoder\AmoCRM_Wrap\Contact();
    $contact2->setName('Ваня')
             ->addPhone(79998887755); //Создаём второй контакт
    $lead = new \DrillCoder\AmoCRM_Wrap\Lead();
    $lead->setName('Тестовая сделка')
         ->setSale(2500); //Создаём сделку, которая будет создана в црм после принятия заявки в неразобранном
    $unsorted = new \DrillCoder\AmoCRM_Wrap\Unsorted('Супер-Форма', $lead, array($contact, $contact2), 'Вторые продажи');
    $unsorted->addNote('Клиент сложный')
             ->save(); // Сохраняем всё в неразобранное в црм
} catch (\DrillCoder\AmoCRM_Wrap\AmoWrapException $e) {
    die($e->getMessage()); //Прерывем работу скрипта и выводим текст ошибки
}
?>

Не удалось сохранить заявку в неразобранное

Array
(
    [add] => Array
        (
            [0] => Array
                (
                    [source_name] => DrillCoder AmoCRM Wrap
                    [created_at] => 1549406707
                    [pipeline_id] => 1336960
                    [incoming_entities] => Array
                        (
                            [leads] => Array
                                (
                                    [0] => Array
                                        (
                                            [pipeline_id] => 
                                            [sale] => 2500
                                            [status_id] => 
                                            [name] => Тестовая сделка
                                            [tags] => 
                                            [created_by] => 0
                                            [notes] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [element_id] => 
                                                            [element_type] => 0
                                                            [note_type] => 4
                                                            [text] => Клиент сложный
                                                            [created_by] => 0
                                                            [params] => Array
                                                                (
                                                                    [text] => Клиент сложный
                                                                    [service] => 
                                                                    [phone] => 
                                                                )

                                                            [tags] => 
                                                        )

                                                )

                                        )

                                )

                            [contacts] => Array
                                (
                                    [0] => Array
                                        (
                                            [name] => Петя
                                            [tags] => 
                                            [created_by] => 0
                                            [custom_fields] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [id] => 200757
                                                            [values] => Array
                                                                (
                                                                    [0] => Array
                                                                        (
                                                                            [enum] => 409593
                                                                            [value] => 79998887766
                                                                            [subtype] => 
                                                                        )

                                                                )

                                                        )

                                                )

                                        )

                                    [1] => Array
                                        (
                                            [name] => Ваня
                                            [tags] => 
                                            [created_by] => 0
                                            [custom_fields] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [id] => 200757
                                                            [values] => Array
                                                                (
                                                                    [0] => Array
                                                                        (
                                                                            [enum] => 409593
                                                                            [value] => 79998887755
                                                                            [subtype] => 
                                                                        )

                                                                )

                                                        )

                                                )

                                        )

                                )

                            [companies] => Array
                                (
                                )

                        )

                    [incoming_lead_info] => Array
                        (
                            [form_id] => 25
                            [form_page] => Супер-Форма
                        )

                )

        )

)
stdClass Object
(
    [error] => Wrong request
)
@drillcoder drillcoder added the bug label Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants