question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

GetDataReport always returns ReportNotAvailable

I am trying to call GetDataReport, but I always receive ReportNotAvailable as a result.


My C# call looks like this:

var task = await PlayFabAdminAPI.GetDataReportAsync(new PlayFab.AdminModels.GetDataReportRequest()
{
    ReportName = "MonthlyOverviewReport",
    Day = DateTime.Now.Day,
    Month = DateTime.Now.Month,
    Year = DateTime.Now.Year,
});

I also tried using the ReportName = "PurchaseDataReport" which is in the example call in the documentation, but I receive the same result: ReportNotAvailable.

Additionally, it's unclear to me what the set of possible values are for ReportName. It lists various values in the documentation (https://api.playfab.com/documentation/admin/method/GetDataReport#request-properties) but these have spaces in them, while the example ReportName of "PurchaseDataReport" is not even in the list.

apissdks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

It's all the reports you see on the reports tab (Analytics->Reports), and you can specify them using the names you see there, either with or without spaces (we strip spaces out in the call anyway). We'll update the docs to clarify this.

If you're getting a ReportNotAvailable error, that means the report you're asking for simply doesn't exist, though. What are the specifics of the values in your query, and what is the Title ID?

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Thanks - it was definitely not clear to me that it corresponded with the Analytics->Reports reports - that clarifies things greatly.

I was able to figure out the original problem in the question; however, while you're updating the docs, I noticed that in the docs it says we'll receive a JSON file while in the actual SDK call, I receive a csv file instead.

0 Likes 0 ·
brendan avatar image brendan Brent Batas (Lisk) commented ·

Yes, I'll make sure that's highlighted, but that wouldn't cause the ReportNotAvailable error. What did you find was causing that issue?

0 Likes 0 ·
Brent Batas (Lisk) avatar image Brent Batas (Lisk) brendan commented ·

I was simply requesting reports that didn't exist - I was requesting a monthly report for a non-first Day.

0 Likes 0 ·
Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

I am also a bit confused on how to parse the CSV file.

var task = BackendApi.GetDataReport("Monthly Totals Report", 1, DateTime.Now.Month - 1, DateTime.Now.Year, (error) =>
{
}).Result;

string url = task.DownloadUrl;
DeveloperApi.LogSuccess("Successfully got data report with url: " + url);

using (WebClient client = new WebClient())
{
    client.Encoding = Encoding.UTF8;

    string raw = client.DownloadString(url);

    DeveloperApi.Log("Got raw: " + raw);
}

I am receiving some garbled text when I print out "raw"; something like:

�@ ���,����xT��Xj�Biu�U|{�XP_&!3)�[��

What am I doing wrong?

0 Likes 0 ·
brendan avatar image brendan Brent Batas (Lisk) commented ·

The reports are stored compressed (gzip), so you'd need to download them and decompress them first - we automatically do that when you click to download them in the Game Manager.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.