3

複数の場所を管理する Google マイ ビジネス アカウントがあります。質問に答えるインターフェースを作りたい。私の問題は、現在の場所の Author オブジェクトを取得する方法が見つからないことです。

新しい Google_Service_MyBusiness_Author オブジェクトを作成して送信しようとしましたが、うまくいかないようです。MyBusiness API 4.5 を使用しています

$author = new Google_Service_MyBusiness_Author();
$author->setDisplayName('location display name');
$author->setProfilePhotoUrl('someurl.jpg');
$author->setType('MERCHANT');

$answer = new Google_Service_MyBusiness_Answer();
$answer->setText($_POST['answerReplyText']);
$answer->setAuthor($author);

$postBody = new Google_Service_MyBusiness_UpsertAnswerRequest();
$postBody->setAnswer($answer);

try {
    $mybusinessService->accounts_locations_questions_answers->upsert($_POST['question_name'],$postBody);
}
catch(Exception $e) {
    var_dump($e);
}

「リクエストに無効な引数が含まれています」という例外が発生します。私はこれを正しい方法でやっていますか?回答を有効にするにはどうすればよいですか?

4

1 に答える 1