How to get salesReport from app store connect api ?

When I tried to fetch sales and trends data from app store connect api, it worked very well. but it shows many special characters on browser. I have implemented it in PHP.

Can you say please it will generate a zip file to download or It will give a json formatted output. Why it shows special characters on browser?

My Code: $api_url = 'https://api.appstoreconnect.apple.com/v1/salesReports'; $api_url .= "?filter[reportType]=SALES&filter[reportSubType]=SUMMARY&filter[frequency]=YEARLY&filter[reportDate]=2020&filter[vendorNumber]=".$vendorNum."&filter[version]=1_0";

$headers = [ 'Content-Type: application/json; charset=utf-8', 'Accept: application/a-gzip, application/json', 'Authorization: Bearer '. $token, ]; $response = callAPI('GET', $api_url, false, $headers); //$response = json_decode($response, true); echo $response;

I got this answer after doing some R & D. Actually SalesReport or Financial Report return .gz formated file. You need to make this file downloadable. It will directly download on your browser. You just need to extract this zip file and open in Microsoft excel because the file has tab separated values.

How to get salesReport from app store connect api ?
 
 
Q