Forum Discussion

patoduck's avatar
patoduck
Helper III
6 years ago
Solved

Json.Document Web.Content Swagger API

Hi,   I have the following code     let Source = Json.Document(Web.Contents("http://193.160.3.15:60003/api/Product?vpArticleNumbers=MYNUMBER", [Headers=[Token="MYTOKEN"]])), Source1 = Source{0}...
  • ImkeF's avatar
    ImkeF
    6 years ago

    Hi

    try this:

     

    Source = Json.Document(Web.Contents("http://193.160.3.15:60003/api/Product?vpArticleNumbers=" & Text.From(vpArticleNumbers), [Headers=[Token="MYTOKEN"]])),

     

    In the syntax higlighting you will see that the first "vpArticleNumbers" will be considered as text, while the second (without quotes) will be regarded as the parameter from your function. It has to be converted as text for the Web.Contents-function.

     

    But please be aware that this query will not refresh in the services as it is. Therefore you have to use the relative path parameter: http://blog.datainspirations.com/2018/02/17/dynamic-web-contents-and-power-bi-refresh-errors/