Forum Discussion
KaiquePassaros
1 year agoNew Member
Credential error - Connecting Power BI to a Notion API
Hello everyone! I have a problem with updating a dataset that is connected to the NOTION platform via API. I am trying to register a Web API data source. It works perfectly in Power BI Desktop. Howe...
KaiquePassaros
1 year agoNew Member
I'm using the following code, in anonymous model it works fine, but when I put it in a gateway for update it says that it is not possible to obtain authentication, as presented previously. Code:
let
notion_url = "https://api.notion.com/v1/databases/" & Database_ID_Eventos & "/query",
notion_req =
Web.Contents(
notion_url,
[
Headers = [
#"Content-Type" = "application/json",
#"Notion-Version" = "2022-06-28",
Authorization=" Bearer "& AppToken_Marketing
],
Content = Json.FromValue([])
]),
notion_res = Json.Document(notion_req),
results = notion_res[results]
in
results