如何在 Php 中的新亚马逊 Alexa.com 排名 API 中设置凭据?

How to set credentials in new Amazon Alexa.com Rank API in Php?

我正在开发新的 Alexa.com Api 并对其进行测试,但我在其中设置凭据时遇到了问题。我有访问密钥和秘密密钥,但没有会话令牌和 Expiration.Idk 从哪里获取它们。 另见此

$awsCredentials = $result->get('Credentials'); 

而且我找不到它的根来设置凭据。

我有一个用于我的 Alexa API 调用的访问密钥和秘密密钥。我已经为 PHP 3

设置了 AWS SDK
protected function SetCredentials($awsCredentials) {
      $this->accessKeyId = $awsCredentials["AccessKeyId"];
      $this->secretAccessKey = $awsCredentials["SecretKey"];
      $this->sessionToken = $awsCredentials["SessionToken"];
      $this->expiration = $awsCredentials["Expiration"];
    }

如何设置凭据?

这是 urlinfo.php 代码:

https://github.com/aws-samples/alexa-web-information-service-api-samples/blob/master/php/urlinfo.php

您的 php 版本有问题,或者您的帐户未通过验证。