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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
SarahAlsterspre
Helper II
Helper II

Pull Data from timebutler

Hey,

 

I want to get some data from our employees absences from the tool we use called timebutler. Unfortunately they only accept http POST requests and Power BI seems to use GET. I have a link (https://timebutler.de/api/v1/absencesand an API Token. According to the documentary a  CSV UTF-8 coded will be provided. I also have to set a parameter for the year (YYYY). So my question now is... How.. 😄 I am a newbie regarding these M queries so I am looking forward to your help for generating a customized query in M.

 

Greets

1 REPLY 1
Anonymous
Not applicable

Hi @SarahAlsterspre ,

 

  1. In Power BI Desktop, go to Home > Advanced Editor.
  2. Replace the existing code with the following M query:

 

let
    apiToken = "your_api_token_here",
    year = "2022",
    url = "https://timebutler.de/api/v1/absences",
    headers = [
        #"Content-Type" = "application/json",
        #"Authorization" = "Bearer " & apiToken
    ],
    options = [
        Headers = headers,
        Content = Text.ToBinary("year=" & year),
        ManualStatusHandling = {400, 404}
    ],
    response = Web.Contents(url, options),
    statusCode = Value.Metadata(response)[Response.Status],
    result = if statusCode = 200 then
                Csv.Document(response, [Delimiter=",", Encoding=65001, QuoteStyle=QuoteStyle.None])
             else
                error "Request failed with status code: " & Text.From(statusCode)
in
    result

 

  1. Replace with your actual API token.

Please refer to the following document for more information.

Power Query Web connector - Power Query | Microsoft Learn

Pull data from API using POST method in Power BI - Microsoft Fabric Community

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors