$tag = "Пример тега";
$response = $amoClient('POST', "/api/v4/leads/{$response['content'][0]['id']}", [
[
'tags' => [
'name' => $tag
]
]
]);
PATCH
, а не POST
tags_to_add
, а не _embedded['tags']
$tag = "Пример тега";
$response = $amoClient('PATCH', "/api/v4/leads/{$response['content'][0]['id']}", [
[
'tags_to_add' => [
['name' => $tag]
]
]
]);
$data = [
[
'id' => (int)$leadId,
'_embedded' => [
'tags' => [
['name' => 'tag_name'],
],
],
],
];
$res = $amoClient('PATCH', '/api/v4/leads', ['json' => $data]);
echo $res['status'];