Potrzebuję jakiegoś przykłądu i jeśłi ktoś posiada jakiś krok po kroku co trzeba zrobić, żeby to w końcu uruchomić. Od kilku dni próbuję ale ciągle napotykam jakieś problemu i nie wiem czy ja taki 'tępy" jestem czy to API jest takie popierniczone.
Co chciałbym osiągnąć, po ierwsze w końcu podłączyć się z pozytywnym efektem co jak narazie .... mnie zabija,
niby robię wszystko jak napisane i dalej mam problem.
Używam sugerowanego Google API CLient 2.0
w końcu udało mi się odczytać listę folderów ale nie mogę nic więcej, np status użytkownika
dostaję 403 niezależnie od tego jaki scope ustawię .... ;(
Podpowiedzcie albo pokażcie jakiś przykład
// Set your service account credentials and API key $serviceAccountKeyPath = 'moj.json'; $apiKey = 'mojapikey'; $userEmail = 'moj@email.com'; require_once 'vendor/autoload.php'; $client = new Google_Client(); $client->setApplicationName('Email Management'); $client->setAuthConfig($serviceAccountKeyPath); // Add the necessary scopes for the APIs you intend to access $client->addScope('https://www.googleapis.com/auth/admin.directory.user.readonly'); $service = new Google_Service_Directory($client); try { // Call the API to get user status $userStatus = $service->users->get($userEmail, ['projection' => 'full']); // Get and print the user's status information // ... and other status information ... } catch (Google_Service_Exception $exception) { }
Pomóżcie proszę
Serio nikt z tym nie walczy ?