0

I have a laravel 5.3 project where i need to display an aws quicksight graph, the problem i have is that i don't know how to get the graph embed url from the AWS SDK.

i did this in a lambda-node project and it worked, but in laravel it just returns {}

this is my code, it does not show any error an the response it's a 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,
        ]);
    }
}

as i mentioned before, i am passing the right credentials and the right accountId and dashboardId what else am i missing?

Carlos Salazar
  • 1,818
  • 5
  • 25
  • 48

1 Answers1

0

I have to return the field that i want for it to work.

return $quick->GetDashboardEmbedUrl([
            'AwsAccountId' => '...',
            'DashboardId' => '...',
            'IdentityType' => 'IAM',
            'ResetDisabled' => true,
            'SessionLifetimeInMinutes' => 600,
            'UndoRedoDisabled' => false
        ])->get('EmbedUrl');

this way i get the embed url.

Carlos Salazar
  • 1,818
  • 5
  • 25
  • 48