Forum Discussion

alops1's avatar
alops1
Frequent Visitor
1 year ago
Solved

Call an api with a filter

Hello all colleagues, I need your help. I am trying to call an api with a filter through power query, but I receive this error.   I attach the code: What am I doing wrong? thank you ...
  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    1 year ago

    Hi  ,
    Thanks for reaching out to the Microsoft fabric community forum.

    Try to modify the M query into this 

    let
        api = url_getEventPending & apiEvent & "/search",
        token = getTokenData(),
        idValue = "667995612c15a237078c605e",
        fullUrl = api & "?id=" & idValue,
        
        apiResponse = Web.Contents(
            fullUrl,
            [
                Headers = [
                    Authorization = token,
                    #"Content-Type" = "application/json"
                ]
            ]
        ),
        
        FormatAsJsonQuery = Json.Document(apiResponse)
    in
        FormatAsJsonQuery
    


    and check if you are able to bypass the error.

    If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
    Thank you