The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all! Having the darndest time trying to get data from this API endpoint into Power BI:
https://developer.tenable.com/reference/vulnerabilities-import-v2
Searched far and wide, and seems the consensus on this forum is to use a third party tool like Postman but was hoping I could get around it by:
If anyone has any ideas, would love to hear it. Here are my queries:
Parameter:
let
ImportVulnerabilityData = (apiKey as text, data as text) =>
let
url = "https://cloud.tenable.com/vulnerability-import/v2",
headers = [
#"X-ApiKeys" = apiKey,
#"Content-Type" = "application/json"
],
response = Web.Contents(url, [
Headers=headers,
Content=Text.ToBinary(data)
]),
jsonResponse = Json.Document(response)
in
jsonResponse
in
ImportVulnerabilityData
Data:
let
Source = ImportVulnerabilityData,
apiKey = "accessKey=123;secretKey=321",
importedData = Source(apiKey, null),
dataTable = Table.FromList(importedData, Record.FieldValues, {})
in
dataTable
And my error message, not sure why Power BI can't see the parameter:
Hi, @bavarian_bear
The error you're experiencing may be due to how the parameters are passed or how the API response is handled. Make sure that the variables passed into the function are properly formatted. The API key should match the expected format required by the Tenable API. Make sure that all required headers and parameters are specified correctly. Pay special attention to any required headers, HTTP methods, and URL parameters. You can refer to the Tenable API documentation:
Import vulnerabilities v2 (tenable.com)
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
"ImportVulnerabilityData" is not the name of one of your queries. Your Source row in your "Data" query is therefore failing as it can't find a query of that name.
I think what you intended to do was:
let
apiKey = "accessKey=123;secretKey=321",
importedData = #"POST API"(apiKey, null),
dataTable = Table.FromList(importedData, Record.FieldValues, {})
in
dataTable
Also rename your function query to be a name without spaces, maybe something like fn_PostAPI. Just makes calling it easier.
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
27 |
User | Count |
---|---|
181 | |
88 | |
70 | |
48 | |
46 |