Forum Discussion

jherynk's avatar
jherynk
Frequent Visitor
7 years ago
Solved

HTTP Request Header "Range"

My API integration only returns 25 records by default.  I'd like to return 1000.  I'm attempting to pass the Range parameter through the HTTP Request and cannot figure out the syntax.     [Headers=...
  • jherynk's avatar
    6 years ago

    Because the Range parameter is protected or non-typical within a web.contents request, it's best to build the request in "Logic Apps" first.  From Power Bi's Advanced Editor, use Power Query to point the request to the logic app.  The logic app will define the Range parameter.  

     

    Power Query Example:

     

    let

    url="https://westus2.logic..com:443/work..../.../",
    body="{
    ""authHeader"": ""Basic ABCDEFG12345"",
    ""rangeHeader"": ""items=0-2000""
    }",

    Source = Json.Document(Web.Contents(url,[
    Headers = [#"Content-Type"="application/json"],
    Content = Text.ToBinary(body)
    ]
    )),
    in
    #"Source"