mttzzz / amoclient
AmoClient
Installs: 1 497
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/config: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/console: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/contracts: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/http: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- mttzzz/laravel-telegram-log: ^2.3
Requires (Dev)
- larastan/larastan: ^2.9.8
- laravel/pint: ^1.17
- orchestra/testbench: ^7.33.0 || ^8.13.0 || ^9.0.3
- phpunit/phpunit: ^11.3
- dev-master
- 3.0.x-dev
- 3.0.14
- 3.0.13
- 3.0.12
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.96
- 2.95
- 2.94
- 2.93
- 2.92
- 2.91
- 2.90
- 2.89
- 2.88
- 2.87
- 2.86
- 2.85
- 2.84
- 2.83
- 2.82
- 2.81
- 2.80
- 2.79
- 2.78
- 2.77
- 2.76
- 2.75
- 2.74
- 2.73
- 2.72
- 2.71
- 2.70
- 2.69
- 2.68
- 2.67
- 2.66
- 2.65
- 2.64
- 2.63
- 2.62
- 2.61
- 2.60
- 2.59
- 2.58
- 2.57
- 2.56
- 2.55
- 2.54
- 2.53
- 2.52
- 2.51
- 2.50
- 2.49
- 2.48
- 2.47
- 2.46
- 2.45
- 2.44
- 2.43
- 2.42
- 2.41
- 2.40
- 2.39
- 2.38
- 2.37
- 2.36
- 2.35
- 2.34
- 2.33
- 2.32
- 2.31
- 2.30
- 2.29
- 2.28
- 2.27
- 2.26
- 2.25
- 2.24
- 2.23
- 2.22
- 2.21
- 2.20
- 2.19
- 2.18
- 2.17
- 2.16
- 2.15
- 2.14
- 2.13
- 2.12
- 2.11
- 2.10.9
- 2.10.8
- 2.10.7
- 2.10.6
- 2.10.5
- 2.10.4
- 2.10.3
- 2.10.2
- 2.10.1
- 2.10.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.9.9
- 1.9.8
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.9
- 1.8.8
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-12-24 07:48:52 UTC
README
[![Latest Version on Packagist][ico-version]][link-packagist]
Клиент для amoCRM.
Installation
Via Composer
$ composer require mttzzz/amoclient
#Usage
$amo = new AmoClient($key);
##Account
get
$account = $amo->account; $account ->withAmojoId() ->withAmojoRights() ->withUsersGroups() ->withTaskTypes() ->withVersion() ->withEntityNames() ->withDateTimeSettings() ->get();
##Lead
get
$leads = $amo->leads ->page(2) ->limit(10) ->query('test') ->orderByCreatedAtAsc() ->orderByCreatedAtDesc() ->orderByUpdatedAtAsc() ->orderByUpdatedAtDesc() ->orderByIdAsc() ->orderByIdDesc() ->withCatalogElements() ->withIsPriceModifiedByRobot() ->withLossReason() ->withContacts() ->withOnlyDeleted() ->get(); $lead = $amo->leads->find(27211533);
filter
$leads = $amo->leads ->filterId($id) ->filterName($name) ->filterCreatedBy($createdBy) ->filterResponsibleUserId($id) ->filterCreatedAt($from, $to) ->filterUpdatedAt($from, $to) ->filterClosestTaskAt($from, $to) ->filterCustomField($fieldId, $value) ->filterCustomFieldFromTo($fieldId, $from, $to) ->filterPhone($phone) ->filterEmail($email) ->get(); $lead = $amo->leads->find(27211533);
link
$link = $amo->leads->entity(27222853)->links->catalogElement(811471, 4419, 2); $link2 = $amo->leads->entity(27222853)->links->contact(43637153, false); $link3 = $amo->leads->entity(27222853)->links->companies(43706869); $link4 = $amo->leads->entity(27222853)->links->contact(43706907, true); $amo->leads->entity(27222853)->links->link([$link, $link2, $link3, $link4]);
unlink
$link = $amo->leads->entity(27222853)->links->catalogElement(811471, 4419, 2); $link2 = $amo->leads->entity(27222853)->links->contact(43637153, false); $link3 = $amo->leads->entity(27222853)->links->companies(43706869); $link4 = $amo->leads->entity(27222853)->links->contact(43706907, true); $amo->leads->entity(27222853)->links->unlink([$link, $link2, $link3, $link4]);
createOne
$lead = $amo->leads->entity(); $lead->name = 'testLead'; $lead->create();
createMany
$lead = $amo->leads->entity(); $lead->name = 'testOne1'; $lead->status_id = 21714793; $lead2 = $amo->leads->entity(); $lead2->name = 'testOne2'; $lead2->setCF(449541, 'test'); $lead2->price = 100; $lead2->status_id = 21714793; $lead2->responsible_user_id = 1693807; $data = $amo->leads->create([$lead,$lead2]);
createNote
$amo->leads->entity($leadId)->notes->common($text); $amo->leads->entity($leadId)->notes->invoicePaid($text, $service, $icon_url); $amo->leads->entity($leadId)->notes->smsIn($text, $phone); $amo->leads->entity($leadId)->notes->smsOut($text, $phone); $amo->leads->entity($leadId)->notes->callIn($uniq, $duration, $link, $phone, $source = 'ASTERISK'); $amo->leads->entity($leadId)->notes->callOut($uniq, $duration, $link, $phone, $source = 'ASTERISK');
createTask
$amo->leads->entity(27211595)->tasks ->add($text, $responsible_user_id = null, $completeTill = null, $duration = null, $type = 2) $amo->leads->entity(27211595)->tasks->add('text', 1693807,Carbon::now()->addHour()->timestamp, 60 * 60, 2);
updateOne
$lead = $amo->leads->entity(27211595); $lead->name = 'testOne22'; $lead->price = 222; $lead->responsible_user_id = 1693807; $lead->setCF(449541, 'test'); $lead->update();
updateMany
$ids = [27211595, 27211597]; $leads = []; foreach ($ids as $id) { $lead = $amo->leads->entity($id); $lead->tag('updateMany'); $leads[] = $lead; } $amo->leads->update($leads);
delete
not work
##Contact
get
$leads = $amo->contacts ->page(2) ->limit(10) ->query('test') ->orderByCreatedAtAsc() ->orderByCreatedAtDesc() ->orderByUpdatedAtAsc() ->orderByUpdatedAtDesc() ->orderByIdAsc() ->orderByIdDesc() ->withCatalogElements() ->withLeads() ->withCustomers() ->get(); $contact = $amo->contacts->find(43680761);
createOne
$contact = $amo->contacts->entity(); $contact->name = 'test'; $contact->create();
createMany
$contact = $amo->contacts->entity(); $contact->name = 'testOne1'; $contact2 = $amo->contacts->entity(); $contact2->name = 'testOne2'; $contact2->setCF(449541, 'test'); $contact2->emailAdd('test@test.loc')->phoneAdd(3752511111111); $contact2->responsible_user_id = 1693807; $data = $amo->contacts->create([$contact,$contact2]);
createNote
$amo->leads->entity($leadId)->notes->common($text); $amo->leads->entity($leadId)->notes->invoicePaid($text, $service, $icon_url); $amo->leads->entity($leadId)->notes->smsIn($text, $phone); $amo->leads->entity($leadId)->notes->smsOut($text, $phone); $amo->leads->entity($leadId)->notes->callIn($uniq, $duration, $link, $phone, $source = 'ASTERISK'); $amo->leads->entity($leadId)->notes->callOut($uniq, $duration, $link, $phone, $source = 'ASTERISK');
createTask
$amo->leads->entity(27211595)->tasks ->add($text, $responsible_user_id = null, $completeTill = null, $duration = null, $type = 2) $amo->leads->entity(27211595)->tasks->add('text', 1693807,Carbon::now()->addHour()->timestamp, 60 * 60, 2);
updateOne
$lead = $amo->leads->entity(27211595); $lead->name = 'testOne22'; $lead->price = 222; $lead->responsible_user_id = 1693807; $lead->setCF(449541, 'test'); $lead->update();
updateMany
$ids = [27211595, 27211597]; $leads = []; foreach ($ids as $id) { $lead = $amo->leads->entity($id); $lead->tag('updateMany'); $leads[] = $lead; } $amo->leads->update($leads);
delete
not work
##Task
create
$task1 = $amo->tasks->entity(); $task1->text = 'test1'; $task1->entity_type = 'leads'; $task1->entity_id = 27222853; $task1->complete_till = Carbon::now('Europe/Minsk')->endOfDay()->timestamp; $task2 = $amo->tasks->entity(); $task2->text = 'test2'; $task2->entity_type = 'leads'; $task2->entity_id = 27222853; $task2->complete_till = Carbon::now('Europe/Minsk')->endOfDay()->timestamp; $data = $amo->tasks->create([$task1, $task2]);
update
$tasks = $amo->tasks->filterEntityId(27222853)->filterIsCompletedFalse()->get(); $updateTasks = []; foreach ($tasks as $task) { $updateTask = $amo->tasks->entity($task['id']); $updateTask->is_completed = true; $updateTask->setResultText('Задача закрыта автоматически'); $updateTasks[] = $updateTask; } $amo->tasks->update($updateTasks);