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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
carlosfinezi
New Member

How to use API to get data

 

Hello guys.
Could someone help me?
I hava an ERP which has this API to get data.

POST: https://microworkcloud.com.br/api/integracao/terceiro

 

 
            Header:
            Content-Type: application/json
            Host: microworkcloud.com.br
            Authorization: Bearer SUA_CREDENCIAL

            Body Request:
            {
                "idrelatorioconfiguracao": 375,
                "idrelatorioconsulta": 186,
                "idrelatorioconfiguracaoleiaute": 857,
                "idrelatoriousuarioleiaute": null,
                "ididioma": 1,
                "listaempresas": [1,2,3,4,5,6,7,8,9,10,11],
                "filtros": "DataInicialFiltrar=2025-02-14;
    ContaFinanceiraFiltrar=null;
    TipoContaFiltrar=null"
            }

I would like to test this API but i wasn’t able to do that.
I have bearer token but didn’t work.
Any idea?

1 ACCEPTED SOLUTION

Please follow the documentation. Use the payload parameter to make it a POST. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-2

View solution in original post

8 REPLIES 8
v-saisrao-msft
Community Support
Community Support

Hi @carlosfinezi,

 

We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @carlosfinezi,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Atendimento1bit
New Member

Then i try removing manual credential.

 

let
url = "https://microworkcloud.com.br/api/integracao/terceiro",
headers = [
#"Content-Type" = "application/json",
#"Authorization" = "Bearer SUA_CREDENCIAL"
],
body = Json.FromValue([
idrelatorioconfiguracao = 375,
idrelatorioconsulta = 186,
idrelatorioconfiguracaoleiaute = 857,
idrelatoriousuarioleiaute = null,
ididioma = 1,
listaempresas = {1,2,3,4,5,6,7,8,9,10,11},
filtros = "DataInicialFiltrar=2025-02-14;ContaFinanceiraFiltrar=null;TipoContaFiltrar=null"
]),
response = Web.Contents(
url,
[
Headers = headers,
Content = body,
ManualStatusHandling = {400, 401, 403, 500}
]
),
jsonResponse = Json.Document(response)
in
jsonResponse

But then PBI ask me credentials, but my credential is bearer token. When testing in postman i dont need to use any credential, only token.Captura de tela 2025-02-24 165233.png

Atendimento1bit
New Member

This is what i'm putting in m query:

 

let
url = "https://microworkcloud.com.br/api/integracao/terceiro",
headers = [
#"Content-Type" = "application/json",
#"Authorization" = "Bearer SUA_CREDENCIAL"
],
body = Json.FromValue([
idrelatorioconfiguracao = 375,
idrelatorioconsulta = 186,
idrelatorioconfiguracaoleiaute = 857,
idrelatoriousuarioleiaute = null,
ididioma = 1,
listaempresas = {1,2,3,4,5,6,7,8,9,10,11},
filtros = "DataInicialFiltrar=2025-02-14;ContaFinanceiraFiltrar=null;TipoContaFiltrar=null"
]),
response = Web.Contents(
url,
[
Headers = headers,
Content = body,
ManualStatusHandling = {400, 401, 500},
ManualCredentials = true
]
),
jsonResponse = Json.Document(response) // ← Sem encoding!
in
jsonResponse


But i have this error:
Expression.Error: 'ManualCredentials' não é uma opção de Web.Contents válida. As opções válidas são:
ApiKeyName, Content, ExcludedFromCacheKey, Headers, IsRetry, ManualStatusHandling, Query, RelativePath, Timeout

lbendlin
Super User
Super User

Stuff like this is usually tested via Postman before being ported to Power Query.

I tested it there. I got the data. But I could not inside Power BI desktop.

Please follow the documentation. Use the payload parameter to make it a POST. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-2

Hello  @carlosfinezi,

We are glad to hear that when you have tested your API in postman and it got sucessfully worked as expected. But as per my understading when you are trying to connect the API inside Power BI Desktop, it didn’t work. Could you please tell us what should be your expected outcome, so that we will guide you accordingly.
Also if possible please share the error screenshot if you encountered any.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.