EpicResearch icon indicating copy to clipboard operation
EpicResearch copied to clipboard

QueryProfile Format, error of authentification

Open System32-0101 opened this issue 4 years ago • 3 comments

Hey, im trying to get the cosmetics and some info player using the QueryProfile, I use Node.JS and axios. My code is:

let head = {
'Content-Type': 'application/json',
'Authorization': `bearer ${res.data.access_token}` //<- Here i use the access_token previously defined
   }
   //I think data is not necessary but I use it too
   let data = {
     'grant_type': 'authorization_code',
     'code': code
   }
   let res3 = await axios.post(`https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/game/v2/profile/${res.data.account_id}/client/QueryProfile?profileId=athena&rvn=-1`, head, data).catch(e => console.log(e))
  console.log(res3.data)```
  The error is: 401

System32-0101 avatar Oct 08 '21 17:10 System32-0101

I repaired that in axios is: axios.post(url, data, headers) and i put headers before data. But it still giving me errors... please help

System32-0101 avatar Oct 08 '21 22:10 System32-0101

Are you sure you've generated a valid access token? Check res.data.access_token and make sure it is not undefined.

Also, you are using the wrong payload for the QueryProfile request. The payload (data) should just be {}.

MixV2 avatar Oct 12 '21 21:10 MixV2