Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PBIResDeveloper
New Member

Creating new Dataset via REST API

Hello,

 

I am trying to create new Push Dataset by using REST API using PostDataset method described in documentation (https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_postdataset)

 

No matter what Request body I am using (if it is not blank) I am always getting error 400 with following message: 

{"error":{"code":"FailedToDeserializeDatasetError","pbi.error":{"code":"FailedToDeserializeDatasetError","parameters":{},"details":[],"exceptionCulprit":1}}}

 

I am using Ruby language for calling endpoints. I am able, for example, to Clone reports, list datasets or tables so the basic code should be ok. Some sample code I am using is this:

 

response = HTTParty.post(
	"https://api.powerbi.com/v1.0/myorg/groups/#{workspace_id}/datasets",
	:body => {
		name: 'TEST VIA API',
		defaultMode: 'Push',
		tables: [
			{
				name: 'Test Table',
				columns: [
					{
						dataType: 'string',
						name: 'Name'
					}
				]
			}
		]
	},
	:headers => auth.auth_header
)

Any ideas what might be wrong?

0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.