Forum Discussion
bright
9 years agoHelper I
Powerbi api create dataset http respond Forbidden 403
Help , i use php creat dataset send request but http respond 403 i can't creat dataset on my powerbi <?php
session_start();
$token = $_GET['code'];
$session_state = $_GET['session_state'];
$tablena...
- 9 years ago
What is the $token like in your case? it should be something like "Bearer tokenstring". You can test the REST API alone via POSTMAN.
$token = $_GET['code']; . . $headr[] = "Authorization:$token";
- 9 years ago
session_start(); $access = $this->token(); $token_type = $access->token_type; $token = $access->access_token; date_default_timezone_set('UTC'); $date = date('D , d M Y H:i:s'); //Sun, 20 Sep 2009 20:36:40 GMT $tablename = 'info'; $columns[] = array( 'name'=>'Number', 'dataType'=>'Int64', ); $columns[] = array( 'name'=>'ClinetId', 'dataType'=>'Int64', ); $columns[] = array( 'name'=>'Price', 'dataType'=>'Int64', ); $columns[] = array( 'name'=>'MenuId', 'dataType'=>'string', ); $columns[] = array( 'name'=>'PurchaseTime', 'dataType'=>'DateTime', ); $table = array( 'name'=>$tablename, 'columns'=> $columns, ); $data = array( 'name'=>'Client', 'tables'=>array($table), ); $url ="https://api.PowerBI.com/v1.0/myorg/datasets"; $header[] ="Authorization:$token_type $token"; $header[] ="Content-Type: application/json"; $header[]= "content_length:0"; $data1 = utf8_encode(json_encode($data)); $res = $this->get_respond('creat',$data1,$header,$url); return $res;I find error my cloumn setting woring
Eric_Zhang
9 years agoMicrosoft Employee
What is the $token like in your case? it should be something like "Bearer tokenstring". You can test the REST API alone via POSTMAN.
$token = $_GET['code']; . . $headr[] = "Authorization:$token";
bright
9 years agoHelper I
session_start();
$access = $this->token();
$token_type = $access->token_type;
$token = $access->access_token;
date_default_timezone_set('UTC');
$date = date('D , d M Y H:i:s');
//Sun, 20 Sep 2009 20:36:40 GMT
$tablename = 'info';
$columns[] = array(
'name'=>'Number',
'dataType'=>'Int64',
);
$columns[] = array(
'name'=>'ClinetId',
'dataType'=>'Int64',
);
$columns[] = array(
'name'=>'Price',
'dataType'=>'Int64',
);
$columns[] = array(
'name'=>'MenuId',
'dataType'=>'string',
);
$columns[] = array(
'name'=>'PurchaseTime',
'dataType'=>'DateTime',
);
$table = array(
'name'=>$tablename,
'columns'=> $columns,
);
$data = array(
'name'=>'Client',
'tables'=>array($table),
);
$url ="https://api.PowerBI.com/v1.0/myorg/datasets";
$header[] ="Authorization:$token_type $token";
$header[] ="Content-Type: application/json";
$header[]= "content_length:0";
$data1 = utf8_encode(json_encode($data));
$res = $this->get_respond('creat',$data1,$header,$url);
return $res;I find error my cloumn setting woring