Forum Discussion
SarahAlsterspre
Helper II
3 years agoPull 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 (ht...
Anonymous
3 years agoNot applicable
Hi SarahAlsterspre ,
- In Power BI Desktop, go to Home > Advanced Editor.
- 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
- 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.