MixV2 / EpicResearch

Research about Epic Games' non-documented API
337 stars 82 forks source link

QueryProfile Format, error of authentification #74

Open System32-0101 opened 2 years ago

System32-0101 commented 2 years ago

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 commented 2 years ago

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

MixV2 commented 2 years ago

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 {}.