2017 © Pedro Peláez
 

library powerbi-sdk

PHP SDK for working with PowerBI

image

tangent-solutions/powerbi-sdk

PHP SDK for working with PowerBI

  • Monday, June 12, 2017
  • by geevcookie
  • Repository
  • 12 Watchers
  • 11 Stars
  • 2,996 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 6 Open issues
  • 1 Versions
  • 26 % Grown

The README.md

PowerBI PHP SDK

Build Status Codacy Badge Codacy Badge, (*1)

A SDK which makes it easier to work with the PowerBI REST API., (*2)

Installation

composer require tangent-solutions/powerbi-sdk

Usage

You will first have to obtain an authorized access token. See the below example on how to do this with the League OAuth2 Client:, (*3)

$provider = new \League\OAuth2\Client\Provider\GenericProvider([
    'clientId'                => '<client-id>',
    'clientSecret'            => '<client-secret>',
    'urlAuthorize'            => 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
    'urlAccessToken'          => 'https://login.windows.net/<tenant-id>/oauth2/token',
    'urlResourceOwnerDetails' => '',
    'scopes'                  => 'openid',
]);

try {
    // Try to get an access token using the resource owner password credentials grant.
    $accessToken = $provider->getAccessToken('password', [
        'username' => '<Azure-Username>',
        'password' => '<Azure-Password>',
        'resource' => 'https://analysis.windows.net/powerbi/api'
    ]);

    $token = $accessToken->getToken();
} catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
    // Failed to get the access token
    exit($e->getMessage());
}

Once you have the access token you can create the client like this:, (*4)

$client = new \Tngnt\PBI\Client($token);

Documentation

Wiki, (*5)

PowerBI API Reference, (*6)

Issues

View or log issues on the Issues tab on the repo., (*7)

Copyright (c) Tangent Solutions. All Rights Reserved. Licensed under the MIT license., (*8)

The Versions

12/06 2017

dev-master

9999999-dev

PHP SDK for working with PowerBI

  Sources   Download

MIT

The Requires

 

The Development Requires