Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Opsgenie integration with PowerBI using Rest API

Ajaykumar Panchal September 14, 2020

I am trying to integrate Opsgenie alerts api in PowerBi using Web contents. But I facing challenges to fetch list of alerts lets say for last one months. As it limits the record to 100 for API call. Can you please help us with DAX query in powerBI to meet the requirement of fetching data for last month. can you please help on how we can use pagination as an option.

 

2 answers

1 vote
Robert
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 15, 2020

Hi @Ajaykumar Panchal !

 

A URL for the next set of alerts will be returned in the headers and body of your API call. We have documentation on pagination here:

 

https://docs.opsgenie.com/docs/pagination

0 votes
Luis Miguel Zuñiga Cervantes December 26, 2020

Hi @Ajaykumar Panchal

I have the same problem. I've tried with loops in Power Query but didn't work.

Did you find the solution ?

 

Ajaykumar Panchal January 19, 2021
let
 iterations = 10,          // Number of iterations
 url = 
  "https://api.opsgenie.com/v2/alerts?query=<enter your query here>",
 
 FnGetOnePage =
  (url) as record =>
   let
    Source = Json.Document(Web.Contents(url,[Headers=[Authorization="GenieKey XXXXXXXXXXXXXXXXXXXXXXXXX"])),
    data = try Source[data] otherwise null,
    next = try Source[paging][next] otherwise null,
    res = [Data=data, Next=next]
   in
    res,
 
 GeneratedList =
  List.Generate(
   ()=>[i=0, res = FnGetOnePage(url)],
   each [i]<iterations and [res][Data]<>null,
   each [i=[i]+1, res = FnGetOnePage([res][Next])],
   each [res][Data])
 in
  GeneratedList

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events