amocrm-rails 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.markdown +166 -2
- data/lib/generators/amocrm_rails/install/templates/amocrm.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf62332a2d3a02221ddd53844b0e171b32b952ce80b92ea5fa79516248f1d1e7
|
4
|
+
data.tar.gz: 0340c2cbf344391021ef362879dd846c9a7a3a81b599d010d1561a71225b4d65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b7ee0128ffe115119c225f2006f27b3dcd9497974445bda7603c829fc0a6382dd0fc0d1547a2ef7d1da658ecb86bfc450bea062db4a37f833e53ff8bb52379a
|
7
|
+
data.tar.gz: c45e04bcca0acd272c2820cced1c12834240ef5276c08cfdfe69eb3ecefdb86296d5e5caa2fcea2bde96fc1d777b3eeeb8bbdc0b2891f3733e39585c2c535264
|
data/README.markdown
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
Вы можете изменять `timeout`, `open_timeout`, `faraday_adapter`, `proxy`, `symbolize_keys`, `logger`, и `debug`:
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
AmocrmRails::Request.timeout =
|
19
|
-
AmocrmRails::Request.open_timeout =
|
18
|
+
AmocrmRails::Request.timeout = 60
|
19
|
+
AmocrmRails::Request.open_timeout = 60
|
20
20
|
AmocrmRails::Request.symbolize_keys = true
|
21
21
|
AmocrmRails::Request.debug = false
|
22
22
|
```
|
@@ -118,3 +118,167 @@ response = AmocrmRails::Request.leads(666749).update(body: body)
|
|
118
118
|
p(response.body)
|
119
119
|
leads = response.body[:_embedded][:leads]
|
120
120
|
```
|
121
|
+
|
122
|
+
## Неразобранное
|
123
|
+
|
124
|
+
### [Список неразобранного](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-list)
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
params = {
|
128
|
+
page: 0,
|
129
|
+
limit: 10
|
130
|
+
}
|
131
|
+
response = AmocrmRails::Request.leads.unsorted.retrieve(params: params)
|
132
|
+
p(response.body)
|
133
|
+
unsorted = response.body[:_embedded][:unsorted]
|
134
|
+
uid = unsorted.first[:uid]
|
135
|
+
```
|
136
|
+
|
137
|
+
### [Получение неразобранного по UID](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-detail)
|
138
|
+
|
139
|
+
```ruby
|
140
|
+
response = AmocrmRails::Request.leads.unsorted(uid).retrieve
|
141
|
+
p(response.body)
|
142
|
+
```
|
143
|
+
|
144
|
+
### [Добавление неразобранного типа звонок](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-add-sip)
|
145
|
+
|
146
|
+
```ruby
|
147
|
+
body = [
|
148
|
+
{
|
149
|
+
source_name: "ОАО Коспромсервис",
|
150
|
+
source_uid: "a1fee7c0fc436088e64ba2e8822ba2b3",
|
151
|
+
created_at: 1510261200,
|
152
|
+
_embedded: {
|
153
|
+
leads: [
|
154
|
+
{
|
155
|
+
name: "Тех обслуживание",
|
156
|
+
price: 5000
|
157
|
+
}
|
158
|
+
],
|
159
|
+
contacts: [
|
160
|
+
{
|
161
|
+
name: "Контакт для примера"
|
162
|
+
}
|
163
|
+
],
|
164
|
+
companies: [
|
165
|
+
{
|
166
|
+
name: "ОАО Коспромсервис"
|
167
|
+
}
|
168
|
+
]
|
169
|
+
},
|
170
|
+
metadata: {
|
171
|
+
is_call_event_needed: true,
|
172
|
+
uniq: "a1fe231cc88e64ba2e8822ba2b3ewrw",
|
173
|
+
duration: 54,
|
174
|
+
service_code: "CkAvbEwPam6sad",
|
175
|
+
link: "https://example.com",
|
176
|
+
phone: 79998888888,
|
177
|
+
called_at: 1510261200,
|
178
|
+
from: "onlinePBX"
|
179
|
+
}
|
180
|
+
}
|
181
|
+
]
|
182
|
+
response = AmocrmRails::Request.leads.unsorted.sip.create(body: body)
|
183
|
+
p(response.body)
|
184
|
+
```
|
185
|
+
|
186
|
+
### [Добавление неразобранного типа форма](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-add-form)
|
187
|
+
|
188
|
+
```ruby
|
189
|
+
body = [
|
190
|
+
{
|
191
|
+
source_name: "ОАО Коспромсервис",
|
192
|
+
source_uid: "a1fee7c0fc436088e64ba2e8822ba2b3",
|
193
|
+
created_at: 1590830520,
|
194
|
+
_embedded: {
|
195
|
+
leads: [
|
196
|
+
{
|
197
|
+
name: "Тех обслуживание",
|
198
|
+
visitor_uid: "5692210d-58d0-468c-acb2-dce7f93eef87",
|
199
|
+
price: 5000,
|
200
|
+
_embedded: {
|
201
|
+
tags: [
|
202
|
+
{
|
203
|
+
name: "Тег для примера"
|
204
|
+
}
|
205
|
+
]
|
206
|
+
}
|
207
|
+
}
|
208
|
+
],
|
209
|
+
contacts: [
|
210
|
+
{
|
211
|
+
name: 234,
|
212
|
+
first_name: "123213",
|
213
|
+
last_name: 234,
|
214
|
+
custom_fields_values: [
|
215
|
+
{
|
216
|
+
field_code: "PHONE",
|
217
|
+
values: [
|
218
|
+
{
|
219
|
+
value: "+7912321323"
|
220
|
+
}
|
221
|
+
]
|
222
|
+
}
|
223
|
+
]
|
224
|
+
}
|
225
|
+
],
|
226
|
+
companies: [
|
227
|
+
{
|
228
|
+
name: "ОАО Коспромсервис"
|
229
|
+
}
|
230
|
+
]
|
231
|
+
},
|
232
|
+
metadata: {
|
233
|
+
ip: "123.222.2.22",
|
234
|
+
form_id: "a1fee7c0fc436088e64ba2e8822ba2b3ewrw",
|
235
|
+
form_sent_at: 1590830520,
|
236
|
+
form_name: "Форма заявки для полёта в космос",
|
237
|
+
form_page: "https://example.com",
|
238
|
+
referer: "https://www.google.com/search?&q=elon+musk"
|
239
|
+
}
|
240
|
+
}
|
241
|
+
]
|
242
|
+
response = AmocrmRails::Request.leads.unsorted.forms.create(body: body)
|
243
|
+
p(response.body)
|
244
|
+
uid = response.body[:_embedded][:unsorted].first[:uid]
|
245
|
+
```
|
246
|
+
|
247
|
+
### [Принятие неразобранного](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-accept)
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
body = {
|
251
|
+
status_id: 41504311
|
252
|
+
}
|
253
|
+
response = AmocrmRails::Request.leads.unsorted(uid).accept.create(body: body)
|
254
|
+
p(response.body)
|
255
|
+
```
|
256
|
+
|
257
|
+
### [Отклонение неразобранного](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-decline)
|
258
|
+
|
259
|
+
```ruby
|
260
|
+
response = AmocrmRails::Request.leads.unsorted(uid).decline.delete
|
261
|
+
p(response.body)
|
262
|
+
```
|
263
|
+
|
264
|
+
### [Привязка неразобранного](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-link)
|
265
|
+
|
266
|
+
```ruby
|
267
|
+
body = {
|
268
|
+
link: {
|
269
|
+
entity_id: lead_id,
|
270
|
+
entity_type: "leads"
|
271
|
+
}
|
272
|
+
}
|
273
|
+
response = AmocrmRails::Request.leads.unsorted(uid).link.create(body: body)
|
274
|
+
p(response.body)
|
275
|
+
```
|
276
|
+
|
277
|
+
### [Сводная информация о неразобранных сделках](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#unsorted-summary)
|
278
|
+
|
279
|
+
```ruby
|
280
|
+
response = AmocrmRails::Request.leads.unsorted.summary.retrieve
|
281
|
+
p(response.body)
|
282
|
+
```
|
283
|
+
|
284
|
+
### [Описание объектов metadata](https://www.amocrm.ru/developers/content/crm_platform/unsorted-api#metadata-description)
|
@@ -15,8 +15,8 @@ AmocrmRails.setup do |config|
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
config::Request.timeout =
|
19
|
-
config::Request.open_timeout =
|
18
|
+
config::Request.timeout = 60
|
19
|
+
config::Request.open_timeout = 60
|
20
20
|
config::Request.symbolize_keys = true
|
21
21
|
config::Request.debug = false
|
22
22
|
end
|