Giter Club home page Giter Club logo

powerbi-sdk-php's Introduction

PowerBI PHP SDK

Build Status Codacy Badge Codacy Badge

A SDK which makes it easier to work with the PowerBI REST API.

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:

$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:

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

Documentation

Wiki

PowerBI API Reference

Issues

View or log issues on the Issues tab on the repo.

Copyright and License

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

powerbi-sdk-php's People

Contributors

lhidalgo42 avatar geevcookie avatar andreybolonin avatar elwingert avatar beachcoffee avatar andyparkerson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.