AmoLeads: Leads

Description Usage Arguments Value References Examples

View source: R/AmoLeads.R

Description

Function to get leads.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
AmoLeads(
  email = NULL,
  apikey = NULL,
  domain = NULL,
  auth_list = NULL,
  limit = 500,
  flatten = F,
  id = NULL,
  query = NULL,
  responsible_user_id = NULL,
  with_with = "is_price_modified_by_robot,loss_reason_name",
  status = NULL,
  date_create_from = NULL,
  date_create_to = NULL,
  date_modify_from = NULL,
  date_modify_to = NULL,
  tasks = NULL,
  active = NULL
)

Arguments

email

Email

apikey

Your api key from settings in interface

domain

Your domain in AmoCRM (xxx in xxx.amocrm.ru)

auth_list

List with auth data, you can build from AmoAuthList

limit

Batch limit, sometimes AmoCRM's API doesn't work properly, you can reduce the value and have a chance to load your data

flatten

Set TRUE if you want to join all the output dataframes You'll have a not tidy-dataframe with left-joining all dataframes

id

Filter. Pass id or vector of ids of leads.

query

Filter. Searching for all fields of leads. String.

responsible_user_id

Filter. Pass id or vector of ids of responsible user ids. You can get ids from AmoUsers().

with_with

Additional data. Default to 'is_price_modified_by_robot,loss_reason_name'.

status

Filter. Single status id or vector of ids. You can get ids from AmoPipelinesStatuses().

date_create_from

Filter. Date create of lead. You can pass like '2019-01-01' or like '2019-01-01 12:30:00'.

date_create_to

Filter. Date create of lead. You can pass like '2019-01-01' or like '2019-01-01 12:30:00'.

date_modify_from

Filter. Date modify of lead. You can pass like '2019-01-01' or like '2019-01-01 12:30:00'.

date_modify_to

Filter. Date modify of lead. You can pass like '2019-01-01' or timezone like '2019-01-01 12:30:00'.

tasks

Filter. Pass 1 if you need leads without tasks, pass 2 if you need leads with undone tasks.

active

Filter. Pass 1 if you need only active leads.

Value

If flatten is FALSE (default) you'll get a list of 4 tidy-dataframes which you can join by id. You can access it using list_name$dataframe_name.

leads - all leads with unnested parameters.

linked_custom_fields — linked custom fields with all parameters.

linked_tags — linked tags with all parameters.

linked_contacts — linked contacts with all parameters.

References

Please READ this: Function documentation in Russian on GitHub

Also nice to read: AmoCRM official documentation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# simple
library(dplyr)
leads <- AmoLeads(auth_list = auth_list)
leads_with_cf <- leads$leads %>%
                        left_join(leads$linked_custom_fields, by = 'id') # not tidy

# filters
leads <- AmoLeads(auth_list = auth_list,
                  date_create_from = '2019-02-01 05:00:00',
                  date_create_to = '2019-02-20 17:00:00',
                  active = 1)

## End(Not run)

grkhr/amocrm documentation built on May 24, 2021, 5:24 a.m.