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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bavarian_bear
New Member

How to import data using a POST API? Specifically from Nessus Tenable endpoint

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:

 

  1. Setting up a parameter function in Power Query
  2. Setting up an a subsequent query referencing that parameter to pull in the data

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:

Screenshot 2024-04-08 at 2.58.53 PM.png

 

2 REPLIES 2
Anonymous
Not applicable

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.

RossEdwards
Solution Sage
Solution Sage

"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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.