Recent searches
No recent searches
Zendesk Sell API PHP filter leads by custom_fields
Posted Apr 19, 2021
Hello.
I use php lib to api with zendesk sell.
I have custom field for leads:
{
"items": [{
"data": {
"id": 1757838,
"name": "Интересующая модель авто",
"created_at": "2018-09-05T23:02:42Z",
"updated_at": "2021-04-19T18:05:19Z",
"type": "list",
"choices": [ {
"id": 44,
"name": "Opel Astra K SportsTourer"
}, {
"id": 9,
"name": "Opel Grandland X"
},
............
]
},
"meta": {
"type": "custom_field"
}
}],
"meta": {
"type": "collection",
"count": 1,
"links": {}
}
}
So I want to get all leads, where my custom_field (id 1757838) is "Opel Grandland X" (id 9).
I try:
$answer = $basecrmclient->leads->all(["per_page" => 100, "status" => "Квалификация", "custom_fields" =>[[1757838=>"Opel Grandland X"]], "owner_id" => "1491217", "sort_by" => "updated_at:desc"]);
And get error:
[code] => invalid_param |
|
[message] => invalid request query parameter |
|
[details] => The request query parameter 'custom_fields/0' is malformed, missing, or has an invalid value (is an unexpected parameter) |
|
0
1 comment
Pavitra Balekai
Hello Evgen,
Thanks for sending this over. You can filter out leads based on custom fields by using the custom field parameter:
GET https://api.getbase.com/v2/leads?custom_fields[CUSTOM FIELD NAME]=VALUE
0