Предыдущее решение: РЕШЕНИЕ
Внутри есть внутри tags и сustom_fields, как вытаскивать name и value (Например: Адрес доставки: Адрес; Телефон: Номер: Количество: кол-во.) Спасибо!
"_links": {
"self": {
"href": "/api/v2/leads?status=18468961",
"method": "get"
}
},
"_embedded": {
"items": [
{
"id": 7612939,
"name": "Доставка на Дзержинского 76",
"responsible_user_id": 2170399,
"created_by": 2170399,
"created_at": 1527060038,
"updated_at": 1527116634,
"account_id": 18334111,
"is_deleted": false,
"main_contact": {},
"group_id": 0,
"company": {},
"closed_at": 0,
"closest_task_at": 0,
"tags": [
{
"id": 136663,
"name": "ЗАКАЗ ИЗ ПРИЛОЖЕНИЯ"
},
{
"id": 192403,
"name": "ЦЕНТР"
}
],
"custom_fields": [
{
"id": 379810,
"name": "Количество",
"values": [
{
"value": "1"
}
],
"is_system": false
},
{
"id": 379905,
"name": "Адрес доставки",
"values": [
{
"value": "Дзержинского 76"
}
],
"is_system": false
},
{
"id": 389997,
"name": "Телефон",
"values": [
{
"value": "89659979796"
}
],
"is_system": false
}
],
"status_id": 18468961,
"sale": 0,
"loss_reason_id": 0,
"contacts": {},
"pipeline": {
"id": 980719,
"_links": {
"self": {
"href": "/api/v2/pipelines?id=980719",
"method": "get"
}
}
},
"_links": {
"self": {
"href": "/api/v2/leads?id=7612939",
"method": "get"
}
}
},
{
"id": 8317497,
"name": "Доставка на Дзержинского 51",
"responsible_user_id": 2170399,
"created_by": 2170399,
"created_at": 1531722164,
"updated_at": 1531972399,
"account_id": 18334111,
"is_deleted": false,
"main_contact": {},
"group_id": 0,
"company": {},
"closed_at": 0,
"closest_task_at": 0,
"tags": [
{
"id": 136663,
"name": "ЗАКАЗ ИЗ ПРИЛОЖЕНИЯ"
},
{
"id": 192403,
"name": "ЦЕНТР"
}
],
"custom_fields": [
{
"id": 379810,
"name": "Количество",
"values": [
{
"value": "1"
}
],
"is_system": false
},
{
"id": 379905,
"name": "Адрес доставки",
"values": [
{
"value": "Дзержинского 51"
}
],
"is_system": false
},
{
"id": 389997,
"name": "Телефон",
"values": [
{
"value": "79244694163"
}
],
"is_system": false
},
{
"id": 380773,
"name": "Подъезд",
"values": [
{
"value": "2"
}
],
"is_system": false
},
{
"id": 380777,
"name": "Этаж",
"values": [
{
"value": "7"
}
],
"is_system": false
},
{
"id": 380781,
"name": "Квартира",
"values": [
{
"value": "89"
}
],
"is_system": false
}
],
"status_id": 18468961,
"sale": 0,
"loss_reason_id": 0,
"contacts": {},
"pipeline": {
"id": 980719,
"_links": {
"self": {
"href": "/api/v2/pipelines?id=980719",
"method": "get"
}
}
},
"_links": {
"self": {
"href": "/api/v2/leads?id=8317497",
"method": "get"
}
}
},
{
"id": 8253299,
"name": "Доставка на Жорницкого",
"responsible_user_id": 2170399,
"created_by": 2170399,
"created_at": 1531350142,
"updated_at": 1531972433,
"account_id": 18334111,
"is_deleted": false,
"main_contact": {},
"group_id": 0,
"company": {},
"closed_at": 0,
"closest_task_at": 0,
"tags": [
{
"id": 136663,
"name": "ЗАКАЗ ИЗ ПРИЛОЖЕНИЯ"
},
{
"id": 192403,
"name": "ЦЕНТР"
}
],
"custom_fields": [
{
"id": 379810,
"name": "Количество",
"values": [
{
"value": "1"
}
],
"is_system": false
},
{
"id": 379905,
"name": "Адрес доставки",
"values": [
{
"value": "Жорницкого"
}
],
"is_system": false
},
{
"id": 389997,
"name": "Телефон",
"values": [
{
"value": "89142760010"
}
],
"is_system": false
},
{
"id": 380773,
"name": "Подъезд",
"values": [
{
"value": "2"
}
],
"is_system": false
},
{
"id": 380777,
"name": "Этаж",
"values": [
{
"value": "7"
}
],
"is_system": false
},
{
"id": 380781,
"name": "Квартира",
"values": [
{
"value": "53"
}
],
"is_system": false
}
],
"status_id": 18468961,
"sale": 120,
"loss_reason_id": 0,
"contacts": {},
"pipeline": {
"id": 980719,
"_links": {
"self": {
"href": "/api/v2/pipelines?id=980719",
"method": "get"
}
}
},
"_links": {
"self": {
"href": "/api/v2/leads?id=8253299",
"method": "get"
}
}
},
{
"id": 8044599,
"name": "Доставка на Борисовка 3 в1",
"responsible_user_id": 2170399,
"created_by": 2170399,
"created_at": 1530177493,
"updated_at": 1531972598,
"account_id": 18334111,
"is_deleted": false,
"main_contact": {},
"group_id": 0,
"company": {},
"closed_at": 0,
"closest_task_at": 0,
"tags": [
{
"id": 136663,
"name": "ЗАКАЗ ИЗ ПРИЛОЖЕНИЯ"
},
{
"id": 192403,
"name": "ЦЕНТР"
}
],
"custom_fields": [
{
"id": 379810,
"name": "Количество",
"values": [
{
"value": "3"
}
],
"is_system": false
},
{
"id": 379905,
"name": "Адрес доставки",
"values": [
{
"value": "Борисовка 3 в1"
}
],
"is_system": false
},
{
"id": 389997,
"name": "Телефон",
"values": [
{
"value": "89142717267"
}
],
"is_system": false
},
{
"id": 380773,
"name": "Подъезд",
"values": [
{
"value": "1"
}
],
"is_system": false
},
{
"id": 380777,
"name": "Этаж",
"values": [
{
"value": "2"
}
],
"is_system": false
},
{
"id": 380781,
"name": "Квартира",
"values": [
{
"value": "5"
}
],
"is_system": false
}
],
"status_id": 18468961,
"sale": 360,
"loss_reason_id": 0,
"contacts": {},
"pipeline": {
"id": 980719,
"_links": {
"self": {
"href": "/api/v2/pipelines?id=980719",
"method": "get"
}
}
},
"_links": {
"self": {
"href": "/api/v2/leads?id=8044599",
"method": "get"
}
}
}
]
}
}
tags
зачем если все берется изсustom_fields
?