tangent-solutions / powerbi-sdk
PHP SDK for working with PowerBI
Installs: 79 818
Dependents: 0
Suggesters: 0
Security: 0
Stars: 42
Watchers: 12
Forks: 33
Open Issues: 5
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- codacy/coverage: ^1.1
- mockery/mockery: ^0.9.9
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-11-24 02:33:37 UTC
README
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
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.