EpicResearch
EpicResearch copied to clipboard
QueryProfile Format, error of authentification
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
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
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 {}.