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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kasife
Helper V
Helper V

Query details in a rest API

Hi, guys!

Can anyone help me identify where I'm going wrong in this API query?

I have this API query that searches for the system's projects. Records are being returned ok

 

 

let
    Fonte = 
        Json.Document(
            Web.Contents(
                "https://empresa.cvcrm.com.br/", 
                [
                    RelativePath = "api/cvio/empreendimento", // O que altera sempre será o RelativePath -> Que é a consulta que deseja fazer, cuidar sempre com os vários tipos de consultas.
                    Headers = 
                    [
                        accept = "application/json",
                        email = _email,
                        token = _token
                    ]
                ]
            )
        ),
    #"Converted to Table" = Table.FromList(Fonte, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"idempreendimento", "nome", "cidade", "estado", "sigla", "logo", "foto_listagem", "foto"}, {"idempreendimento", "nome", "cidade", "estado", "sigla", "logo", "foto_listagem", "foto"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"idempreendimento", type text}, {"nome", type text}, {"cidade", type text}, {"estado", type text}, {"sigla", type text}, {"logo", type text}, {"foto_listagem", type text}, {"foto", type text}})
in
    #"Changed Type"

 

 

Here are the parameters of this query

kasife_1-1670813711218.png

 

I created the code below to return all the details of the projects from the query above

 

 

 

let
    Fonte = 
        Json.Document(
            Web.Contents(
                "https://empresa.cvcrm.com.br/", //Mantém o host da consulta
                [
                    RelativePath = "api/cvio/empreendimento/{idEmpreendimento}" ,       
                    Headers = 
                    [
                        accept = "application/json",
                        email = _email,
                        token = _token
                    ]
                ]
            )
        )
in
    Fonte

 

 

 

 Here are the necessary parameters

kasife_0-1670813359078.png

 When invoking, information is displayed that the enterprise is not found

kasife_2-1670813906915.png

Can anyone tell me where I might be going wrong?

 

Thanks so much

1 REPLY 1
v-jialluo-msft
Community Support
Community Support

Hi  @kasife ,

 

According to your description, your question is that you can't find the corresponding data when querying the data using the REST API.
You can check the query process by referring to the following link:

How to Download JSON Data in Power BI from Web Sources (codingsight.com)

 

Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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