Как можно вытащить для проверки отдельно значение каждой вариации?
$data = [
[
'name' => $title,
"responsible_user_id" => (int) $user_amo,
//"pipeline_id" => (int) $pipeline_id,
"_embedded" => [
"contacts" => [
[
"first_name" => $fio,
"custom_fields_values" => [
[
"field_code" => "PHONE",
"values" => [
[
"enum_code" => "MOB",
"value" => $phone
]
]
],
]
]
],
],
]
];
<?php
require_once 'vendor/autoload.php';
use Google\Auth\Credentials\ServiceAccountCredentials;
use GuzzleHttp\Client;
$serviceAccountFile = '/path-to-credentials.json';
$scopes = ['https://www.googleapis.com/auth/drive.readonly'];
// Учетка
$credentials = new ServiceAccountCredentials(
$scopes,
$serviceAccountFile
);
// Получаем токен
$token = $credentials->fetchAuthToken();
$accessToken = $token['access_token'];
echo 'OAuth2 Token: ' . $accessToken;
echo "\n";
// Ну тут по примеру запрашиваем файлы с гугл диска
$client = new Client([
'base_uri' => 'https://www.googleapis.com',
'headers' => [
'Authorization' => 'Bearer ' . $accessToken
]
]);
$response = $client->get('/drive/v2/files');
print_r((string) $response->getBody());