alexkart/looker-php-sdk

PHP SDK for Looker API

0.2.0 2023-06-02 09:37 UTC

This package is auto-updated.

Last update: 2024-08-31 00:41:27 UTC


README

API 4.0 is the current release of the Looker API. API 3.1 is deprecated. ### Authorization The classic method of API authorization uses Looker API3 credentials for authorization and access control. Looker admins can create API3 credentials on Looker's Admin/Users page. API 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests. For details, see Looker API Authorization. ### API Explorer The API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs. For details, see the API Explorer documentation. ### Looker Language SDKs The Looker API is a RESTful system that should be usable by any programming language capable of making HTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker has an OpenSource sdk-codegen project that provides several language SDKs. Language SDKs generated by sdk-codegen have an Authentication manager that can automatically authenticate API requests when needed. For details on available Looker SDKs, see Looker API Client SDKs. ### API Versioning Future releases of Looker expand the latest API version release-by-release to securely expose more and more of the core power of the Looker platform to API client applications. API endpoints marked as "beta" may receive breaking changes without warning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking changes in future releases. For details, see Looker API Versioning. ### In This Release API 4.0 version was introduced to make adjustments to API functions, parameters, and response types to fix bugs and inconsistencies. These changes fall outside the bounds of non-breaking additive changes we can make to the previous API 3.1. One benefit of these type adjustments in API 4.0 is dramatically better support for strongly typed languages like TypeScript, Kotlin, Swift, Go, C#, and more. See the API 4.0 GA announcement for more information about API 4.0. The API Explorer can be used to interactively compare the differences between API 3.1 and 4.0. ### API and SDK Support Policies Looker API versions and language SDKs have varying support levels. Please read the API and SDK support policies for more information.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 4.0.23.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit https://help.looker.com

There is also an Advanced Looker PHP SDK. It adds extra functionality on top of this generated SDK for ease of use like a simplified login process, automatic access token renewal, etc.

Installation & Usage

Composer

composer require alexkart/looker-php-sdk

Manual Installation

Download the files and include autoload.php:

require_once('/path/to/looker-php-sdk/vendor/autoload.php');

Getting Started

See usage examples in the examples folder. Set your API credentials in the login.php.

Requirements

PHP 5.5 and later

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\AlertApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$limit = 789; // int | (Optional) Number of results to return (used with `offset`).
$offset = 789; // int | (Optional) Number of results to skip before returning any (used with `limit`).

try {
    $result = $apiInstance->alertNotifications($limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AlertApi->alertNotifications: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://localhost:20000/api/3.1

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author