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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.