<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: API Connection in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3145853#M41856</link>
    <description>&lt;P&gt;Authorization also needs to be added to the Header. Please try again after making the header changes&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2023 22:10:59 GMT</pubDate>
    <dc:creator>karthiknc</dc:creator>
    <dc:date>2023-03-21T22:10:59Z</dc:date>
    <item>
      <title>API Connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3145654#M41853</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to connect in API with method POST and authorization token, but the response is 404 or 400.&lt;/P&gt;&lt;P&gt;I tried with M language:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
Json = Json.FromValue({[idType= "Authorization", idValue= "KEY123"]}),
Source = Json.Document(Web.Contents("https://apiintegracao.milvus.com.br/api/chamado/listagem", [Headers=[#"Content-Type"="application/json"]]))
in
Source&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I tried with Web Data Source, and not works?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thialessandro_0-1679429489985.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/890640iBEE84236EDDE57D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="thialessandro_0-1679429489985.png" alt="thialessandro_0-1679429489985.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The API link I'm trying to connect:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.milvus.com.br/#api-Chamado-listagemChamados" target="_blank" rel="noopener"&gt;https://developers.milvus.com.br/#api-Chamado-listagemChamados&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone can help me, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry about my level English.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 20:15:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3145654#M41853</guid>
      <dc:creator>thialessandro</dc:creator>
      <dc:date>2023-03-21T20:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: API Connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3145853#M41856</link>
      <description>&lt;P&gt;Authorization also needs to be added to the Header. Please try again after making the header changes&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 22:10:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3145853#M41856</guid>
      <dc:creator>karthiknc</dc:creator>
      <dc:date>2023-03-21T22:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: API Connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3148460#M41885</link>
      <description>&lt;P&gt;I tried, but not works too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I'm trying this way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
content = "{""filtro_body"": ""123""}",


Source = Json.Document(Web.Contents("https://apiintegracao.milvus.com.br/api/chamado/listagem",
                       [Headers=[#"Authorization"="token", 
                                 #"apikey" = "****", 
                                 #"filtro_body" = "{}",
                                 #"ContentType"="application/json"], 
                                  
                        ManualStatusHandling = {404, 400},
                        
                       
                        Content=Text.ToBinary(content)]))

in
Source&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And not works too, but show me another message "&lt;SPAN class=""&gt;Parameter not informed in the request body =&amp;gt; {filtro_body}"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I added the parameter 'filtro_body", but the message remains&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 00:27:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3148460#M41885</guid>
      <dc:creator>thialessandro</dc:creator>
      <dc:date>2023-03-23T00:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: API Connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3634135#M48712</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Use a Python script being read directly by Power BI to query the API. Refer to the API&amp;nbsp;&lt;A href="https://developers.milvus.com.br/#api-Chamado-listagemChamados" target="_blank"&gt;https://developers.milvus.com.br/#api-Chamado-listagemChamados&lt;/A&gt; documentation to modify the parameters and the filter body ('filtro_body')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;import requests&lt;BR /&gt;import pandas as pd&lt;BR /&gt;import json&lt;/P&gt;&lt;P&gt;url = "&lt;A href="https://apiintegracao.milvus.com.br/api/chamado/listagem" target="_blank"&gt;https://apiintegracao.milvus.com.br/api/chamado/listagem&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;# Add Query Param to the URL&lt;BR /&gt;url += "?total_registros=1000"&lt;/P&gt;&lt;P&gt;payload = json.dumps({&lt;BR /&gt;"filtro_body": {&lt;BR /&gt;"status": 4,&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;headers = {&lt;BR /&gt;'Content-Type': 'application/json',&lt;BR /&gt;'Authorization': '123token'&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;response = requests.request("POST", url, headers=headers, data=payload)&lt;/P&gt;&lt;P&gt;# Parse the JSON response&lt;BR /&gt;data = response.json()&lt;/P&gt;&lt;P&gt;# Check if the response was successful&lt;BR /&gt;if 'lista' in data:&lt;BR /&gt;# Convert the response data to a DataFrame&lt;BR /&gt;df = pd.DataFrame(data['lista'])&lt;/P&gt;&lt;P&gt;# Select and organize columns&lt;BR /&gt;columns_to_select = ["codigo", "cliente", "contato", "categoria_primaria", "categoria_secundaria", "tecnico", "total_horas", "data_criacao", "data_solucao", "servico_realizado"]&lt;BR /&gt;if all(col in df.columns for col in columns_to_select):&lt;BR /&gt;df = df[columns_to_select]&lt;BR /&gt;&lt;BR /&gt;# Format date columns, if necessary&lt;BR /&gt;df["data_criacao"] = pd.to_datetime(df["data_criacao"])&lt;BR /&gt;df["data_solucao"] = pd.to_datetime(df["data_solucao"])&lt;/P&gt;&lt;P&gt;# Display DataFrame in tabular format&lt;BR /&gt;print(df.to_string(index=False))&lt;BR /&gt;else:&lt;BR /&gt;print("Some specified columns are not present in the DataFrame returned by the API.")&lt;BR /&gt;# Add logic here to handle the situation of missing columns, if necessary.&lt;BR /&gt;else:&lt;BR /&gt;print("Error in API response:", data)&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 19:30:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Connection/m-p/3634135#M48712</guid>
      <dc:creator>JanainaValim</dc:creator>
      <dc:date>2024-01-11T19:30:07Z</dc:date>
    </item>
  </channel>
</rss>

