API Automation in Power BI

Hello,

I am trying to automate daily reports from Genesys Cloud into Power BI using the API /api/v2/analytics/conversations/details/jobs. The goal here would be to export the data from all interactions (voice, email, chats) and compare this data to our internal database. After checking if the phone number and/or email address match our records, we will be sending out our Customer Experience Survey. Does anyone know how to set up this API in Power BI? Thank you!

El inconveniente de /api/v2/analytics/conversations/details/jobs es que tienes que consultar cuando el trabajo hasta que el mismo este terminado.
Usando Power Query no vas a poder realizar esa pausa en la ejecución hasta que el trabajos e finalice por lo que si es necesario usar si o si ese método de consulta, vas a tener que cargar los datos desde un script de Python.

Thank you for the insight. According to the Developer Center, APIs ending in 'jobs' retrieve data asynchronously whether APIs ending in 'query' are synchronous, retrieving real-time data. At the moment, I am not interested in the real-time data since it could cause loss of data if the interaction is not finalized. The end goal will be to run a report every day (probably outside of our business hours) and automate the process in a way that Power BI will receive the data from Genesys and then compare the data with another table.

By any chance, do you know what would be a recommended API that contains the following data?
Media Type, ANI, DNIS, To, From, and Initial Direction?

FWIW this is not correct. All analytics results, whether query or jobs, are expected to be 100% accurate at the time they are retrieved. This does include in-progress conversations, if your filter doesn't exclude them. Jobs and queries both perform exactly the same operation to retrieve data; jobs simply allow larger data sets to be retrieved due to their async nature.

All of that is in the analytics data.

Thank you! I have tried multiple of them and the majority of them are returning error 400 (bad request). I have reviewed the syntax trying to find any error, but I can't see it. Here is an example (this is for a POST API):

let
GetDataForDate = (StartDate, EndDate) =>
let
StartDateText = DateTime.ToText(StartDate, "yyyy-MM-ddTHH:mm:ss") & "Z",
EndDateText = DateTime.ToText(EndDate, "yyyy-MM-ddTHH:mm:ss") & "Z",
url = "https://api.usw2.pure.cloud/api/v2/analytics/reporting/exports",
body = "{
""name"":""My User Name"",
""timeZone"": ""UTC"",
""exportFormat"": ""CSV"",
""interval"": """ & StartDateText & "/" & EndDateText & """,
""period"": ""P1D"",
""viewType"":[
""DNIS_PERFORMANCE_DETAIL_VIEW""
],
""filter"": [
""mediaTypes"",
""directions"",
""addressTos"",
""addressFroms"",
""aniList"",
],
""locale"": ""en-US"",
}",

Parsed_JSON = Json.Document(body),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
Source = Json.Document(Web.Contents(url,[Headers = [Authorization="Bearer "&#"Get Token (2)"(), #"Content-Type"="application/json"], Content = Text.ToBinary(body) ] )),
#"Converted to Table" = Record.ToTable(Source)
in
#"Converted to Table"
in
GetDataForDate

Reports are entirely separate from queries and jobs. If you're trying to get data to use programmatically, reports are not what you want.

The response body will typically indicate what is wrong with the request. What error message are you getting?

This is the most common:

That doesn't show the response body.

What do you mean by response body? Where can I find it?

The HTTP response body: HTTP Messages - HTTP | MDN

I'm not familiar with Power BI; I don't know how your software provides this to you, but it's a standard part of the HTTP protocol.

@lsilvaneto ahora entiendo un poco lo que quieres hacer, mi recomendación sería la siguiente:
Primero: desarrolla una app (para esto hay muchos SDK de Genesys) la misma de forma diaria tiene que descargar los datos una vez finalizada tu jornada laboral. Podes usar Jobs para estas descargas.
Segundo: Guarda esos datos de forma local en un archivo de texto (json o txt). Podes pisarlo diariamente o lo que mejor se adapte a tu necesidad.
Tercero: Con Power Bi lees ese archivo de texto para armar tu modelo de datos.

Espero que te guie mas o menos en el camino que buscas.
Saludos

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.