Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have the following query that is working fine in Power BI desktop (I have anonymised the API Key and Workspace ID in the relative path). However, when publised, I am getting an error:Failed to update data source credentials: Web.Contents failed to get contents from 'https://reports.api.clockify.me/' (404): Not Found
Is there any way round this?
let
// Inline dynamic date range: last 365 days
todayDate = DateTime.Date(DateTime.LocalNow()),
startDate = Date.ToText(Date.AddDays(todayDate, -365), "yyyy-MM-dd") & "T00:00:00Z",
endDate = Date.ToText(todayDate, "yyyy-MM-dd") & "T23:59:59.999Z",
// API credentials and endpoint parts
apiKey = "-",
baseUrl = "https://reports.api.clockify.me",
relativePath = "v1/workspaces/-/reports/detailed",
// JSON request body
requestBody = [
dateRangeStart = startDate,
dateRangeEnd = endDate,
exportType = "JSON",
detailedFilter = [
page = 1,
pageSize = 1000
]
],
binaryBody = Json.FromValue(requestBody),
// API call
response = Web.Contents(baseUrl, [
RelativePath = relativePath,
Headers = [
#"X-Api-Key" = apiKey,
#"Content-Type" = "application/json"
],
Content = binaryBody
]),
// Parse and transform response
json = Json.Document(response),
entries = json[timeentries],
table = Table.FromList(entries, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
output = Table.ExpandRecordColumn(table, "Column1", {
"_id", "description", "userId", "timeInterval", "billable", "projectId", "taskId", "tagIds",
"approvalRequestId", "type", "isLocked", "currency", "amount", "rate", "earnedAmount",
"earnedRate", "costAmount", "costRate", "projectName", "projectColor", "clientName",
"clientId", "taskName", "userName", "userEmail"
})
in
output
Hi @Griggs
I took your query and added my own Clockify API Key & Workspace ID, and initially received the same error when setting up Data Source Credentials in the Power BI Service.
After some testing, it seems the only way to avoid the error and validate the Data source credentials is to bypass the connection test by enabling "Skip test connection" as shown here:
This seems to be one of those cases where the Power BI Service simply can't validate the API URL. Changing the split between Base & Relative URLs didn't seem to help in this case.
In any case, after enabling "Skip test connection", I was able to successfully refresh the semantic model in the Service.
Are you also able to get refresh working in the same way?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |