文档说eventType
必须是string
https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-personalize-events-2018-03-22.html#putevents
所以我做了:
/* @var PersonalizeEventsClient $client */
$client->putEvents([
'trackingId' => $trackingId,
'sessionId' => $uniqueId,
'userId' => '2',
'eventList' => [
'itemId' => '1',
'eventType' => 'click',
'sentAt' => (string) time(),
],
]);
但我收到下一个验证错误:
[eventList][eventType] must be an associative array. Found string(5) "click"
[eventList][sentAt] must be an associative array. Found string(10) "1611590718"
任何想法它应该如何工作?我试过json_encode
, ['eventType' => ['key' => 'click']]
,但它不起作用。