Open Nocccer opened 1 year ago
is it possible to know if a user has unlocked a certain achievement?
is it possible to know if a user has unlocked a certain achievement?
The PlayerAchievement operation will give you something like
{
"data": {
"PlayerProfile": {
"playerProfile": {
"epicAccountId": "<accountid>",
"displayName": "DISPLAYNAME",
"relationship": "SELF",
"avatar": {
"small": "https://shared-static-prod.epicgames.com/epic-profile-icon//n/icon.png?size=64",
"medium": "https://shared-static-prod.epicgames.com/epic-profile-icon//n/icon.png?size=128",
"large": "https://shared-static-prod.epicgames.com/epic-profile-icon//n/icon.png?size=512"
},
"productAchievements": {
"data": {
"epicAccountId": "<accountid>",
"sandboxId": "79d9bff700bb46a790b21e8c73b34899",
"totalXP": 20,
"totalUnlocked": 2,
"achievementSets": [{
"achievementSetId": "7f6ck5n",
"isBase": true,
"totalUnlocked": 2,
"totalXP": 20
}],
"playerAwards": [],
"playerAchievements": [{
"playerAchievement": {
"achievementName": "FIND_SANCTUARY",
"epicAccountId": "<accountid>",
"progress": 1,
"sandboxId": "79d9bff700bb46a790b21e8c73b34899",
"unlocked": true,
"unlockDate": "2022-05-22T07:39:26.283Z",
"XP": 10,
"achievementSetId": "7f6ck5n",
"isBase": true
}
}, {
"playerAchievement": {
"achievementName": "THE_THREE",
"epicAccountId": "<accountid>",
"progress": 1,
"sandboxId": "79d9bff700bb46a790b21e8c73b34899",
"unlocked": true,
"unlockDate": "2022-05-22T07:37:40.480Z",
"XP": 10,
"achievementSetId": "7f6ck5n",
"isBase": true
}
}]
}
}
}
}
},
"extensions": {}
}
Problem description
With the graphql we can fetch all achivements epic provides for a game and also all achivements a user finished.
Feature description
Implement the fetch of achivments via graphql.
Alternatives
No response
Additional information
All Achivements
It is a
GET
request tohttps://epicgames.com/graphql
withoperationName=Achievement
, `variables={"sandboxId": "We should avoid the queryHash and use a query instead:
Here the url for the game
Hell is others
:Finished Achivements
It is a
GET
request tohttps://epicgames.com/graphql
withoperationName=PlayerAchievement
,variables={"epicAccountId":"<your-epic-id>","sandboxId": "<namespace-from-game-info>", "locale":"<locale e.g.: en-US>"}
andextensions={"persistedQuery":{"version":1,"sha256Hash":"7d54399ad8b8b5538bc2d93ee66b07014432b5488945cda35fe0b1fc70eea83a"}}
We should avoid the queryHash and use a query instead:
Here the url from the game
Hell is others
(replaceyour-epic-id
with sid):