power bi api
In this article, I am going to explain how to use the Power BI REST API to programmatically access the Power BI Service features. I’ll also discuss the basis of REST API and how to use the APIs using Postman. Using the Power BI REST API, you can programmatically manage the administrative services like getting a list of dashboards and workspaces, refreshing a dataset, copying a dashboard from one workspace to another, and so on.
在本文中,我将解释如何使用Power BI REST API以编程方式访问Power BI Service功能。 我还将讨论REST API的基础,以及如何使用Postman使用API。 使用Power BI REST API,您可以以编程方式管理管理服务,例如获取仪表板和工作区列表,刷新数据集,将仪表板从一个工作区复制到另一个工作区,等等。
In order to securely access the Power BI REST API, we first need to request an embed token using which we can call the APIs and execute our functions. Although several operations can be performed using the REST APIs, in this article, we will specifically investigate how to authorize an application and call the APIs using Postman.
为了安全地访问Power BI REST API,我们首先需要请求一个嵌入令牌,我们可以使用该令牌来调用API并执行我们的功能。 尽管可以使用REST API执行若干操作,但在本文中,我们将专门研究如何授权应用程序并使用Postman调用API。
什么是REST API? (What is a REST API?)
The abbreviation of REST stands for Representational State Transfer, and API stands for Application Programming Interface. Let us assume that you are trying to find the football scores for your favorite team. You open the browser, search for your team, and then hit enter, and the results are displayed on your screen as expected. A REST API also works in a similar fashion. Using the REST API, you can search for some items, and then the results will be returned from the service you initiated the request.
REST的缩写代表再表象小号泰特贸易交接,并且API代表A pplication P 我方法在AGC覆盖整个院落。 让我们假设您正在尝试查找最喜欢的球队的足球得分。 您打开浏览器,搜索您的团队,然后按Enter键,结果将按预期显示在屏幕上。 REST API也以类似的方式工作。 使用REST API,您可以搜索一些项目,然后结果将从您发起请求的服务中返回。
The REST API consists of simple anatomy as follows:
REST API包含以下简单的解剖结构:
- The Endpoint: This is the URL of the resource to which we are going to place the requests. For example, https://api.powerbi.com/v1.0/myorg/ 端点 :这是我们要向其发出请求的资源的URL。 例如,https://api.powerbi.com/v1.0/myorg/
- The Method: Although there are multiple methods to call a REST API, the most common ones are GET and POST. The GET is used to retrieve information while the POST is used to send information to the resource on the web 方法 :尽管有多种方法可以调用REST API,但最常见的方法是GET和POST。 GET用于检索信息,而POST用于将信息发送到Web上的资源
- The Headers: The authentication mode and the content types 标头 :身份验证模式和内容类型
- The Data (Body): Textual data in the form of JSON, which needs to be sent to the resource 数据(正文) :JSON形式的文本数据,需要发送到资源
In this article, we will be using a tool known as Postman for making the API calls. A postman is a free tool using which you can make GET or POST calls to various URLs and save the results in a collection. You can download the tool from the official website of