2

I'm trying to get the number of installs of my IOS application but failed.

  1. I tried using api.appstoreconnect.apple.com/, with the query of

    res = await axios.get
          ('https://api.appstoreconnect.apple.com/v1/salesReports?filter\[frequency\]=MONTHLY&filter[reportDate]=2020-12&filter\[reportSubType\]=SUMMARY&filter\[reportType\]=SALES&filter\[vendorNumber\]=******'
          ,{
            headers: {
              Accept:'application/a-gzip, application/json',
              Authorization: 'Bearer ' + token //the token is a variable which holds the token
            }
          })
    
    console.log(res.data)
    

    and finally managed to get a response but the response is of type application/a-gzip so I don't know how to read it.

    Looks like -

    ՓQo�0ǟo��O{���(�*Z��A�g
    ��*��}0���&ɲ�l�ʢU����|���iՋ5d�Ū��w�Y@�=6���BP��Dm��.��*bŮE��(I���ZHA��l\�Xõ�,)  �^�{#�
                                                                                      ����i������E��{����霨m�W�iQ�۪}~V�t�=6�M�EKC
    
  2. Using itunesconnectanalytics, using this npm library I finally manage to get the info, but I don't know what to do with the 2-factor authentication once I upload my code to the could (AWS Fargate)

If anyone has a solution for any of the cases or other tips it would be amazing, Thanks

RobC
  • 22,977
  • 20
  • 73
  • 80
  • Check the answer of this question : https://stackoverflow.com/questions/62882796/how-to-decompress-gzip-json-response-via-axios – Ptit Xav Jan 06 '21 at 20:07
  • I tried it and the unzip gave me an error that I don't have the right data type because the apiconnect returns a-gzip and not gzip – Yarden Bitan Jan 07 '21 at 10:38

0 Answers0