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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
aignn
Helper II
Helper II

How can i get data from web API with my json data?

Hello!

 

I have api, https://site.com/api

I have json data that I need to run the query:

{
  "aggs": {
    "round_aggs": {
      "terms": {
        "field": "host.hostname.keyword",
        "size": 2000
      }
    }
  },
  "size": 0
}

 

How can i get data from web API with my json data?

 

i have this example:

let
Json = Json.FromValue({[idType= "ID_ISIN", idValue= "US4592001014"], [idType = "ID_WERTPAPIER", idValue = "851399", exchCode = "US" ]}),
Source = Json.Document(Web.Contents("https://api.openfigi.com/v1/mapping?", [Headers=[#"Content-Type"="application/json"], Content=Json]))
in
Source

But I don't know how to do this with my json data

 

Thanks in advance

1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @aignn 

 

use this syntax for your Json-step

Json = Json.Document("{#(cr)#(lf)  ""aggs"": {#(cr)#(lf)    ""round_aggs"": {#(cr)#(lf)      ""terms"": {#(cr)#(lf)        ""field"": ""host.hostname.keyword"",#(cr)#(lf)        ""size"": 2000#(cr)#(lf)      }#(cr)#(lf)    }#(cr)#(lf)  },#(cr)#(lf)  ""size"": 0#(cr)#(lf)}")

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

View solution in original post

1 REPLY 1
Jimmy801
Community Champion
Community Champion

Hello @aignn 

 

use this syntax for your Json-step

Json = Json.Document("{#(cr)#(lf)  ""aggs"": {#(cr)#(lf)    ""round_aggs"": {#(cr)#(lf)      ""terms"": {#(cr)#(lf)        ""field"": ""host.hostname.keyword"",#(cr)#(lf)        ""size"": 2000#(cr)#(lf)      }#(cr)#(lf)    }#(cr)#(lf)  },#(cr)#(lf)  ""size"": 0#(cr)#(lf)}")

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.