我有一个laravel 5.3
需要显示aws quicksight
图表的项目,我遇到的问题是我不知道如何从 AWS SDK 获取图表嵌入 url。
我在一个lambda-node
项目中这样做并且它有效,但在 laravel 中它只是返回{}
这是我的代码,它的响应没有显示任何错误status 200
<?php
namespace App\Http\Controllers;
use Aws\QuickSight\QuickSightClient;
use Illuminate\Http\Request;
use App\Models\QuicksightDashboard;
class DashboardController extends Controller
{
//
public function getDashboard($id) {
$dashboards = QuicksightDashboard::find($id);
$quick = new QuickSightClient([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [
'key' => '...',
'secret' => '...',
]
]);
$result = $quick->GetDashboardEmbedUrl([
'AwsAccountId' => '...',
'DashboardId' => '...',
'IdentityType' => 'IAM',
'ResetDisabled' => true,
'SessionLifetimeInMinutes' => 600,
'UndoRedoDisabled' => false
]);
return response()->json([
'code' => 200,
'message' => 'Operation successfull',
'dashboard' => $result,
]);
}
}
正如我之前提到的,我传递了正确的凭据和权利accountId
,dashboardId
我还缺少什么?