psn-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +9 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README.md +89 -0
- data/docs/andshrew/APIv2.md +1937 -0
- data/docs/andshrew/LICENSE +21 -0
- data/lib/psn/client/auth.rb +117 -0
- data/lib/psn/client/request.rb +40 -0
- data/lib/psn/client/trophies.rb +82 -0
- data/lib/psn/client/version.rb +7 -0
- data/lib/psn/client.rb +15 -0
- data/lib/psn/logger.rb +15 -0
- data/sig/psn/client/auth.rbs +25 -0
- data/sig/psn/client/request.rbs +14 -0
- data/sig/psn/client/trophies.rbs +20 -0
- data/sig/psn/client.rbs +6 -0
- data/sig/psn/logger.rbs +4 -0
- metadata +76 -0
|
@@ -0,0 +1,1937 @@
|
|
|
1
|
+
# PlayStation Trophies API v2
|
|
2
|
+
|
|
3
|
+
With the release of the PlayStation 5 Sony has implemented a revised API for retrieving details of the trophies an account has earned.
|
|
4
|
+
|
|
5
|
+
This revision of the API is the only way to retrieve trophies for PS5 and PC titles. It is fully backwards compatible and capable of retrieving trophy data associated with tiles on legacy platforms (ie. PS3, PS4 and PS Vita).
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
* Accessing the API requires authentication with a PSN account.
|
|
9
|
+
* The information returned will be in the context of the authenticating PSN account.
|
|
10
|
+
* You can return the details of another PSN account providing the authenticating PSN account has permission to view the other users trophy list (as utilised by the Compare with User function of the app).
|
|
11
|
+
|
|
12
|
+
## Notable Changes from API v1
|
|
13
|
+
* PS5 titles can now (optionally) track your progress towards earning a trophy, and this progress is available in the new API.
|
|
14
|
+
* The v1 API enabled you to retrieve trophy earn rate statistics for any title. In the new API this is more restrictive in that this information is only returned when you request the trophy earned status for an account. If the account you are querying has not played the title then no trophy information is returned. Therefore as it currently stands statistics for PS5 titles can only be retrieved by querying an account which has played the title (and allowed their trophies to sync) at least once.
|
|
15
|
+
|
|
16
|
+
# API Documentation
|
|
17
|
+
|
|
18
|
+
The base URL for accessing this API is: https://m.np.playstation.com/api/trophy
|
|
19
|
+
|
|
20
|
+
There are three core API endpoints which you will need to make a request to in order to be able to retrieve the trophy details of a user.
|
|
21
|
+
|
|
22
|
+
1. A request to retrieve the list of titles (games) for which the user has earned trophies.
|
|
23
|
+
2. A request to retrieve the trophies which belong to the title.
|
|
24
|
+
3. A request to retrieve the trophies which have been earned for the title.
|
|
25
|
+
|
|
26
|
+
Successful requests to the API will return a JSON response. These URLs, the inputs they require and the response they return are detailed below.
|
|
27
|
+
|
|
28
|
+
?> The base URL is actually https://**{platform}**.**{environment}**.playstation.com/api/trophy. `{platform}` can currently be `m`. The `np` environment is the production PSN network and will be the only one accessible via normal PSN accounts.
|
|
29
|
+
|
|
30
|
+
## 1. Retrieve the Trophy Titles for a User
|
|
31
|
+
|
|
32
|
+
https://m.np.playstation.com/api/trophy/v1/users/{accountId}/trophyTitles
|
|
33
|
+
|
|
34
|
+
Requests to this URL will retrieve a list of the titles associated with an account, and a summary of trophies earned from them.
|
|
35
|
+
|
|
36
|
+
The numeric `accountId` can be that of any PSN account for which the authenticating account has permissions to view the trophy list. When querying the titles associated with the authenticating account the numeric `accountId` can be substituted with `me`.
|
|
37
|
+
|
|
38
|
+
Included in the information returned is the titles unique `npCommunicationId`. This is required to make use of the subsequent URLs for requesting more specific detail about a titles trophies.
|
|
39
|
+
|
|
40
|
+
The results are presented in order of the `lastUpdatedDateTime` for the title, so the first result will be the title for which a trophy was recently earned _(or synced for the first time in the case of a game with 0% progress)_.
|
|
41
|
+
|
|
42
|
+
### Input Parameters
|
|
43
|
+
|
|
44
|
+
| Parameter | Type | Example Value | Description | Required |
|
|
45
|
+
| --- | --- | --- | --- | --- |
|
|
46
|
+
| accountId | String | `me`<br>`12340..` | The account whos trophy list is being accessed<br>Use `me` for the authenticating account | Yes
|
|
47
|
+
| limit | Numeric<br>**Min** 1<br>**Max** 800<br>**Default** 100 | `20` | Limit the number of titles returned | No |
|
|
48
|
+
| offset | Numeric<br>**Min** 0<br>**Max** `totalItemCount` - 1<br>**Default** 0 | `20` | Returns title data from this result onwards | No |
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Output JSON Response
|
|
52
|
+
|
|
53
|
+
| Attribute | Type | Example Value | Description |
|
|
54
|
+
| --- | --- |--- | --- |
|
|
55
|
+
| trophyTitles | [JSON object](#trophy-titles-trophyTitles-json-objects) | | Individual object for each title returned
|
|
56
|
+
| totalItemCount | Numeric | `300` | The total number of trophy titles for this account
|
|
57
|
+
| nextOffset | Numeric | `20` | See [Support for Pagination](#support-for-pagination)
|
|
58
|
+
| previousOffset | Numeric | `299` | See [Support for Pagination](#support-for-pagination)
|
|
59
|
+
|
|
60
|
+
##### trophyTitles JSON objects <!-- {docsify-ignore} --> :id=trophy-titles-trophyTitles-json-objects
|
|
61
|
+
|
|
62
|
+
| Attribute | Type | Example Response | Description |
|
|
63
|
+
| --- | --- |--- | --- |
|
|
64
|
+
| npServiceName | String | `trophy`<br>`trophy2` | `trophy` for PS3, PS4, or PS Vita platforms<br>`trophy2` for the PS5 or PC platform
|
|
65
|
+
| npCommunicationId | String | `NPWR20188_00` | Unique ID of the title; later required for requesting detailed trophy information for this title
|
|
66
|
+
| trophySetVersion | String | `01.40` | The current version of the trophy set
|
|
67
|
+
| trophyTitleName | String | `ASTRO’s PLAYROOM` | Title name
|
|
68
|
+
| trophyTitleDetail | String | `RESIDENT EVIL 5 Trophy Set` | Title description<br>**PS3, PS4 and PS Vita titles only**
|
|
69
|
+
| trophyTitleIconUrl | String | `https://...` | URL of the icon for the title
|
|
70
|
+
| trophyTitlePlatform | String | `PS5`<br>`PS4` | The platform this title belongs to. Some games have trophy sets which are shared between multiple platforms (ie. PS4,PSVITA or PS5,PSPC). The platforms will be comma separated.
|
|
71
|
+
| hasTrophyGroups | Boolean | `true` | True if the title has multiple groups of trophies (eg. DLC trophies which are separate from the main trophy list)
|
|
72
|
+
| definedTrophies | [JSON object](#trophy-titles-definedTrophies-json-objects) | | Number of trophies for the title by type
|
|
73
|
+
| progress | Numeric | 100 | Percentage of trophies earned for the title
|
|
74
|
+
| earnedTrophies | [JSON object](#trophy-titles-earnedTrophies-json-objects) | | Number of trophies for the title which have been earned by type
|
|
75
|
+
| hiddenFlag | Boolean | `false` | Title has been hidden on the accounts trophy list<br>**Authenticating account only<br>Title will not be returned if it has been hidden on another account**
|
|
76
|
+
| lastUpdatedDateTime | Date (UTC) | `2020-11-21T10:45:19Z` | Date most recent trophy earned for the title
|
|
77
|
+
|
|
78
|
+
##### definedTrophies JSON objects <!-- {docsify-ignore} --> :id=trophy-titles-definedTrophies-json-objects
|
|
79
|
+
|
|
80
|
+
| Attribute | Type | Example Value | Description |
|
|
81
|
+
| --- | --- |--- | --- |
|
|
82
|
+
| bronze | Numeric | `27` | Total bronze trophies from all trophy groups
|
|
83
|
+
| silver | Numeric | `13` | Total silver trophies from all trophy groups
|
|
84
|
+
| gold | Numeric | `5` | Total gold trophies from all trophy groups
|
|
85
|
+
| platinum | Numeric | `1` | Total platinum trophies from all trophy groups
|
|
86
|
+
|
|
87
|
+
##### earnedTrophies JSON objects <!-- {docsify-ignore} --> :id=trophy-titles-earnedTrophies-json-objects
|
|
88
|
+
|
|
89
|
+
| Attribute | Type | Example Value | Description |
|
|
90
|
+
| --- | --- |--- | --- |
|
|
91
|
+
| bronze | Numeric | `27` | Total bronze trophies earned from all trophy groups
|
|
92
|
+
| silver | Numeric | `13` | Total silver trophies earned from all trophy groups
|
|
93
|
+
| gold | Numeric | `5` | Total gold trophies earned from all trophy groups
|
|
94
|
+
| platinum | Numeric | `1` | Total platinum trophies earned from all trophy groups
|
|
95
|
+
|
|
96
|
+
### Example URLs and Responses
|
|
97
|
+
|
|
98
|
+
**Example 1 - Retrieve all trophy titles for the authenticating account**
|
|
99
|
+
|
|
100
|
+
https://m.np.playstation.com/api/trophy/v1/users/me/trophyTitles
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"trophyTitles": [
|
|
105
|
+
{
|
|
106
|
+
"npServiceName": "trophy2",
|
|
107
|
+
"npCommunicationId": "NPWR21575_00",
|
|
108
|
+
"trophySetVersion": "01.07",
|
|
109
|
+
"trophyTitleName": "Destiny 2",
|
|
110
|
+
"trophyTitleIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR21575_00/45976ee9-344e-423d-940d-5e42fc82e5b8.png",
|
|
111
|
+
"trophyTitlePlatform": "PS5",
|
|
112
|
+
"hasTrophyGroups": true,
|
|
113
|
+
"definedTrophies": {
|
|
114
|
+
"bronze": 8,
|
|
115
|
+
"silver": 4,
|
|
116
|
+
"gold": 11,
|
|
117
|
+
"platinum": 1
|
|
118
|
+
},
|
|
119
|
+
"progress": 53,
|
|
120
|
+
"earnedTrophies": {
|
|
121
|
+
"bronze": 2,
|
|
122
|
+
"silver": 3,
|
|
123
|
+
"gold": 6,
|
|
124
|
+
"platinum": 0
|
|
125
|
+
},
|
|
126
|
+
"hiddenFlag": false,
|
|
127
|
+
"lastUpdatedDateTime": "2021-03-17T21:58:18Z"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"npServiceName": "trophy2",
|
|
131
|
+
"npCommunicationId": "NPWR22596_00",
|
|
132
|
+
"trophySetVersion": "01.00",
|
|
133
|
+
"trophyTitleName": "Crash Bandicoot 4: It's About Time",
|
|
134
|
+
"trophyTitleIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR22596_00/aeb3ccd0-9346-4845-8a9e-871cf7a7d9d8.png",
|
|
135
|
+
"trophyTitlePlatform": "PS5",
|
|
136
|
+
"hasTrophyGroups": false,
|
|
137
|
+
"definedTrophies": {
|
|
138
|
+
"bronze": 40,
|
|
139
|
+
"silver": 9,
|
|
140
|
+
"gold": 2,
|
|
141
|
+
"platinum": 1
|
|
142
|
+
},
|
|
143
|
+
"progress": 27,
|
|
144
|
+
"earnedTrophies": {
|
|
145
|
+
"bronze": 19,
|
|
146
|
+
"silver": 0,
|
|
147
|
+
"gold": 0,
|
|
148
|
+
"platinum": 0
|
|
149
|
+
},
|
|
150
|
+
"hiddenFlag": false,
|
|
151
|
+
"lastUpdatedDateTime": "2021-03-17T18:05:41Z"
|
|
152
|
+
},
|
|
153
|
+
<#-- truncated --#>
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"totalItemCount": 300
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
160
|
+
```powershell
|
|
161
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/trophyTitles" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
162
|
+
```
|
|
163
|
+
**Example 2 - Retrieve up to 10 titles starting at title 50 for the authenticating account**
|
|
164
|
+
|
|
165
|
+
https://m.np.playstation.com/api/trophy/v1/users/me/trophyTitles?limit=10&offset=50
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"trophyTitles": [
|
|
170
|
+
{
|
|
171
|
+
"npServiceName": "trophy",
|
|
172
|
+
"npCommunicationId": "NPWR18910_00",
|
|
173
|
+
"trophySetVersion": "01.04",
|
|
174
|
+
"trophyTitleName": "Two Point Hospital",
|
|
175
|
+
"trophyTitleDetail": "Two Point Hospital",
|
|
176
|
+
"trophyTitleIconUrl": "https://image.api.playstation.com/trophy/np/NPWR18910_00_00D60FA9AEAADEBBC7C2EB26DB1E2122A86B887436/CBE975BD1527E46830FE821D4CA194D32955C7BE.PNG",
|
|
177
|
+
"trophyTitlePlatform": "PS4",
|
|
178
|
+
"hasTrophyGroups": true,
|
|
179
|
+
"definedTrophies": {
|
|
180
|
+
"bronze": 23,
|
|
181
|
+
"silver": 15,
|
|
182
|
+
"gold": 7,
|
|
183
|
+
"platinum": 1
|
|
184
|
+
},
|
|
185
|
+
"progress": 1,
|
|
186
|
+
"earnedTrophies": {
|
|
187
|
+
"bronze": 1,
|
|
188
|
+
"silver": 0,
|
|
189
|
+
"gold": 0,
|
|
190
|
+
"platinum": 0
|
|
191
|
+
},
|
|
192
|
+
"hiddenFlag": false,
|
|
193
|
+
"lastUpdatedDateTime": "2020-08-18T11:34:58Z"
|
|
194
|
+
},
|
|
195
|
+
<#-- truncated --#>
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"nextOffset": 60,
|
|
199
|
+
"previousOffset": 49,
|
|
200
|
+
"totalItemCount": 300
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
204
|
+
```powershell
|
|
205
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/trophyTitles?limit=10&offset=50" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## 2. Retrieve the Trophies for a Title
|
|
209
|
+
|
|
210
|
+
https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/{npCommunicationId}/trophyGroups/{trophyGroupId}/trophies
|
|
211
|
+
|
|
212
|
+
A request to this URL will retrieve the individual trophy detail of a single - or all - trophy groups for a title. A title can have multiple groups of trophies (a `default` group which all titles have, and additional groups named `001` incrementing for each additional group). To retrieve trophies from all groups within a title (ie. the full trophy set) then `trophyGroupId` should be set to `all`.
|
|
213
|
+
|
|
214
|
+
!> When the title platform is PS3, PS4 or PS Vita you __**must**__ specify the `npServiceName` parameter as `trophy`
|
|
215
|
+
|
|
216
|
+
### Input Parameters
|
|
217
|
+
|
|
218
|
+
| Parameter | Type | Example Value | Description | Required |
|
|
219
|
+
| --- | --- | --- | --- | --- |
|
|
220
|
+
| npCommunicationId | String | `NPWR20188_00` | Unique ID of the title | Yes
|
|
221
|
+
| trophyGroupId | String | `all`<br>`default`<br>`001` | `all` to return all trophies for the title, otherwise restrict results to a specific trophy group | Yes
|
|
222
|
+
| npServiceName | String | `trophy`<br>`trophy2` | `trophy` for PS3, PS4, or PS Vita platforms<br>`trophy2` for the PS5 or PC platform | No, unless title platform is PS3, PS4 or PS Vita then **must** be `trophy`
|
|
223
|
+
| limit | Numeric<br>**Min** 1<br>**Max** > 400<br>**Default** All trophies | `20` | Limit the number of trophies returned<br>*If no limit is specified all trophies will be returned* | No |
|
|
224
|
+
| offset | Numeric<br>**Min** 0<br>**Max** `totalItemCount` - 1<br>**Default** 0 | `20` | Returns trophy data from this result onwards | No |
|
|
225
|
+
|
|
226
|
+
### Output JSON Response
|
|
227
|
+
|
|
228
|
+
| Attribute | Type | Example Value | Description |
|
|
229
|
+
| --- | --- |--- | --- |
|
|
230
|
+
| trophySetVersion | String | `01.40` | The current version of the trophy set
|
|
231
|
+
| hasTrophyGroups | Boolean | `true` | True if this title has additional trophy groups
|
|
232
|
+
| trophies | [JSON object](#title-trophies-trophies-json-objects) | | Individual object for each trophy
|
|
233
|
+
| totalItemCount | Numeric | `46` | Total trophies in the group (or total trophies for the title if `all` specified)
|
|
234
|
+
| nextOffset | Numeric | `30` | See [Support for Pagination](#support-for-pagination)
|
|
235
|
+
| previousOffset | Numeric | `19` | See [Support for Pagination](#support-for-pagination)
|
|
236
|
+
|
|
237
|
+
##### trophies JSON objects <!-- {docsify-ignore} --> :id=title-trophies-trophies-json-objects
|
|
238
|
+
|
|
239
|
+
| Attribute | Type | Example Value | Description |
|
|
240
|
+
| --- | --- |--- | --- |
|
|
241
|
+
| trophyId | Numeric<br>**Min** 0 | `0`| Unique ID for this trophy (unique within the title and not just the group)
|
|
242
|
+
| trophyHidden | Boolean | `false` | True if this is a secret trophy (ie. further details are not displayed by default unless earned)
|
|
243
|
+
| trophyType | String | `bronze`<br>`silver`<br>`gold`<br>`platinum` | Type of the trophy
|
|
244
|
+
| trophyName | String | `You've Only Done Everything` | Name of the trophy
|
|
245
|
+
| trophyDetail | String | `Found all trophies in ASTRO's PLAYROOM. See you in our next adventure!` | Description of the trophy
|
|
246
|
+
| trophyIconUrl | String | `https://...` | URL for the graphic associated with the trophy
|
|
247
|
+
| trophyGroupId | String | `default`<br>`001` | ID of the trophy group this trophy belongs to
|
|
248
|
+
| trophyProgressTargetValue | String | `10` | If the trophy tracks progress towards unlock this is the total required<br>**PS5 titles only<br>Only returned if trophy tracks progress**
|
|
249
|
+
| trophyRewardName | String | `Profile Avatar` | Name of the reward earning the trophy grants<br>**PS5 titles only<br>Only returned if the trophy has a reward associated with it**
|
|
250
|
+
| trophyRewardImageUrl | String | `trophyRewardImageUrl` | URL for the graphic associated with the reward<br>**PS5 titles only<br>Only returned if the trophy has a reward associated with it**
|
|
251
|
+
|
|
252
|
+
### Example URLs and Responses
|
|
253
|
+
|
|
254
|
+
**Example 1 - Retrieve all trophies for PS5 title ASTRO’s PLAYROOM**
|
|
255
|
+
|
|
256
|
+
https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR20188_00/trophyGroups/all/trophies
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"trophySetVersion": "01.40",
|
|
261
|
+
"hasTrophyGroups": true,
|
|
262
|
+
"trophies": [
|
|
263
|
+
{
|
|
264
|
+
"trophyId": 0,
|
|
265
|
+
"trophyHidden": false,
|
|
266
|
+
"trophyType": "platinum",
|
|
267
|
+
"trophyName": "You've Only Done Everything",
|
|
268
|
+
"trophyDetail": "Found all trophies in ASTRO's PLAYROOM. See you in our next adventure!",
|
|
269
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20188_00/4e1f7ad7-5720-4b03-96a4-ecf8abb17ed8.png",
|
|
270
|
+
"trophyGroupId": "default"
|
|
271
|
+
},
|
|
272
|
+
<#-- truncated --#>
|
|
273
|
+
{
|
|
274
|
+
"trophyId": 45,
|
|
275
|
+
"trophyHidden": true,
|
|
276
|
+
"trophyType": "bronze",
|
|
277
|
+
"trophyName": "Gravity Daze!",
|
|
278
|
+
"trophyDetail": "Made the CPU Chip punch the glass sphere, sending at least 10 Bots flying.",
|
|
279
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20188_00/ed83d6d9-2708-4465-8f0f-6e3db7ae9665.png",
|
|
280
|
+
"trophyGroupId": "001"
|
|
281
|
+
}
|
|
282
|
+
],
|
|
283
|
+
"totalItemCount": 46
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
287
|
+
```powershell
|
|
288
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR20188_00/trophyGroups/all/trophies" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Example 2 - Retrieve all trophies for PS4 title RESIDENT EVIL 5**
|
|
292
|
+
|
|
293
|
+
https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR10600_00/trophyGroups/all/trophies?npServiceName=trophy
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"trophySetVersion": "01.01",
|
|
298
|
+
"hasTrophyGroups": true,
|
|
299
|
+
"trophies": [
|
|
300
|
+
{
|
|
301
|
+
"trophyId": 0,
|
|
302
|
+
"trophyHidden": false,
|
|
303
|
+
"trophyType": "platinum",
|
|
304
|
+
"trophyName": "RESIDENT EVIL 5 Platinum Trophy",
|
|
305
|
+
"trophyDetail": "Congratulations! You've overcome all your fears in RESIDENT EVIL 5!",
|
|
306
|
+
"trophyIconUrl": "https://image.api.playstation.com/trophy/np/NPWR10600_00_00A0CF3468337FB7E2039182A26608B0545DE39292/2B4F7ECA102EDB19D18DA17C594DBC50348ECEAF.PNG",
|
|
307
|
+
"trophyGroupId": "default"
|
|
308
|
+
},
|
|
309
|
+
<#-- truncated --#>
|
|
310
|
+
{
|
|
311
|
+
"trophyId": 70,
|
|
312
|
+
"trophyHidden": false,
|
|
313
|
+
"trophyType": "bronze",
|
|
314
|
+
"trophyName": "Shoot the Messenger",
|
|
315
|
+
"trophyDetail": "Defeat 3 Agitator Majini in one playthrough of \"Desperate Escape.\"",
|
|
316
|
+
"trophyIconUrl": "https://image.api.playstation.com/trophy/np/NPWR10600_00_00A0CF3468337FB7E2039182A26608B0545DE39292/DB4F19B53DF8C9303728EA28F5A992EF8B3392FD.PNG",
|
|
317
|
+
"trophyGroupId": "003"
|
|
318
|
+
}
|
|
319
|
+
],
|
|
320
|
+
"totalItemCount": 71
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
324
|
+
```powershell
|
|
325
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR10600_00/trophyGroups/all/trophies?npServiceName=trophy" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Bonus Example - Extract from a PS5 title with a trophy which tracks unlock progress (NPWR19950_00 - Sackboy: A Big Adventure)**
|
|
329
|
+
|
|
330
|
+
```json
|
|
331
|
+
{
|
|
332
|
+
"trophyId": 35,
|
|
333
|
+
"trophyHidden": false,
|
|
334
|
+
"trophyType": "silver",
|
|
335
|
+
"trophyName": "Naturalist",
|
|
336
|
+
"trophyDetail": "Find all of Gerald's secret spots.",
|
|
337
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR19950_00/ee1bc4b9-98d7-46c6-a3ea-1e6b2b258a2a.png",
|
|
338
|
+
"trophyGroupId": "default",
|
|
339
|
+
"trophyProgressTargetValue": "9"
|
|
340
|
+
},
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**Bonus Example 2 - Extract from a PS5 title with a trophy that grants a reward on unlock (NPWR22792_00 - Destruction AllStars)**
|
|
344
|
+
|
|
345
|
+
```json
|
|
346
|
+
{
|
|
347
|
+
"trophyId": 28,
|
|
348
|
+
"trophyHidden": false,
|
|
349
|
+
"trophyType": "gold",
|
|
350
|
+
"trophyName": "Checking out the competition",
|
|
351
|
+
"trophyDetail": "Win at least 1 online match with each AllStar",
|
|
352
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR22792_00/908c536b-c8d4-4591-bd62-b330ccdb20ef.png",
|
|
353
|
+
"trophyGroupId": "default",
|
|
354
|
+
"trophyProgressTargetValue": "16",
|
|
355
|
+
"trophyRewardName": "Profile Avatar",
|
|
356
|
+
"trophyRewardImageUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR22792_00/486de18c-2da3-46e7-8229-4006adb8c28b.png"
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## 3. Retrieve Trophies earned for a Title
|
|
361
|
+
|
|
362
|
+
https://m.np.playstation.com/api/trophy/v1/users/{accountId}/npCommunicationIds/{npCommunicationId}/trophyGroups/{trophyGroupId}/trophies
|
|
363
|
+
|
|
364
|
+
A request to this URL will retrieve the earned status of trophies for a user from either a single - or all - trophy groups in a title. A title can have multiple groups of trophies (a `default` group which all titles have, and additional groups named `001` incrementing for each additional group). To retrieve trophies from all groups within a title (ie. the full trophy set) then `trophyGroupId` should be set to `all`.
|
|
365
|
+
|
|
366
|
+
The numeric `accountId` can be that of any PSN account for which the authenticating account has permissions to view the trophy list. When querying the titles associated with the authenticating account the numeric `accountId` can be substituted with `me`.
|
|
367
|
+
|
|
368
|
+
This endpoint returns the earned status of the trophy only and no additional descriptive metadata (ie. trophy name, trophy description). See [Retrieve the Trophies for a Title](#_2-retrieve-the-trophies-for-a-title) to obtain this information.
|
|
369
|
+
|
|
370
|
+
!> When the title platform is PS3, PS4 or PS Vita you __**must**__ specify the `npServiceName` parameter as `trophy`
|
|
371
|
+
|
|
372
|
+
!> If you attempt to query a title which the user does not have associated with their account (ie. the title has not been launched and allowed to sync at least once) then a _Resource not found_ error will be returned.
|
|
373
|
+
|
|
374
|
+
### Input Parameters
|
|
375
|
+
|
|
376
|
+
| Parameter | Type | Example Value | Description | Required |
|
|
377
|
+
| --- | --- | --- | --- | --- |
|
|
378
|
+
| accountId | String | `me`<br>`12340..` | The account whos trophy list is being accessed<br>Use `me` for the authenticating account | Yes
|
|
379
|
+
| npCommunicationId | String | `NPWR20188_00` | Unique ID of the title | Yes
|
|
380
|
+
| trophyGroupId | String | `all`<br>`default`<br>`001` | `all` to return all trophies for the title, otherwise restrict results to a specific trophy group | Yes
|
|
381
|
+
| npServiceName | String | `trophy`<br>`trophy2` | `trophy` for PS3, PS4, or PS Vita platforms<br>`trophy2` for the PS5 or PC platform | No, unless title platform is PS3, PS4 or PS Vita then **must** be `trophy`
|
|
382
|
+
| limit | Numeric<br>**Min** 1<br>**Max** > 400<br>**Default** All trophies | `20` | Limit the number of trophies returned<br>*If no limit is specified all trophies will be returned* | No |
|
|
383
|
+
| offset | Numeric<br>**Min** 0<br>**Max** `totalItemCount` - 1<br>**Default** 0 | `20` | Returns trophy data from this result onwards | No |
|
|
384
|
+
|
|
385
|
+
### Output JSON Response
|
|
386
|
+
|
|
387
|
+
| Attribute | Type | Example Value | Description |
|
|
388
|
+
| --- | --- |--- | --- |
|
|
389
|
+
| trophySetVersion | String | `01.40` | The current version of the trophy set
|
|
390
|
+
| hasTrophyGroups | Boolean | `true` | True if this title has additional trophy groups
|
|
391
|
+
| lastUpdatedDateTime | Date (UTC) | `2020-11-21T10:45:19Z` | Date most recent trophy earned for the title
|
|
392
|
+
| trophies | [JSON object](#earned-trophies-trophies-json-objects) | | Individual object for each trophy
|
|
393
|
+
| rarestTrophies | [JSON object](#earned-trophies-raresttrophies-json-objects) | | Individual object for each trophy<br>Returns the trophy where `earned` is `true` with the lowest `trophyEarnedRate`.<br>**Returns nothing if no trophies are earned**
|
|
394
|
+
| totalItemCount | Numeric | `46` | Total trophies in the group (or total trophies for the title if `all` specified)
|
|
395
|
+
| nextOffset | Numeric | `30` | See [Support for Pagination](#support-for-pagination)
|
|
396
|
+
| previousOffset | Numeric | `19` | See [Support for Pagination](#support-for-pagination)
|
|
397
|
+
|
|
398
|
+
##### trophies JSON objects <!-- {docsify-ignore} --> :id=earned-trophies-trophies-json-objects
|
|
399
|
+
|
|
400
|
+
| Attribute | Type | Example Value | Description |
|
|
401
|
+
| --- | --- |--- | --- |
|
|
402
|
+
| trophyId | Numeric<br>**Min** 0 | `0`| Unique ID for this trophy (unique within the title and not just the group)
|
|
403
|
+
| trophyHidden | Boolean | `false` | True if this is a secret trophy (ie. further details are not displayed by default unless earned)
|
|
404
|
+
| earned | Boolean | `true` | True if this trophy has been earned
|
|
405
|
+
| progress | String | `73` | If the trophy tracks progress towards unlock this is number of steps currently completed (ie. 73/300)<br>**PS5 titles only<br>Only returned if the trophy tracks progress and `earned` is `false`**
|
|
406
|
+
| progressRate | Numeric | `24` | If the trophy tracks progress towards unlock this is the current percentage complete<br>**PS5 titles only<br>Only returned if the trophy tracks progress and `earned` is `false`**
|
|
407
|
+
| progressedDateTime | Date (UTC) | `2020-12-03T22:09:33Z` | If the trophy tracks progress towards unlock, and some progress has been made, then this returns the date progress was last updated.<br>**PS5 titles only<br>Only returned if the trophy tracks progress, some progress has been made, and `earned` is `false`**
|
|
408
|
+
| earnedDateTime | Date (UTC) | `2020-11-20T23:53:13Z` | Date trophy was earned<br>**Only returned if `earned` is `true`**
|
|
409
|
+
| trophyType | String | `bronze`<br>`silver`<br>`gold`<br>`platinum` | Type of the trophy
|
|
410
|
+
| trophyRare | Numeric | `0`<br>`1` | Rarity of the trophy<br>`0` Ultra Rare<br>`1` Very Rare<br>`2` Rare<br>`3` Common
|
|
411
|
+
| trophyEarnedRate | String | `8.0` | Percentage of all users who have earned the trophy
|
|
412
|
+
|
|
413
|
+
##### rarestTrophies JSON objects <!-- {docsify-ignore} --> :id=earned-trophies-raresttrophies-json-objects
|
|
414
|
+
|
|
415
|
+
| Attribute | Type | Example Value | Description |
|
|
416
|
+
| --- | --- |--- | --- |
|
|
417
|
+
| trophyId | Numeric<br>**Min** 0 | `0`| Unique ID for this trophy (unique within the title and not just the group)
|
|
418
|
+
| trophyHidden | Boolean | `false` | True if this is a secret trophy (ie. further details are not displayed by default unless earned)
|
|
419
|
+
| earned | Boolean | `true` | True if this trophy has been earned
|
|
420
|
+
| earnedDateTime | Date (UTC) | `2020-11-20T23:53:13Z` | Date trophy was earned
|
|
421
|
+
| trophyType | String | `bronze`<br>`silver`<br>`gold`<br>`platinum` | Type of the trophy
|
|
422
|
+
| trophyRare | Numeric | `0`<br>`1` | Rarity of the trophy<br>`0` Ultra Rare<br>`1` Very Rare<br>`2` Rare<br>`3` Common
|
|
423
|
+
| trophyEarnedRate | String | `8.0` | Percentage of all users who have earned the trophy
|
|
424
|
+
|
|
425
|
+
### Example URLs and Responses
|
|
426
|
+
|
|
427
|
+
**Example 1 - Retrieve all trophies earned by the authenticating account for PS5 title ASTRO’s PLAYROOM**
|
|
428
|
+
|
|
429
|
+
https://m.np.playstation.com/api/trophy/v1/users/me/npCommunicationIds/NPWR20188_00/trophyGroups/all/trophies
|
|
430
|
+
|
|
431
|
+
```json
|
|
432
|
+
{
|
|
433
|
+
"trophySetVersion": "01.40",
|
|
434
|
+
"hasTrophyGroups": true,
|
|
435
|
+
"lastUpdatedDateTime": "2020-11-21T10:45:19Z",
|
|
436
|
+
"trophies": [
|
|
437
|
+
{
|
|
438
|
+
"trophyId": 0,
|
|
439
|
+
"trophyHidden": false,
|
|
440
|
+
"earned": true,
|
|
441
|
+
"earnedDateTime": "2020-11-20T23:53:13Z",
|
|
442
|
+
"trophyType": "platinum",
|
|
443
|
+
"trophyRare": 1,
|
|
444
|
+
"trophyEarnedRate": "8.0"
|
|
445
|
+
},
|
|
446
|
+
<#-- truncated --#>
|
|
447
|
+
{
|
|
448
|
+
"trophyId": 45,
|
|
449
|
+
"trophyHidden": true,
|
|
450
|
+
"earned": true,
|
|
451
|
+
"earnedDateTime": "2020-11-21T10:45:19Z",
|
|
452
|
+
"trophyType": "bronze",
|
|
453
|
+
"trophyRare": 1,
|
|
454
|
+
"trophyEarnedRate": "12.8"
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"rarestTrophies": [
|
|
458
|
+
{
|
|
459
|
+
"trophyId": 44,
|
|
460
|
+
"trophyHidden": true,
|
|
461
|
+
"earned": true,
|
|
462
|
+
"earnedDateTime": "2020-11-20T15:21:21Z",
|
|
463
|
+
"trophyType": "gold",
|
|
464
|
+
"trophyRare": 1,
|
|
465
|
+
"trophyEarnedRate": "6.1"
|
|
466
|
+
}
|
|
467
|
+
],
|
|
468
|
+
"totalItemCount": 46
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
472
|
+
```powershell
|
|
473
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/npCommunicationIds/NPWR20188_00/trophyGroups/all/trophies" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
**Example 2 - Retrieve all trophies earned by another PSN account with accountId _0000000000000000000_ limited to the default trophy group of PS4 title RESIDENT EVIL 5**
|
|
477
|
+
|
|
478
|
+
https://m.np.playstation.com/api/trophy/v1/users/0000000000000000000/npCommunicationIds/NPWR10600_00/trophyGroups/default/trophies?npServiceName=trophy
|
|
479
|
+
|
|
480
|
+
```json
|
|
481
|
+
{
|
|
482
|
+
"trophySetVersion": "01.01",
|
|
483
|
+
"hasTrophyGroups": true,
|
|
484
|
+
"lastUpdatedDateTime": "2017-02-09T22:14:52Z",
|
|
485
|
+
"trophies": [
|
|
486
|
+
{
|
|
487
|
+
"trophyId": 0,
|
|
488
|
+
"trophyHidden": false,
|
|
489
|
+
"earned": true,
|
|
490
|
+
"earnedDateTime": "2017-02-09T22:12:14Z",
|
|
491
|
+
"trophyType": "platinum",
|
|
492
|
+
"trophyRare": 0,
|
|
493
|
+
"trophyEarnedRate": "3.7"
|
|
494
|
+
},
|
|
495
|
+
<#-- truncated --#>
|
|
496
|
+
],
|
|
497
|
+
"rarestTrophies": [
|
|
498
|
+
{
|
|
499
|
+
"trophyId": 0,
|
|
500
|
+
"trophyHidden": false,
|
|
501
|
+
"earned": true,
|
|
502
|
+
"earnedDateTime": "2017-02-09T22:12:14Z",
|
|
503
|
+
"trophyType": "platinum",
|
|
504
|
+
"trophyRare": 0,
|
|
505
|
+
"trophyEarnedRate": "3.7"
|
|
506
|
+
}
|
|
507
|
+
],
|
|
508
|
+
"totalItemCount": 51
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
512
|
+
```powershell
|
|
513
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/0000000000000000000/npCommunicationIds/NPWR10600_00/trophyGroups/default/trophies?npServiceName=trophy" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**Bonus Example - Extract from a PS5 title with a trophy which tracks unlock progress (NPWR19950_00 - Sackboy: A Big Adventure**)
|
|
517
|
+
|
|
518
|
+
```json
|
|
519
|
+
{
|
|
520
|
+
"trophyId": 35,
|
|
521
|
+
"trophyHidden": false,
|
|
522
|
+
"earned": false,
|
|
523
|
+
"progress": "2",
|
|
524
|
+
"progressRate": 22,
|
|
525
|
+
"progressedDateTime": "2020-11-27T16:17:23Z",
|
|
526
|
+
"trophyType": "silver",
|
|
527
|
+
"trophyRare": 1,
|
|
528
|
+
"trophyEarnedRate": "5.4"
|
|
529
|
+
},
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
## Support for Language
|
|
533
|
+
|
|
534
|
+
By default the API will provide responses using the preferred language of the authenticating account.
|
|
535
|
+
|
|
536
|
+
This can be overridden by including an [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) header in the request.
|
|
537
|
+
|
|
538
|
+
An example using Powershell to retrieve all trophies for PS5 title ASTRO’s PLAYROOM in German - see [Querying the API](#powershell-7)
|
|
539
|
+
|
|
540
|
+
```powershell
|
|
541
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR20188_00/trophyGroups/all/trophies" -Authentication Bearer -Token $token -Headers @{"Accept-Language"="de-de"} | ConvertTo-Json -Depth 3
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
```json
|
|
545
|
+
{
|
|
546
|
+
"trophySetVersion": "01.40",
|
|
547
|
+
"hasTrophyGroups": true,
|
|
548
|
+
"trophies": [
|
|
549
|
+
{
|
|
550
|
+
"trophyId": 0,
|
|
551
|
+
"trophyHidden": false,
|
|
552
|
+
"trophyType": "platinum",
|
|
553
|
+
"trophyName": "Du hast wirklich alles erledigt",
|
|
554
|
+
"trophyDetail": "Alle Trophäen in ASTRO's PLAYROOM gefunden. Wir sehen uns im nächsten Abenteuer!",
|
|
555
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20188_00/4e1f7ad7-5720-4b03-96a4-ecf8abb17ed8.png",
|
|
556
|
+
"trophyGroupId": "default"
|
|
557
|
+
},
|
|
558
|
+
<#-- truncated --#>
|
|
559
|
+
}
|
|
560
|
+
```
|
|
561
|
+
## Support for Pagination
|
|
562
|
+
|
|
563
|
+
By default the `limit` of results returned is either very high (ie. 1000+), or such that it simply returns all records. In either case this means that in the majority of cases one query will be able to return all available records. There may be times when it is preferable to control how much data is being returned at once, and to enable this many of the endpoints in this API have support for pagination.
|
|
564
|
+
|
|
565
|
+
If you specify the `limit` and `offset` parameters in your requests then you can control the number of results returned, and in turn the API will also begin including `nextOffset` and `previousOffset` in the response as appropriate. With this information you can then build your next request to allow you to "page" forward or backwards through the available data.
|
|
566
|
+
|
|
567
|
+
As an example when accessing the trophy titles for a user which has 300 titles where the request parameter `limit` is 10 and `offset` is 50 the response would include:
|
|
568
|
+
|
|
569
|
+
| Response | Value
|
|
570
|
+
| --- | --- |
|
|
571
|
+
| nextOffset | 60
|
|
572
|
+
| previousOffset | 49
|
|
573
|
+
|
|
574
|
+
`nextOffset` tells us that to display the next 10 titles then the next request should use `limit` 10 and `offset` 60.
|
|
575
|
+
|
|
576
|
+
`previousOffset` in this instance tells us the offset for the record immediately prior to the offset we specified in the request. Arguably this should have returned 40 as that would then provide the information needed to "page" 10 items backwards (ie. the next request would be `limit` 10 and `offset` 40)
|
|
577
|
+
|
|
578
|
+
!> `nextOffset` will not be returned once you have reached the last page of data.
|
|
579
|
+
|
|
580
|
+
!> If your request includes an `offset` which exceeds the number of items which could be retuned then `previousOffset` is returned stating the offset of the last item.
|
|
581
|
+
|
|
582
|
+
## Additional Endpoints
|
|
583
|
+
|
|
584
|
+
### Trophy Profile Summary
|
|
585
|
+
|
|
586
|
+
https://m.np.playstation.com/api/trophy/v1/users/{accountId}/trophySummary
|
|
587
|
+
|
|
588
|
+
A request to this URL will retrieve an overall summary of the number of trophies earned for a user broken down by type, as well as their current overall trophy level, progress towards the next level and which tier their current level falls in to. The tiers are based on the [level changes introduced in 2020](https://andshrew.github.io/PlayStation-Trophies/images/psn-trophy-tiers.png).
|
|
589
|
+
|
|
590
|
+
The numeric `accountId` can be that of any PSN account for which the authenticating account has permissions to view the trophy list. When querying the titles associated with the authenticating account the numeric `accountId` can be substituted with `me`.
|
|
591
|
+
|
|
592
|
+
| Tier | Grade | `trophyLevel` Ranges |
|
|
593
|
+
| --- | --- | --- |
|
|
594
|
+
| 1 | Bronze | 1 - 99 |
|
|
595
|
+
| 2 | Bronze | 100 - 199 |
|
|
596
|
+
| 3 | Bronze | 200 - 299 |
|
|
597
|
+
| 4 | Silver | 300 - 399 |
|
|
598
|
+
| 5 | Silver | 400 - 499 |
|
|
599
|
+
| 6 | Silver | 500 - 599 |
|
|
600
|
+
| 7 | Gold | 600 - 699 |
|
|
601
|
+
| 8 | Gold | 700 - 799 |
|
|
602
|
+
| 9 | Gold | 800 - 998 |
|
|
603
|
+
| 10 | Platinum | 999 |
|
|
604
|
+
|
|
605
|
+
The API also returns the total point value of the trophies which the user has earned. The actual point value of each trophy grade has never been officially revealed, but they have been reverse engineered by [psnprofiles.com user NathanielJohn](https://forum.psnprofiles.com/topic/96498-new-platinum-trophy-value-and-trophy-level-formula/), and are copied here for reference.
|
|
606
|
+
|
|
607
|
+
| Grade | Point Value |
|
|
608
|
+
| --- | --- |
|
|
609
|
+
| Bronze | 15 |
|
|
610
|
+
| Silver | 30 |
|
|
611
|
+
| Gold | 90 |
|
|
612
|
+
| Platinum | 300 |
|
|
613
|
+
|
|
614
|
+
#### Input Parameters <!-- {docsify-ignore} -->
|
|
615
|
+
|
|
616
|
+
| Parameter | Type | Example Value | Description | Required |
|
|
617
|
+
| --- | --- | --- | --- | --- |
|
|
618
|
+
| accountId | String | `me`<br>`12340..` | The account whos trophy list is being accessed<br>Use `me` for the authenticating account | Yes
|
|
619
|
+
|
|
620
|
+
#### Output JSON Response <!-- {docsify-ignore} -->
|
|
621
|
+
|
|
622
|
+
| Attribute | Type | Example Value | Description |
|
|
623
|
+
| --- | --- |--- | --- |
|
|
624
|
+
| accountId | String | `12340..` | The ID of the account being accessed
|
|
625
|
+
| trophyLevel | Numeric | `437` | The overall trophy level
|
|
626
|
+
| trophyPoint | Numeric | `200430` | The total point value of trophies earned
|
|
627
|
+
| trophyLevelBasePoint | Numeric | `199890` | Points required to reach the current trophy level
|
|
628
|
+
| trophyLevelNextPoint | Numeric | `201240` | Points required to reach the next trophy level
|
|
629
|
+
| progress | Numeric | `40` | Percentage process towards the next trophy level
|
|
630
|
+
| tier | Numeric | `5` | The tier this trophy level is in
|
|
631
|
+
| earnedTrophies | [JSON object](#overall-summary-earnedtrophies-json-objects) | | Number of trophies which have been earned by type
|
|
632
|
+
|
|
633
|
+
#### earnedTrophies JSON objects <!-- {docsify-ignore} --> :id=overall-summary-earnedtrophies-json-objects
|
|
634
|
+
|
|
635
|
+
| Attribute | Type | Example Value | Description |
|
|
636
|
+
| --- | --- |--- | --- |
|
|
637
|
+
| bronze | Numeric | `6212` | Total bronze trophies earned
|
|
638
|
+
| silver | Numeric | `1450` | Total silver trophies earned
|
|
639
|
+
| gold | Numeric | `525` | Total gold trophies earned
|
|
640
|
+
| platinum | Numeric | `55` | Total platinum trophies earned
|
|
641
|
+
|
|
642
|
+
#### Example URLs and Responses <!-- {docsify-ignore} -->
|
|
643
|
+
|
|
644
|
+
**Example 1 - Summary of trophies earned by the authenticating account**
|
|
645
|
+
|
|
646
|
+
https://m.np.playstation.com/api/trophy/v1/users/me/trophySummary
|
|
647
|
+
|
|
648
|
+
```json
|
|
649
|
+
{
|
|
650
|
+
"accountId": "0000000000000000000",
|
|
651
|
+
"trophyLevel": 437,
|
|
652
|
+
"trophyPoint": 200430,
|
|
653
|
+
"trophyLevelBasePoint": 199890,
|
|
654
|
+
"trophyLevelNextPoint": 201240,
|
|
655
|
+
"progress": 40,
|
|
656
|
+
"tier": 5,
|
|
657
|
+
"earnedTrophies": {
|
|
658
|
+
"bronze": 6212,
|
|
659
|
+
"silver": 1450,
|
|
660
|
+
"gold": 525,
|
|
661
|
+
"platinum": 55
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
```
|
|
665
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
666
|
+
```powershell
|
|
667
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/trophySummary" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
### Title Trophy Groups
|
|
671
|
+
|
|
672
|
+
https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/{npCommunicationId}/trophyGroups
|
|
673
|
+
|
|
674
|
+
A title may have additional groups of trophies. This is most commonly seen in games which have expansions where additional trophies are added.
|
|
675
|
+
|
|
676
|
+
You can make a request to this URL for a specific title - using the unique `npCommunicationId` for the title - and in response will receive a summary of all of the trophy groups associated with the title. This also includes a summary of the number of trophies for the title broken down by group and type (gold, silver etc.)
|
|
677
|
+
|
|
678
|
+
!> When the title platform is PS3, PS4 or PS Vita you __**must**__ specify the `npServiceName` parameter as `trophy`
|
|
679
|
+
|
|
680
|
+
#### Input Parameters <!-- {docsify-ignore} -->
|
|
681
|
+
|
|
682
|
+
| Parameter | Type | Example Value | Description | Required |
|
|
683
|
+
| --- | --- | --- | --- | --- |
|
|
684
|
+
| npCommunicationId | String | `NPWR10600_00` | Unique ID of the title | Yes
|
|
685
|
+
| npServiceName | String | `trophy`<br>`trophy2` | `trophy` for PS3, PS4, or PS Vita platforms<br>`trophy2` for the PS5 or PC platform | No, unless title platform is PS3, PS4 or PS Vita then **must** be `trophy`
|
|
686
|
+
|
|
687
|
+
#### Output JSON Response <!-- {docsify-ignore} -->
|
|
688
|
+
|
|
689
|
+
| Attribute | Type | Example Value | Description |
|
|
690
|
+
| --- | --- |--- | --- |
|
|
691
|
+
| trophySetVersion | String | `01.40` | The current version of the trophy set
|
|
692
|
+
| trophyTitleName | String | `ASTRO’s PLAYROOM` | Title name
|
|
693
|
+
| trophyTitleDetail | String | `RESIDENT EVIL 5 Trophy Set` | Title description<br>**PS3, PS4 and PS Vita titles only**
|
|
694
|
+
| trophyTitleIconUrl | String | `https://...` | URL of the icon for the trophy title
|
|
695
|
+
| trophyTitlePlatfrom | String | `PS5` | The platform this title belongs to. Some games have trophy sets which are shared between multiple platforms (ie. PS4,PSVITA or PS5,PSPC). The platforms will be comma separated.
|
|
696
|
+
| definedTrophies | [JSON object](#trophy-groups-definedtrophies-json-objects) | | Total number of trophies for the title by type
|
|
697
|
+
| trophyGroups | [JSON object](#trophy-groups-trophygroups-json-objects) | | Individual object for each trophy group returned
|
|
698
|
+
|
|
699
|
+
#### definedTrophies JSON object <!-- {docsify-ignore} --> :id=trophy-groups-definedtrophies-json-objects
|
|
700
|
+
|
|
701
|
+
| Attribute | Type | Example Value | Description |
|
|
702
|
+
| --- | --- |--- | --- |
|
|
703
|
+
| bronze | Numeric | `27` | Total bronze trophies from all trophy groups
|
|
704
|
+
| silver | Numeric | `13` | Total silver trophies from all trophy groups
|
|
705
|
+
| gold | Numeric | `5` | Total gold trophies from all trophy groups
|
|
706
|
+
| platinum | Numeric | `1` | Total platinum trophies from all trophy groups
|
|
707
|
+
|
|
708
|
+
#### trophyGroups JSON objects <!-- {docsify-ignore} --> :id=trophy-groups-trophygroups-json-objects
|
|
709
|
+
|
|
710
|
+
| Attribute | Type | Example Value | Description |
|
|
711
|
+
| --- | --- |--- | --- |
|
|
712
|
+
| trophyGroupId | String | `default`<br>`001` | ID for the trophy group (all titles have default, additional groups are 001 incrementing)
|
|
713
|
+
| trophyGroupName | String | `ASTRO’s PLAYROOM` | Trophy group name
|
|
714
|
+
| trophyGroupDetail | String | `RESIDENT EVIL 5 Trophy Set` | Trophy group description<br>**PS3, PS4 and PS Vita titles only**
|
|
715
|
+
| trophyGroupIconUrl | String | `https://...` | URL of the icon for the trophy group
|
|
716
|
+
| definedTrophies | [JSON object](#trophy-groups-definedtrophies2-json-objects) | | Number of trophies for the trophy group by type
|
|
717
|
+
|
|
718
|
+
#### definedTrophies JSON object <!-- {docsify-ignore} --> :id=trophy-groups-definedtrophies2-json-objects
|
|
719
|
+
|
|
720
|
+
| Attribute | Type | Example Value | Description |
|
|
721
|
+
| --- | --- |--- | --- |
|
|
722
|
+
| bronze | Numeric | `26` | Total bronze trophies in the trophy group
|
|
723
|
+
| silver | Numeric | `13` | Total silver trophies in the trophy group
|
|
724
|
+
| gold | Numeric | `3` | Total gold trophies in the trophy group
|
|
725
|
+
| platinum | Numeric | `1` | Total platinum trophies in the trophy group
|
|
726
|
+
|
|
727
|
+
#### Example URLs and Responses <!-- {docsify-ignore} -->
|
|
728
|
+
|
|
729
|
+
**Example 1 - Retrieve trophy groups for PS5 title ASTRO’s PLAYROOM**
|
|
730
|
+
|
|
731
|
+
https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR20188_00/trophyGroups
|
|
732
|
+
|
|
733
|
+
```json
|
|
734
|
+
{
|
|
735
|
+
"trophySetVersion": "01.40",
|
|
736
|
+
"trophyTitleName": "ASTRO’s PLAYROOM",
|
|
737
|
+
"trophyTitleIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20188_00/035a02db-e64f-4572-8653-4a3db37fe2f6.png",
|
|
738
|
+
"trophyTitlePlatform": "PS5",
|
|
739
|
+
"definedTrophies": {
|
|
740
|
+
"bronze": 27,
|
|
741
|
+
"silver": 13,
|
|
742
|
+
"gold": 5,
|
|
743
|
+
"platinum": 1
|
|
744
|
+
},
|
|
745
|
+
"trophyGroups": [
|
|
746
|
+
{
|
|
747
|
+
"trophyGroupId": "default",
|
|
748
|
+
"trophyGroupName": "ASTRO’s PLAYROOM",
|
|
749
|
+
"trophyGroupIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20188_00/035a02db-e64f-4572-8653-4a3db37fe2f6.png",
|
|
750
|
+
"definedTrophies": {
|
|
751
|
+
"bronze": 26,
|
|
752
|
+
"silver": 13,
|
|
753
|
+
"gold": 3,
|
|
754
|
+
"platinum": 1
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"trophyGroupId": "001",
|
|
759
|
+
"trophyGroupName": "ASTRO’s PLAYROOM [ADD-ON]",
|
|
760
|
+
"trophyGroupIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20188_00/07628edd-c7e7-4762-9409-edcece03a12d.png",
|
|
761
|
+
"definedTrophies": {
|
|
762
|
+
"bronze": 1,
|
|
763
|
+
"silver": 0,
|
|
764
|
+
"gold": 2,
|
|
765
|
+
"platinum": 0
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
]
|
|
769
|
+
}
|
|
770
|
+
```
|
|
771
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
772
|
+
```powershell
|
|
773
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR20188_00/trophyGroups" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
774
|
+
```
|
|
775
|
+
**Example 2 - Retrieve trophy groups for PS5 and PC title Ghost of Tsushima**
|
|
776
|
+
|
|
777
|
+
https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR22859_00/trophyGroups
|
|
778
|
+
|
|
779
|
+
```json
|
|
780
|
+
{
|
|
781
|
+
"npServiceName": "trophy2",
|
|
782
|
+
"npCommunicationId": "NPWR22859_00",
|
|
783
|
+
"trophySetVersion": "01.25",
|
|
784
|
+
"trophyTitleName": "Ghost of Tsushima",
|
|
785
|
+
"trophyTitleIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR22859_00/d7213b2e-8048-40ae-859e-3ce1863b9390.png",
|
|
786
|
+
"trophyTitlePlatform": "PS5,PSPC",
|
|
787
|
+
"definedTrophies": {
|
|
788
|
+
"bronze": 59,
|
|
789
|
+
"silver": 13,
|
|
790
|
+
"gold": 4,
|
|
791
|
+
"platinum": 1
|
|
792
|
+
},
|
|
793
|
+
"trophyGroups": [
|
|
794
|
+
{
|
|
795
|
+
"trophyGroupId": "default",
|
|
796
|
+
"trophyGroupName": "Ghost of Tsushima",
|
|
797
|
+
"trophyGroupIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR22859_00/d7213b2e-8048-40ae-859e-3ce1863b9390.png",
|
|
798
|
+
"definedTrophies": {
|
|
799
|
+
"bronze": 40,
|
|
800
|
+
"silver": 9,
|
|
801
|
+
"gold": 2,
|
|
802
|
+
"platinum": 1
|
|
803
|
+
}
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"trophyGroupId": "001",
|
|
807
|
+
"trophyGroupName": "Ghost of Tsushima: Legends Mode",
|
|
808
|
+
"trophyGroupIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR22859_00/5da15285-93ab-4779-95ef-88278098be11.png",
|
|
809
|
+
"definedTrophies": {
|
|
810
|
+
"bronze": 3,
|
|
811
|
+
"silver": 2,
|
|
812
|
+
"gold": 1,
|
|
813
|
+
"platinum": 0
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
<#-- truncated --#>
|
|
817
|
+
]
|
|
818
|
+
}
|
|
819
|
+
```
|
|
820
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
821
|
+
```powershell
|
|
822
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/npCommunicationIds/NPWR22859_00/trophyGroups" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
### Summary of Trophies Earned by Trophy Group
|
|
826
|
+
|
|
827
|
+
https://m.np.playstation.com/api/trophy/v1/users/{accountId}/npCommunicationIds/{npCommunicationId}/trophyGroups
|
|
828
|
+
|
|
829
|
+
A request to this URL will retrieve a summary of the trophies earned for a user broken down by trophy group within a title. A title can have multiple groups of trophies (a `default` group which all titles have, and additional groups named `001` incrementing for each additional group).
|
|
830
|
+
|
|
831
|
+
The numeric `accountId` can be that of any PSN account for which the authenticating account has permissions to view the trophy list. When querying the titles associated with the authenticating account the numeric `accountId` can be substituted with `me`.
|
|
832
|
+
|
|
833
|
+
This endpoint returns the earned summary of the title and its trophy groups only. No additional descriptive metadata is returned (ie. trophy group name, group description). See [Title Trophy Groups](#title-trophy-groups) to obtain this information.
|
|
834
|
+
|
|
835
|
+
!> When the title platform is PS3, PS4 or PS Vita you __**must**__ specify the `npServiceName` parameter as `trophy`
|
|
836
|
+
|
|
837
|
+
!> If you attempt to query a title which the user does not have associated with their account (ie. the title has not been launched and allowed to sync at least once) then a _Resource not found_ error will be returned.
|
|
838
|
+
|
|
839
|
+
#### Input Parameters <!-- {docsify-ignore} -->
|
|
840
|
+
|
|
841
|
+
| Parameter | Type | Example Value | Description | Required |
|
|
842
|
+
| --- | --- | --- | --- | --- |
|
|
843
|
+
| accountId | String | `me`<br>`12340..` | The account whos trophy list is being accessed<br>Use `me` for the authenticating account | Yes
|
|
844
|
+
| npCommunicationId | String | `NPWR20188_00` | Unique ID of the title | Yes
|
|
845
|
+
| npServiceName | String | `trophy`<br>`trophy2` | `trophy` for PS3, PS4, or PS Vita platforms<br>`trophy2` for the PS5 or PC platform | No, unless title platform is PS3, PS4 or PS Vita then **must** be `trophy`
|
|
846
|
+
|
|
847
|
+
#### Output JSON Response <!-- {docsify-ignore} -->
|
|
848
|
+
|
|
849
|
+
| Attribute | Type | Example Value | Description |
|
|
850
|
+
| --- | --- |--- | --- |
|
|
851
|
+
| trophySetVersion | String | `01.40` | The current version of the trophy set
|
|
852
|
+
| hiddenFlag | Boolean | `false` | Title has been hidden on the accounts trophy list<br>**Authenticating account only<br>Title will not be returned if it has been hidden on another account**
|
|
853
|
+
| progress | Numeric | 100 | Percentage of trophies earned for the title
|
|
854
|
+
| earnedTrophies | [JSON object](#earned-summary-earnedtrophies-json-objects) | | Number of trophies for the title which have been earned by type
|
|
855
|
+
| trophyGroups | [JSON object](#earned-summary-trophygroups-json-objects) | | Individual object for each trophy group returned
|
|
856
|
+
| lastUpdatedDateTime | Date (UTC) | `2020-11-21T10:45:19Z` | Date most recent trophy earned for the title
|
|
857
|
+
|
|
858
|
+
#### earnedTrophies JSON objects <!-- {docsify-ignore} --> :id=earned-summary-earnedtrophies-json-objects
|
|
859
|
+
|
|
860
|
+
| Attribute | Type | Example Value | Description |
|
|
861
|
+
| --- | --- |--- | --- |
|
|
862
|
+
| bronze | Numeric | `27` | Total bronze trophies earned from all trophy groups
|
|
863
|
+
| silver | Numeric | `13` | Total silver trophies earned from all trophy groups
|
|
864
|
+
| gold | Numeric | `5` | Total gold trophies earned from all trophy groups
|
|
865
|
+
| platinum | Numeric | `1` | Total platinum trophies earned from all trophy groups
|
|
866
|
+
|
|
867
|
+
#### trophyGroups JSON objects <!-- {docsify-ignore} --> :id=earned-summary-trophygroups-json-objects
|
|
868
|
+
|
|
869
|
+
| Attribute | Type | Example Value | Description |
|
|
870
|
+
| --- | --- |--- | --- |
|
|
871
|
+
| trophyGroupId | String | `default`<br>`001` | ID for the trophy group (all titles have default, additional groups are 001 incrementing)
|
|
872
|
+
| progress | Numeric | 100 | Percentage of trophies earned for group
|
|
873
|
+
| earnedTrophies | [JSON object](#earned-summary-earnedtrophies1-json-objects) | | Number of trophies for the group which have been earned by type
|
|
874
|
+
| lastUpdatedDateTime | Date (UTC) | `2020-11-21T10:45:19Z` | Date most recent trophy earned for the group
|
|
875
|
+
|
|
876
|
+
#### earnedTrophies JSON objects <!-- {docsify-ignore} --> :id=earned-summary-earnedtrophies1-json-objects
|
|
877
|
+
|
|
878
|
+
| Attribute | Type | Example Value | Description |
|
|
879
|
+
| --- | --- |--- | --- |
|
|
880
|
+
| bronze | Numeric | `27` | Total bronze trophies earned in the trophy group
|
|
881
|
+
| silver | Numeric | `13` | Total silver trophies earned in the trophy group
|
|
882
|
+
| gold | Numeric | `5` | Total gold trophies earned in the trophy group
|
|
883
|
+
| platinum | Numeric | `1` | Total platinum trophies in the trophy group
|
|
884
|
+
|
|
885
|
+
#### Example URLs and Responses <!-- {docsify-ignore} -->
|
|
886
|
+
|
|
887
|
+
**Example 1 - Summary of trophies earned by trophy group for the authenticating account in PS5 title ASTRO’s PLAYROOM**
|
|
888
|
+
|
|
889
|
+
https://m.np.playstation.com/api/trophy/v1/users/me/npCommunicationIds/NPWR20188_00/trophyGroups
|
|
890
|
+
|
|
891
|
+
```json
|
|
892
|
+
{
|
|
893
|
+
"trophySetVersion": "01.40",
|
|
894
|
+
"hiddenFlag": false,
|
|
895
|
+
"progress": 100,
|
|
896
|
+
"earnedTrophies": {
|
|
897
|
+
"bronze": 27,
|
|
898
|
+
"silver": 13,
|
|
899
|
+
"gold": 5,
|
|
900
|
+
"platinum": 1
|
|
901
|
+
},
|
|
902
|
+
"lastUpdatedDateTime": "2020-11-21T10:45:19Z",
|
|
903
|
+
"trophyGroups": [
|
|
904
|
+
{
|
|
905
|
+
"trophyGroupId": "default",
|
|
906
|
+
"progress": 100,
|
|
907
|
+
"earnedTrophies": {
|
|
908
|
+
"bronze": 26,
|
|
909
|
+
"silver": 13,
|
|
910
|
+
"gold": 3,
|
|
911
|
+
"platinum": 1
|
|
912
|
+
},
|
|
913
|
+
"lastUpdatedDateTime": "2020-11-20T23:53:13Z"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"trophyGroupId": "001",
|
|
917
|
+
"progress": 100,
|
|
918
|
+
"earnedTrophies": {
|
|
919
|
+
"bronze": 1,
|
|
920
|
+
"silver": 0,
|
|
921
|
+
"gold": 2,
|
|
922
|
+
"platinum": 0
|
|
923
|
+
},
|
|
924
|
+
"lastUpdatedDateTime": "2020-11-21T10:45:19Z"
|
|
925
|
+
}
|
|
926
|
+
]
|
|
927
|
+
}
|
|
928
|
+
```
|
|
929
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
930
|
+
```powershell
|
|
931
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/npCommunicationIds/NPWR20188_00/trophyGroups" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
**Example 2 - Summary of trophies earned by trophy group for another PSN account with accountId _0000000000000000000_ in PS4 title RESIDENT EVIL 5**
|
|
935
|
+
|
|
936
|
+
https://m.np.playstation.com/api/trophy/v1/users/0000000000000000000/npCommunicationIds/NPWR10600_00/trophyGroups?npServiceName=trophy
|
|
937
|
+
|
|
938
|
+
```json
|
|
939
|
+
{
|
|
940
|
+
"trophySetVersion": "01.01",
|
|
941
|
+
"hiddenFlag": false,
|
|
942
|
+
"progress": 74,
|
|
943
|
+
"earnedTrophies": {
|
|
944
|
+
"bronze": 40,
|
|
945
|
+
"silver": 11,
|
|
946
|
+
"gold": 1,
|
|
947
|
+
"platinum": 1
|
|
948
|
+
},
|
|
949
|
+
"lastUpdatedDateTime": "2017-02-09T22:14:52Z",
|
|
950
|
+
"trophyGroups": [
|
|
951
|
+
{
|
|
952
|
+
"trophyGroupId": "default",
|
|
953
|
+
"progress": 100,
|
|
954
|
+
"earnedTrophies": {
|
|
955
|
+
"bronze": 38,
|
|
956
|
+
"silver": 11,
|
|
957
|
+
"gold": 1,
|
|
958
|
+
"platinum": 1
|
|
959
|
+
},
|
|
960
|
+
"lastUpdatedDateTime": "2017-02-09T22:12:14Z"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"trophyGroupId": "001",
|
|
964
|
+
"progress": 0,
|
|
965
|
+
"earnedTrophies": {
|
|
966
|
+
"bronze": 0,
|
|
967
|
+
"silver": 0,
|
|
968
|
+
"gold": 0,
|
|
969
|
+
"platinum": 0
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"trophyGroupId": "002",
|
|
974
|
+
"progress": 16,
|
|
975
|
+
"earnedTrophies": {
|
|
976
|
+
"bronze": 1,
|
|
977
|
+
"silver": 0,
|
|
978
|
+
"gold": 0,
|
|
979
|
+
"platinum": 0
|
|
980
|
+
},
|
|
981
|
+
"lastUpdatedDateTime": "2016-07-17T17:44:28Z"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
"trophyGroupId": "003",
|
|
985
|
+
"progress": 16,
|
|
986
|
+
"earnedTrophies": {
|
|
987
|
+
"bronze": 1,
|
|
988
|
+
"silver": 0,
|
|
989
|
+
"gold": 0,
|
|
990
|
+
"platinum": 0
|
|
991
|
+
},
|
|
992
|
+
"lastUpdatedDateTime": "2016-07-17T19:49:44Z"
|
|
993
|
+
}
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
```
|
|
997
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
998
|
+
```powershell
|
|
999
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/0000000000000000000/npCommunicationIds/NPWR10600_00/trophyGroups?npServiceName=trophy" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
1000
|
+
```
|
|
1001
|
+
### Trophy Title Summary for Specific Title ID
|
|
1002
|
+
|
|
1003
|
+
https://m.np.playstation.com/api/trophy/v1/users/{accountId}/titles/trophyTitles?npTitleIds={titleId}
|
|
1004
|
+
|
|
1005
|
+
A request to this URL will retrieve a summary of the trophies earned by a user for specific titles.
|
|
1006
|
+
|
|
1007
|
+
The `titleId` can be a single title ID, or it can be a comma separated list of title IDs (%2C when used in a URL). Every title has an ID assigned to it with these typically starting "CUSA" for PS4 titles and "PPSA" for PS5 titles.
|
|
1008
|
+
|
|
1009
|
+
The numeric `accountId` can be that of any PSN account for which the authenticating account has permissions to view the trophy list. When querying the titles associated with the authenticating account the numeric `accountId` can be substituted with `me`.
|
|
1010
|
+
|
|
1011
|
+
If optional parameter `includeNotEarnedTrophyIds` is included and set to `true` then the response will contain a list of IDs for the individual trophies which the user has not earned for each title ID queried. This functionality was added to the endpoint post release, most likely early 2023.
|
|
1012
|
+
|
|
1013
|
+
This endpoint can be used as a way of linking the `npCommunicationId` of a Trophy Set to a titles `npTitleId`, but as with the other user based endpoints in this version of the API you will only get a useful response back if the account you are querying against has played the title.
|
|
1014
|
+
|
|
1015
|
+
!> If you attempt to query a title ID which does not exist then a _Resource not found_ error will be returned.
|
|
1016
|
+
|
|
1017
|
+
!> There is a limit of 5 title IDs which can be included in the `npTitleIds` query. Trying to include more than 5 will result in a _Bad Request (query: npTitleId)_ error being returned.
|
|
1018
|
+
|
|
1019
|
+
#### Input Parameters <!-- {docsify-ignore} -->
|
|
1020
|
+
|
|
1021
|
+
| Parameter | Type | Example Value | Description | Required |
|
|
1022
|
+
| --- | --- | --- | --- | --- |
|
|
1023
|
+
| accountId | String | `me`<br>`12340..` | The account whos trophy list is being accessed<br>Use `me` for the authenticating account | Yes
|
|
1024
|
+
| includeNotEarnedTrophyIds | Boolean | `true` | The response will include the IDs for the individual trophies which have not been earned | No
|
|
1025
|
+
| npTitleIds | String | `PPSA01284_00`<br>`PPSA01284_00%2CCUSA09171_00` | Unique ID of the title<br>Limit of 5 per request | Yes
|
|
1026
|
+
|
|
1027
|
+
#### Output JSON Response <!-- {docsify-ignore} -->
|
|
1028
|
+
|
|
1029
|
+
| Attribute | Type | Example Value | Description |
|
|
1030
|
+
| --- | --- |--- | --- |
|
|
1031
|
+
| titles | Array<br>[JSON object](#trophy-title-summary-for-specific-title-id-titles-json-objects) | | Individual object for each title returned
|
|
1032
|
+
|
|
1033
|
+
#### titles JSON objects <!-- {docsify-ignore} --> :id=trophy-title-summary-for-specific-title-id-titles-json-objects
|
|
1034
|
+
|
|
1035
|
+
| Attribute | Type | Example Value | Description |
|
|
1036
|
+
| --- | --- |--- | --- |
|
|
1037
|
+
| npTitleId | String | `PPSA01284_00` | npTitleId of the title
|
|
1038
|
+
| trophyTitles | Array<br>[JSON object](#trophy-title-summary-for-specific-title-id-trophyTitles-json-objects) | | Trophy set associated with the title<br>**This will only be returned if the queried account has played the title (and allowed their trophies to sync) at least once**
|
|
1039
|
+
|
|
1040
|
+
#### trophyTitles JSON objects <!-- {docsify-ignore} --> :id=trophy-title-summary-for-specific-title-id-trophyTitles-json-objects
|
|
1041
|
+
|
|
1042
|
+
| Attribute | Type | Example Response | Description |
|
|
1043
|
+
| --- | --- |--- | --- |
|
|
1044
|
+
| npServiceName | String | `trophy`<br>`trophy2` | `trophy` for PS3, PS4, or PS Vita platforms<br>`trophy2` for the PS5 or PC platform
|
|
1045
|
+
| npCommunicationId | String | `NPWR20004_00` | Unique ID of the trophy set
|
|
1046
|
+
| trophyTitleName | String | `Returnal` | Title name
|
|
1047
|
+
| trophyTitleDetail | String | `RESIDENT EVIL 5 Trophy Set` | Title description<br>**PS3, PS4 and PS Vita titles only**
|
|
1048
|
+
| trophyTitleIconUrl | String | `https://...` | URL of the icon for the title
|
|
1049
|
+
| hasTrophyGroups | Boolean | `true` | True if the title has multiple groups of trophies (eg. DLC trophies which are separate from the main trophy list)
|
|
1050
|
+
| rarestTrophies | Array<br>[JSON object](#trophy-title-summary-for-specific-title-id-rarestTrophies-json-objects) | | Individual object for each trophy<br>Returns the trophy where `earned` is `true` with the lowest `trophyEarnedRate`<br>Can return more than one if the earned rate is shared by multiple trophies<br>**Returns nothing if no trophies are earned**
|
|
1051
|
+
| progress | Numeric | 100 | Percentage of trophies earned for the title
|
|
1052
|
+
| earnedTrophies | [JSON object](#trophy-title-summary-for-specific-title-id-earnedTrophies-json-objects) | | Number of trophies for the title which have been earned by type
|
|
1053
|
+
| definedTrophies | [JSON object](#trophy-title-summary-for-specific-title-id-definedTrophies-json-objects) | | Number of trophies for the title by type
|
|
1054
|
+
| notEarnedTrophyIds | Array<br>Numeric | `[ 42, 43 ]` | Ids for trophies which have not been earned<br>**Returns nothing if all trophies are earned**<br>**Only returned if parameter `includeNotEarnedTrophyIds` is `true`**
|
|
1055
|
+
| lastUpdatedDateTime | Date (UTC) | `2021-06-20T12:46:34Z` | Date most recent trophy earned for the title
|
|
1056
|
+
|
|
1057
|
+
#### rarestTrophies JSON objects <!-- {docsify-ignore} --> :id=trophy-title-summary-for-specific-title-id-rarestTrophies-json-objects
|
|
1058
|
+
|
|
1059
|
+
| Attribute | Type | Example Value | Description |
|
|
1060
|
+
| --- | --- |--- | --- |
|
|
1061
|
+
| trophyId | Numeric<br>**Min** 0 | `0`| Unique ID for this trophy (unique within the title and not just the group)
|
|
1062
|
+
| trophyHidden | Boolean | `false` | True if this is a secret trophy (ie. further details are not displayed by default unless earned)
|
|
1063
|
+
| trophyType | String | `bronze`<br>`silver`<br>`gold`<br>`platinum` | Type of the trophy
|
|
1064
|
+
| trophyName | String | `Helios` | Name of the trophy
|
|
1065
|
+
| trophyDetail | String | `Collect all trophies` | Description of the trophy
|
|
1066
|
+
| trophyIconUrl | String | `https://...` | URL for the graphic associated with the trophy
|
|
1067
|
+
| trophyRare | Numeric | `0`<br>`1` | Rarity of the trophy<br>`0` Ultra Rare<br>`1` Very Rare<br>`2` Rare<br>`3` Common
|
|
1068
|
+
| trophyEarnedRate | String | `2.9` | Percentage of all users who have earned the trophy
|
|
1069
|
+
| earned | Boolean | `true` | True if this trophy has been earned
|
|
1070
|
+
| earnedDateTime | Date (UTC) | `2021-06-20T12:46:33Z` | Date trophy was earned
|
|
1071
|
+
|
|
1072
|
+
#### earnedTrophies JSON objects <!-- {docsify-ignore} --> :id=trophy-title-summary-for-specific-title-id-earnedTrophies-json-objects
|
|
1073
|
+
|
|
1074
|
+
| Attribute | Type | Example Value | Description |
|
|
1075
|
+
| --- | --- |--- | --- |
|
|
1076
|
+
| bronze | Numeric | `27` | Total bronze trophies earned from all trophy groups
|
|
1077
|
+
| silver | Numeric | `13` | Total silver trophies earned from all trophy groups
|
|
1078
|
+
| gold | Numeric | `5` | Total gold trophies earned from all trophy groups
|
|
1079
|
+
| platinum | Numeric | `1` | Total platinum trophies earned from all trophy groups
|
|
1080
|
+
|
|
1081
|
+
#### definedTrophies JSON objects <!-- {docsify-ignore} --> :id=trophy-title-summary-for-specific-title-id-definedTrophies-json-objects
|
|
1082
|
+
|
|
1083
|
+
| Attribute | Type | Example Value | Description |
|
|
1084
|
+
| --- | --- |--- | --- |
|
|
1085
|
+
| bronze | Numeric | `27` | Total bronze trophies from all trophy groups
|
|
1086
|
+
| silver | Numeric | `13` | Total silver trophies from all trophy groups
|
|
1087
|
+
| gold | Numeric | `5` | Total gold trophies from all trophy groups
|
|
1088
|
+
| platinum | Numeric | `1` | Total platinum trophies from all trophy groups
|
|
1089
|
+
|
|
1090
|
+
#### Example URLs and Responses <!-- {docsify-ignore} -->
|
|
1091
|
+
|
|
1092
|
+
**Example 1 - Summary of trophy titles associated with title IDs PPSA01284_00 (Returnal, PS5), CUSA09171_00 (RESIDENT EVIL 2, PS4) and PPSA04874_00 (Apex Legends, PS5) for the authenticating account**
|
|
1093
|
+
|
|
1094
|
+
https://m.np.playstation.com/api/trophy/v1/users/me/titles/trophyTitles?npTitleIds=CUSA09171_00%2CPPSA01284_00%2CPPSA04874_00
|
|
1095
|
+
|
|
1096
|
+
```json
|
|
1097
|
+
{
|
|
1098
|
+
"titles": [
|
|
1099
|
+
{
|
|
1100
|
+
"npTitleId": "PPSA01284_00",
|
|
1101
|
+
"trophyTitles": [
|
|
1102
|
+
{
|
|
1103
|
+
"npServiceName": "trophy2",
|
|
1104
|
+
"npCommunicationId": "NPWR20004_00",
|
|
1105
|
+
"trophyTitleName": "Returnal",
|
|
1106
|
+
"trophyTitleIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20004_00/f60fd55f-a01f-4274-a865-d8356dc0fd9c.png",
|
|
1107
|
+
"hasTrophyGroups": false,
|
|
1108
|
+
"rarestTrophies": [
|
|
1109
|
+
{
|
|
1110
|
+
"trophyId": 0,
|
|
1111
|
+
"trophyHidden": false,
|
|
1112
|
+
"trophyType": "platinum",
|
|
1113
|
+
"trophyName": "Helios",
|
|
1114
|
+
"trophyDetail": "Collect all trophies",
|
|
1115
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20004_00/aadf79b0-5119-45a2-b925-4e9b6e4bf4ed.png",
|
|
1116
|
+
"trophyRare": 0,
|
|
1117
|
+
"trophyEarnedRate": "2.9",
|
|
1118
|
+
"earned": true,
|
|
1119
|
+
"earnedDateTime": "2021-06-20T12:46:33Z"
|
|
1120
|
+
}
|
|
1121
|
+
],
|
|
1122
|
+
"progress": 100,
|
|
1123
|
+
"earnedTrophies": {
|
|
1124
|
+
"bronze": 18,
|
|
1125
|
+
"silver": 5,
|
|
1126
|
+
"gold": 7,
|
|
1127
|
+
"platinum": 1
|
|
1128
|
+
},
|
|
1129
|
+
"definedTrophies": {
|
|
1130
|
+
"bronze": 18,
|
|
1131
|
+
"silver": 5,
|
|
1132
|
+
"gold": 7,
|
|
1133
|
+
"platinum": 1
|
|
1134
|
+
},
|
|
1135
|
+
"lastUpdatedDateTime": "2021-06-20T12:46:34Z"
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
"npTitleId": "CUSA09171_00",
|
|
1141
|
+
"trophyTitles": [
|
|
1142
|
+
{
|
|
1143
|
+
"npServiceName": "trophy",
|
|
1144
|
+
"npCommunicationId": "NPWR15179_00",
|
|
1145
|
+
"trophyTitleName": "RESIDENT EVIL 2",
|
|
1146
|
+
"trophyTitleDetail": "RESIDENT EVIL 2",
|
|
1147
|
+
"trophyTitleIconUrl": "https://image.api.playstation.com/trophy/np/NPWR15179_00_004E1F39C12A2C6264BA2A0546D9234F56889DCC5F/BAFEDE2151A73E1FAFE59B8575EC1CF99F6A75F6.PNG",
|
|
1148
|
+
"hasTrophyGroups": true,
|
|
1149
|
+
"rarestTrophies": [
|
|
1150
|
+
{
|
|
1151
|
+
"trophyId": 0,
|
|
1152
|
+
"trophyHidden": false,
|
|
1153
|
+
"trophyType": "platinum",
|
|
1154
|
+
"trophyName": "Raccoon City Native",
|
|
1155
|
+
"trophyDetail": "Obtain all trophies.",
|
|
1156
|
+
"trophyIconUrl": "https://image.api.playstation.com/trophy/np/NPWR15179_00_004E1F39C12A2C6264BA2A0546D9234F56889DCC5F/F957C0C5B0D2B63EBE1BB072B521E2B5A24D2986.PNG",
|
|
1157
|
+
"trophyRare": 0,
|
|
1158
|
+
"trophyEarnedRate": "3.4",
|
|
1159
|
+
"earned": true,
|
|
1160
|
+
"earnedDateTime": "2020-10-18T15:23:07Z"
|
|
1161
|
+
}
|
|
1162
|
+
],
|
|
1163
|
+
"progress": 95,
|
|
1164
|
+
"earnedTrophies": {
|
|
1165
|
+
"bronze": 29,
|
|
1166
|
+
"silver": 9,
|
|
1167
|
+
"gold": 4,
|
|
1168
|
+
"platinum": 1
|
|
1169
|
+
},
|
|
1170
|
+
"definedTrophies": {
|
|
1171
|
+
"bronze": 30,
|
|
1172
|
+
"silver": 10,
|
|
1173
|
+
"gold": 4,
|
|
1174
|
+
"platinum": 1
|
|
1175
|
+
},
|
|
1176
|
+
"lastUpdatedDateTime": "2020-10-18T15:23:11Z"
|
|
1177
|
+
}
|
|
1178
|
+
]
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
"npTitleId": "PPSA04874_00",
|
|
1182
|
+
"trophyTitles": []
|
|
1183
|
+
}
|
|
1184
|
+
]
|
|
1185
|
+
}
|
|
1186
|
+
```
|
|
1187
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
1188
|
+
```powershell
|
|
1189
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/titles/trophyTitles?npTitleIds=CUSA09171_00%2CPPSA01284_00%2CPPSA04874_00" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
**Example 2 - Summary of trophy titles associated with title IDs PPSA01284_00 (Returnal, PS5), CUSA09171_00 (RESIDENT EVIL 2, PS4) and PPSA04874_00 (Apex Legends, PS5) for the authenticating account, with `includeNotEarnedTrophyIds` set to `true`**
|
|
1193
|
+
|
|
1194
|
+
https://m.np.playstation.com/api/trophy/v1/users/me/titles/trophyTitles?includeNotEarnedTrophyIds=true&npTitleIds=CUSA09171_00%2CPPSA01284_00%2CPPSA04874_00
|
|
1195
|
+
|
|
1196
|
+
```json
|
|
1197
|
+
{
|
|
1198
|
+
"titles": [
|
|
1199
|
+
{
|
|
1200
|
+
"npTitleId": "PPSA01284_00",
|
|
1201
|
+
"trophyTitles": [
|
|
1202
|
+
{
|
|
1203
|
+
"npServiceName": "trophy2",
|
|
1204
|
+
"npCommunicationId": "NPWR20004_00",
|
|
1205
|
+
"trophyTitleName": "Returnal",
|
|
1206
|
+
"trophyTitleIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20004_00/f60fd55f-a01f-4274-a865-d8356dc0fd9c.png",
|
|
1207
|
+
"hasTrophyGroups": true,
|
|
1208
|
+
"rarestTrophies": [
|
|
1209
|
+
{
|
|
1210
|
+
"trophyId": 34,
|
|
1211
|
+
"trophyHidden": true,
|
|
1212
|
+
"trophyType": "bronze",
|
|
1213
|
+
"trophyName": "Destroyer",
|
|
1214
|
+
"trophyDetail": "Kill 100 Hostiles with Disgorgers",
|
|
1215
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20004_00/c468768c-a6c3-4ced-9f0f-e75d5a9a36c2.png",
|
|
1216
|
+
"trophyRare": 0,
|
|
1217
|
+
"trophyEarnedRate": "1.3",
|
|
1218
|
+
"earned": true,
|
|
1219
|
+
"earnedDateTime": "2022-08-14T14:19:02Z"
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
"trophyId": 37,
|
|
1223
|
+
"trophyHidden": true,
|
|
1224
|
+
"trophyType": "gold",
|
|
1225
|
+
"trophyName": "Find Release",
|
|
1226
|
+
"trophyDetail": "Gain a moment of peace",
|
|
1227
|
+
"trophyIconUrl": "https://psnobj.prod.dl.playstation.net/psnobj/NPWR20004_00/3270f141-9f24-4d86-b7b3-c77654e47631.png",
|
|
1228
|
+
"trophyRare": 0,
|
|
1229
|
+
"trophyEarnedRate": "1.3",
|
|
1230
|
+
"earned": true,
|
|
1231
|
+
"earnedDateTime": "2022-08-14T19:43:38Z"
|
|
1232
|
+
}
|
|
1233
|
+
],
|
|
1234
|
+
"progress": 100,
|
|
1235
|
+
"earnedTrophies": {
|
|
1236
|
+
"bronze": 23,
|
|
1237
|
+
"silver": 6,
|
|
1238
|
+
"gold": 8,
|
|
1239
|
+
"platinum": 1
|
|
1240
|
+
},
|
|
1241
|
+
"definedTrophies": {
|
|
1242
|
+
"bronze": 23,
|
|
1243
|
+
"silver": 6,
|
|
1244
|
+
"gold": 8,
|
|
1245
|
+
"platinum": 1
|
|
1246
|
+
},
|
|
1247
|
+
"notEarnedTrophyIds": [],
|
|
1248
|
+
"lastUpdatedDateTime": "2022-08-14T19:43:39Z"
|
|
1249
|
+
}
|
|
1250
|
+
]
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
"npTitleId": "CUSA09171_00",
|
|
1254
|
+
"trophyTitles": [
|
|
1255
|
+
{
|
|
1256
|
+
"npServiceName": "trophy",
|
|
1257
|
+
"npCommunicationId": "NPWR15179_00",
|
|
1258
|
+
"trophyTitleName": "RESIDENT EVIL 2",
|
|
1259
|
+
"trophyTitleDetail": "RESIDENT EVIL 2",
|
|
1260
|
+
"trophyTitleIconUrl": "https://image.api.playstation.com/trophy/np/NPWR15179_00_004E1F39C12A2C6264BA2A0546D9234F56889DCC5F/BAFEDE2151A73E1FAFE59B8575EC1CF99F6A75F6.PNG",
|
|
1261
|
+
"hasTrophyGroups": true,
|
|
1262
|
+
"rarestTrophies": [
|
|
1263
|
+
{
|
|
1264
|
+
"trophyId": 0,
|
|
1265
|
+
"trophyHidden": false,
|
|
1266
|
+
"trophyType": "platinum",
|
|
1267
|
+
"trophyName": "Raccoon City Native",
|
|
1268
|
+
"trophyDetail": "Obtain all trophies.",
|
|
1269
|
+
"trophyIconUrl": "https://image.api.playstation.com/trophy/np/NPWR15179_00_004E1F39C12A2C6264BA2A0546D9234F56889DCC5F/F957C0C5B0D2B63EBE1BB072B521E2B5A24D2986.PNG",
|
|
1270
|
+
"trophyRare": 0,
|
|
1271
|
+
"trophyEarnedRate": "3.4",
|
|
1272
|
+
"earned": true,
|
|
1273
|
+
"earnedDateTime": "2020-10-18T15:23:07Z"
|
|
1274
|
+
}
|
|
1275
|
+
],
|
|
1276
|
+
"progress": 95,
|
|
1277
|
+
"earnedTrophies": {
|
|
1278
|
+
"bronze": 29,
|
|
1279
|
+
"silver": 9,
|
|
1280
|
+
"gold": 4,
|
|
1281
|
+
"platinum": 1
|
|
1282
|
+
},
|
|
1283
|
+
"definedTrophies": {
|
|
1284
|
+
"bronze": 30,
|
|
1285
|
+
"silver": 10,
|
|
1286
|
+
"gold": 4,
|
|
1287
|
+
"platinum": 1
|
|
1288
|
+
},
|
|
1289
|
+
"notEarnedTrophyIds": [
|
|
1290
|
+
42,
|
|
1291
|
+
43
|
|
1292
|
+
],
|
|
1293
|
+
"lastUpdatedDateTime": "2020-10-18T15:23:11Z"
|
|
1294
|
+
}
|
|
1295
|
+
]
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"npTitleId": "PPSA04874_00",
|
|
1299
|
+
"trophyTitles": []
|
|
1300
|
+
}
|
|
1301
|
+
]
|
|
1302
|
+
}
|
|
1303
|
+
```
|
|
1304
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
1305
|
+
```powershell
|
|
1306
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/titles/trophyTitles?includeNotEarnedTrophyIds=true&npTitleIds=CUSA09171_00%2CPPSA01284_00%2CPPSA04874_00" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 10
|
|
1307
|
+
```
|
|
1308
|
+
|
|
1309
|
+
## Game Help Endpoints
|
|
1310
|
+
|
|
1311
|
+
The updated trophy system which launched with the PlayStation 5 included a new PlayStation Plus subscriber benefit called Game Help. It provides tips and guides on how to complete specific trophies. This information was initially only accessible via the trophy list or activity cards on the console itself, however the PlayStation App was updated in May 2023 (v23.5.0) to include support for accessing the Game Help associated with trophies (activity card Game Help remains only accessible on console).
|
|
1312
|
+
|
|
1313
|
+
As of [early 2024 Game Help no longer requires a PS+ subscription](https://blog.playstation.com/2024/03/26/introducing-community-game-help-a-new-enhancement-for-game-help-powered-by-user-generated-content/) and is now available to all PS5 players.
|
|
1314
|
+
|
|
1315
|
+
There are two main endpoints for this function:
|
|
1316
|
+
* Request a list of trophies for a specific title which have Game Help available.
|
|
1317
|
+
* Request the Game Help that is available for a specific trophy.
|
|
1318
|
+
|
|
1319
|
+
The Game Help can come in the form of written descriptions for how to earn a trophy, or it can be in the form of a video guide. When a video is used the API response includes the URL to a HLS video stream, along with a short lived access token granting access to the file. The stream includes resolutions up to 1080p. It can be viewed in applications such as VLC media player, or downloaded with applications like ffmpeg or JDownloader 2.
|
|
1320
|
+
|
|
1321
|
+
### Retrieve Trophies with Game Help available for a Title
|
|
1322
|
+
|
|
1323
|
+
https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetHintAvailability
|
|
1324
|
+
|
|
1325
|
+
Requests to this URL will retrieve a list of the trophies for a title which have Game Help available.
|
|
1326
|
+
|
|
1327
|
+
You can check against all trophies, or you can limit the request to only check against specific trophy IDs.
|
|
1328
|
+
|
|
1329
|
+
#### Input Parameters <!-- {docsify-ignore} -->
|
|
1330
|
+
|
|
1331
|
+
| Parameter | Value
|
|
1332
|
+
| --- | ---
|
|
1333
|
+
| operationName | `metGetHintAvailability`
|
|
1334
|
+
| variables | `{"npCommId":"NPWR20188_00"}`
|
|
1335
|
+
| extensions | `{"persistedQuery":{"version":1,"sha256Hash":"71bf26729f2634f4d8cca32ff73aaf42b3b76ad1d2f63b490a809b66483ea5a7"}}`
|
|
1336
|
+
|
|
1337
|
+
| Property | Parent Parameter | Type | Example Values | Description | Required
|
|
1338
|
+
| --- | --- | --- | --- | --- | ---
|
|
1339
|
+
| npCommId | variables | String | `NPWR20188_00` | Unique ID of the title | Yes
|
|
1340
|
+
| trophyIds | variables | Array<br>String | `["0", "1"]` | Limit request to these specific trophy IDs | No
|
|
1341
|
+
|
|
1342
|
+
##### Additional Headers <!-- {docsify-ignore} -->
|
|
1343
|
+
|
|
1344
|
+
Requests to this endpoint must include additional headers in the request.
|
|
1345
|
+
|
|
1346
|
+
| Key | Value |
|
|
1347
|
+
| --- | --- |
|
|
1348
|
+
| apollographql-client-name | PlayStationApp-Android |
|
|
1349
|
+
| content-type | application/json |
|
|
1350
|
+
|
|
1351
|
+
#### Output JSON Response <!-- {docsify-ignore} -->
|
|
1352
|
+
|
|
1353
|
+
A JSON response is returned. The following are returned under the `data` attribute.
|
|
1354
|
+
|
|
1355
|
+
| Attribute | Type | Example Value | Description
|
|
1356
|
+
| --- | --- | --- | ---
|
|
1357
|
+
| hintAvailabilityRetrieve | [JSON object `HintAvailability`](#game-help-hint-availability-json-objects) |
|
|
1358
|
+
|
|
1359
|
+
#### HintAvailability JSON objects <!-- {docsify-ignore} --> :id=game-help-hint-availability-json-objects
|
|
1360
|
+
|
|
1361
|
+
| Attribute | Type | Example Value | Description
|
|
1362
|
+
| --- | --- | --- | ---
|
|
1363
|
+
| __typename | String | `HintAvailability` |
|
|
1364
|
+
| trophies | Array<br>[JSON object `TrophyInfoWithHintAvailable`](#game-help-trophy-info-with-hint-available-json-objects) | | Contains a list of trophies which support Game Help<br>Will return an empty array if no trophies support Game Help
|
|
1365
|
+
|
|
1366
|
+
#### TrophyInfoWithHintAvailable JSON objects <!-- {docsify-ignore} --> :id=game-help-trophy-info-with-hint-available-json-objects
|
|
1367
|
+
|
|
1368
|
+
| Attribute | Type | Example Value | Description
|
|
1369
|
+
| --- | --- | --- | ---
|
|
1370
|
+
| __typename | String | `TrophyInfoWithHintAvailable` |
|
|
1371
|
+
| helpType | String | `HINT` | Type of Game Help
|
|
1372
|
+
| id | String | `NPWR20188_00::18` | Combination of the title ID and individual trophy ID
|
|
1373
|
+
| trophyId | String | `18` | Trophy ID
|
|
1374
|
+
| udsObjectId | String | `GATCHA_SECRET`<br>`0001` | Game Help ID
|
|
1375
|
+
|
|
1376
|
+
#### Example URLs and Responses <!-- {docsify-ignore} -->
|
|
1377
|
+
|
|
1378
|
+
**Example 1 - Retrieve all trophies with Game Help available for PS5 title ASTRO’s PLAYROOM**
|
|
1379
|
+
|
|
1380
|
+
https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetHintAvailability&variables={"npCommId":"NPWR20188_00"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"71bf26729f2634f4d8cca32ff73aaf42b3b76ad1d2f63b490a809b66483ea5a7"}}
|
|
1381
|
+
|
|
1382
|
+
```json
|
|
1383
|
+
{
|
|
1384
|
+
"data": {
|
|
1385
|
+
"hintAvailabilityRetrieve": {
|
|
1386
|
+
"__typename": "HintAvailability",
|
|
1387
|
+
"trophies": [
|
|
1388
|
+
{
|
|
1389
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1390
|
+
"helpType": "HINT",
|
|
1391
|
+
"id": "NPWR20188_00::18",
|
|
1392
|
+
"trophyId": "18",
|
|
1393
|
+
"udsObjectId": "GATCHA_SECRET"
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1397
|
+
"helpType": "HINT",
|
|
1398
|
+
"id": "NPWR20188_00::21",
|
|
1399
|
+
"trophyId": "21",
|
|
1400
|
+
"udsObjectId": "PLAZA_SEND_BOT_FLYING"
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1404
|
+
"helpType": "HINT",
|
|
1405
|
+
"id": "NPWR20188_00::22",
|
|
1406
|
+
"trophyId": "22",
|
|
1407
|
+
"udsObjectId": "PLAZA_WALK_AROUND_BOT"
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1411
|
+
"helpType": "HINT",
|
|
1412
|
+
"id": "NPWR20188_00::23",
|
|
1413
|
+
"trophyId": "23",
|
|
1414
|
+
"udsObjectId": "LABO_PUNCH_AND_SPIN_PS2LOGO"
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1418
|
+
"helpType": "HINT",
|
|
1419
|
+
"id": "NPWR20188_00::25",
|
|
1420
|
+
"trophyId": "25",
|
|
1421
|
+
"udsObjectId": "LABO_LOOK_INTO_PSVR"
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1425
|
+
"helpType": "HINT",
|
|
1426
|
+
"id": "NPWR20188_00::26",
|
|
1427
|
+
"trophyId": "26",
|
|
1428
|
+
"udsObjectId": "LABO_RIDE_AIM_CONTROLLER"
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1432
|
+
"helpType": "HINT",
|
|
1433
|
+
"id": "NPWR20188_00::27",
|
|
1434
|
+
"trophyId": "27",
|
|
1435
|
+
"udsObjectId": "LABO_WALK_HOME_ICON"
|
|
1436
|
+
},
|
|
1437
|
+
{
|
|
1438
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1439
|
+
"helpType": "HINT",
|
|
1440
|
+
"id": "NPWR20188_00::28",
|
|
1441
|
+
"trophyId": "28",
|
|
1442
|
+
"udsObjectId": "LABO_OPEN_PS1"
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1446
|
+
"helpType": "HINT",
|
|
1447
|
+
"id": "NPWR20188_00::29",
|
|
1448
|
+
"trophyId": "29",
|
|
1449
|
+
"udsObjectId": "COOLING_JUGGLE_BALL_WITH_FROG"
|
|
1450
|
+
},
|
|
1451
|
+
{
|
|
1452
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1453
|
+
"helpType": "HINT",
|
|
1454
|
+
"id": "NPWR20188_00::30",
|
|
1455
|
+
"trophyId": "30",
|
|
1456
|
+
"udsObjectId": "COOLING_DIVED_FROM_DIVING_BOARD"
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1460
|
+
"helpType": "HINT",
|
|
1461
|
+
"id": "NPWR20188_00::31",
|
|
1462
|
+
"trophyId": "31",
|
|
1463
|
+
"udsObjectId": "COOLING_JUMP_IN_FOUNTAIN"
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1467
|
+
"helpType": "HINT",
|
|
1468
|
+
"id": "NPWR20188_00::32",
|
|
1469
|
+
"trophyId": "32",
|
|
1470
|
+
"udsObjectId": "COOLING_JUMP_ATTACK"
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1474
|
+
"helpType": "HINT",
|
|
1475
|
+
"id": "NPWR20188_00::33",
|
|
1476
|
+
"trophyId": "33",
|
|
1477
|
+
"udsObjectId": "MEMORY_AWAY_FROM_RAIN"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1481
|
+
"helpType": "HINT",
|
|
1482
|
+
"id": "NPWR20188_00::34",
|
|
1483
|
+
"trophyId": "34",
|
|
1484
|
+
"udsObjectId": "MEMORY_HIT_FLYING_CAN"
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1488
|
+
"helpType": "HINT",
|
|
1489
|
+
"id": "NPWR20188_00::35",
|
|
1490
|
+
"trophyId": "35",
|
|
1491
|
+
"udsObjectId": "MEMORY_GOT_STRIKE"
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1495
|
+
"helpType": "HINT",
|
|
1496
|
+
"id": "NPWR20188_00::36",
|
|
1497
|
+
"trophyId": "36",
|
|
1498
|
+
"udsObjectId": "GPU_DEFLECT_SPTR_BLT_WITH_ARROW"
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1502
|
+
"helpType": "HINT",
|
|
1503
|
+
"id": "NPWR20188_00::37",
|
|
1504
|
+
"trophyId": "37",
|
|
1505
|
+
"udsObjectId": "GPU_MADE_HUGE_SNOWBALL"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1509
|
+
"helpType": "HINT",
|
|
1510
|
+
"id": "NPWR20188_00::38",
|
|
1511
|
+
"trophyId": "38",
|
|
1512
|
+
"udsObjectId": "GPU_CATCH_THE_CLIFF_AFTER_FALL"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1516
|
+
"helpType": "HINT",
|
|
1517
|
+
"id": "NPWR20188_00::39",
|
|
1518
|
+
"trophyId": "39",
|
|
1519
|
+
"udsObjectId": "GPU_HIT_RABBIT_WITH_ARROW"
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1523
|
+
"helpType": "HINT",
|
|
1524
|
+
"id": "NPWR20188_00::40",
|
|
1525
|
+
"trophyId": "40",
|
|
1526
|
+
"udsObjectId": "SSD_SPIN_WHILE_SHOOT_MACHINE_GUN"
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1530
|
+
"helpType": "HINT",
|
|
1531
|
+
"id": "NPWR20188_00::42",
|
|
1532
|
+
"trophyId": "42",
|
|
1533
|
+
"udsObjectId": "LABO_PUNCH_COMPANY_LOGO"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1537
|
+
"helpType": "HINT",
|
|
1538
|
+
"id": "NPWR20188_00::45",
|
|
1539
|
+
"trophyId": "45",
|
|
1540
|
+
"udsObjectId": "DAY1__GRAVITY_DAZE"
|
|
1541
|
+
}
|
|
1542
|
+
]
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
```
|
|
1547
|
+
|
|
1548
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
1549
|
+
```powershell
|
|
1550
|
+
Invoke-RestMethod -Uri 'https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetHintAvailability&variables={"npCommId":"NPWR20188_00"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"71bf26729f2634f4d8cca32ff73aaf42b3b76ad1d2f63b490a809b66483ea5a7"}}' -Headers @{"apollographql-client-name"="PlayStationApp-Android";"content-type"="application/json"} -Authentication Bearer -Token $token | ConvertTo-Json -Depth 5
|
|
1551
|
+
```
|
|
1552
|
+
|
|
1553
|
+
**Example 2 - Check if trophies 18, 19 and 21 from PS5 title ASTRO’s PLAYROOM have Game Help available**
|
|
1554
|
+
|
|
1555
|
+
https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetHintAvailability&variables={"npCommId":"NPWR20188_00","trophyIds":["18", "19", "21"]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"71bf26729f2634f4d8cca32ff73aaf42b3b76ad1d2f63b490a809b66483ea5a7"}}
|
|
1556
|
+
|
|
1557
|
+
```json
|
|
1558
|
+
{
|
|
1559
|
+
"data": {
|
|
1560
|
+
"hintAvailabilityRetrieve": {
|
|
1561
|
+
"__typename": "HintAvailability",
|
|
1562
|
+
"trophies": [
|
|
1563
|
+
{
|
|
1564
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1565
|
+
"helpType": "HINT",
|
|
1566
|
+
"id": "NPWR20188_00::18",
|
|
1567
|
+
"trophyId": "18",
|
|
1568
|
+
"udsObjectId": "GATCHA_SECRET"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
"__typename": "TrophyInfoWithHintAvailable",
|
|
1572
|
+
"helpType": "HINT",
|
|
1573
|
+
"id": "NPWR20188_00::21",
|
|
1574
|
+
"trophyId": "21",
|
|
1575
|
+
"udsObjectId": "PLAZA_SEND_BOT_FLYING"
|
|
1576
|
+
}
|
|
1577
|
+
]
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
```
|
|
1582
|
+
|
|
1583
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
1584
|
+
```powershell
|
|
1585
|
+
Invoke-RestMethod -Uri 'https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetHintAvailability&variables={"npCommId":"NPWR20188_00","trophyIds":["18", "19", "21"]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"71bf26729f2634f4d8cca32ff73aaf42b3b76ad1d2f63b490a809b66483ea5a7"}}' -Headers @{"apollographql-client-name"="PlayStationApp-Android";"content-type"="application/json"} -Authentication Bearer -Token $token | ConvertTo-Json -Depth 5
|
|
1586
|
+
```
|
|
1587
|
+
|
|
1588
|
+
### Retrieve Game Help for a Trophy
|
|
1589
|
+
|
|
1590
|
+
https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetTips
|
|
1591
|
+
|
|
1592
|
+
Requests to this URL will retrieve the Game Help which is available for a specific trophy.
|
|
1593
|
+
|
|
1594
|
+
An array of trophies can be submitted within the `variables` parameter to retrieve multiple at once.
|
|
1595
|
+
|
|
1596
|
+
#### Input Parameters <!-- {docsify-ignore} -->
|
|
1597
|
+
|
|
1598
|
+
| Parameter | Value
|
|
1599
|
+
| --- | ---
|
|
1600
|
+
| operationName | `metGetTips`
|
|
1601
|
+
| variables | `{"npCommId":"NPWR20188_00","trophies":{"trophyId":"18","udsObjectId":"GATCHA_SECRET","helpType":"HINT"}}`
|
|
1602
|
+
| extensions | `{"persistedQuery":{"version":1,"sha256Hash":"93768752a9f4ef69922a543e2209d45020784d8781f57b37a5294e6e206c5630"}}`
|
|
1603
|
+
|
|
1604
|
+
| Property | Parent Parameter | Type | Example Values | Description | Required
|
|
1605
|
+
| --- | --- | --- | --- | --- | ---
|
|
1606
|
+
| npCommId | variables | String | `NPWR20188_00` | Unique ID of the title the trophy belongs to | Yes
|
|
1607
|
+
| trophyId | variables | String | `18` | ID of the trophy | Yes
|
|
1608
|
+
| udsObjectId | variables | String | `GATCHA_SECRET` | ID of the Game Help | Yes
|
|
1609
|
+
| helpType | variables | String | `helpType` | Type of Game Help | Yes
|
|
1610
|
+
|
|
1611
|
+
##### Additional Headers <!-- {docsify-ignore} -->
|
|
1612
|
+
|
|
1613
|
+
Requests to this endpoint must include additional headers in the request.
|
|
1614
|
+
|
|
1615
|
+
| Key | Value |
|
|
1616
|
+
| --- | --- |
|
|
1617
|
+
| apollographql-client-name | PlayStationApp-Android |
|
|
1618
|
+
| content-type | application/json |
|
|
1619
|
+
|
|
1620
|
+
#### Output JSON Response <!-- {docsify-ignore} -->
|
|
1621
|
+
|
|
1622
|
+
A JSON response is returned. The following are returned under the `data` attribute.
|
|
1623
|
+
|
|
1624
|
+
| Attribute | Type | Example Value | Description
|
|
1625
|
+
| --- | --- | --- | ---
|
|
1626
|
+
| tipsRetrieve | [JSON object `Tips`](#game-help-tips-json-objects) |
|
|
1627
|
+
|
|
1628
|
+
#### Tips JSON objects <!-- {docsify-ignore} --> :id=game-help-tips-json-objects
|
|
1629
|
+
|
|
1630
|
+
| Attribute | Type | Example Value | Description
|
|
1631
|
+
| --- | --- | --- | ---
|
|
1632
|
+
| __typename | String | `Tips` |
|
|
1633
|
+
| hasAccess | Boolean | `true` | Returns `false` if authenticating account does not have a PS+ subscription
|
|
1634
|
+
| trophies | Array<br>[JSON object `TrophyTip`](#game-help-trophy-tip-json-objects) | | Contains the requested trophies
|
|
1635
|
+
|
|
1636
|
+
#### TrophyTip JSON objects <!-- {docsify-ignore} --> :id=game-help-trophy-tip-json-objects
|
|
1637
|
+
|
|
1638
|
+
| Attribute | Type | Example Value | Description
|
|
1639
|
+
| --- | --- | --- | ---
|
|
1640
|
+
| __typename | String | `TrophyTip` |
|
|
1641
|
+
| groups | Array<br>[JSON object `TipGroup`](#game-help-tip-group-json-objects) |
|
|
1642
|
+
| id | String | `NPWR20188_00::18` | Combination of the title ID and individual trophy ID
|
|
1643
|
+
| totalGroupCount | Numeric | `1` |
|
|
1644
|
+
| trophyId | String | `18` | ID of the trophy
|
|
1645
|
+
|
|
1646
|
+
#### TipGroup JSON objects <!-- {docsify-ignore} --> :id=game-help-tip-group-json-objects
|
|
1647
|
+
|
|
1648
|
+
| Attribute | Type | Example Value | Description
|
|
1649
|
+
| --- | --- | --- | ---
|
|
1650
|
+
| __typename | String | `TipGroup` |
|
|
1651
|
+
| groupId | Unknown | `null` |
|
|
1652
|
+
| groupName | Unknown | `null` |
|
|
1653
|
+
| tipContents | Array<br>[JSON object `TipContent`](#game-help-tip-content-json-objects) | | Contains the Game Help content<br>Should the help contain multiple steps each is returned as a separate `TipContent` object
|
|
1654
|
+
|
|
1655
|
+
#### TipContent JSON objects <!-- {docsify-ignore} --> :id=game-help-tip-content-json-objects
|
|
1656
|
+
|
|
1657
|
+
| Attribute | Type | Example Value | Description
|
|
1658
|
+
| --- | --- | --- | ---
|
|
1659
|
+
| __typename | String | `TipContent` |
|
|
1660
|
+
| description | String | `The gatcha prize you seek is inside a silver ball, but which one? You just have to keep playing to find out.` |
|
|
1661
|
+
| displayName | String | `Since 1995` |
|
|
1662
|
+
| mediaId | String | `psn534f6d378d6841939cd709202c46a220` |
|
|
1663
|
+
| mediaType | String | `VIDEO` |
|
|
1664
|
+
| mediaUrl | String | `https://gms-ght.playstation-cloud.com/2/417ff4e103ec31d38e559f87ff12e53e131e1d2c/psn534f6d378d6841939cd709202c46a220/private/video/master_playlist.m3u8?token=redacted` |
|
|
1665
|
+
| tipId | String | `NPWR20188_00__GATCHA_SECRET_H1` |
|
|
1666
|
+
|
|
1667
|
+
#### Example URLs and Responses <!-- {docsify-ignore} -->
|
|
1668
|
+
|
|
1669
|
+
**Example 1 - Retrieve the Game Help for trophy 18 in PS5 title ASTRO’s PLAYROOM**
|
|
1670
|
+
|
|
1671
|
+
https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetTips&variables={"npCommId":"NPWR20188_00","trophies":[{"trophyId":"18","udsObjectId":"GATCHA_SECRET","helpType":"HINT"}]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"93768752a9f4ef69922a543e2209d45020784d8781f57b37a5294e6e206c5630"}}
|
|
1672
|
+
|
|
1673
|
+
```json
|
|
1674
|
+
{
|
|
1675
|
+
"data": {
|
|
1676
|
+
"tipsRetrieve": {
|
|
1677
|
+
"__typename": "Tips",
|
|
1678
|
+
"hasAccess": true,
|
|
1679
|
+
"trophies": [
|
|
1680
|
+
{
|
|
1681
|
+
"__typename": "TrophyTip",
|
|
1682
|
+
"groups": [
|
|
1683
|
+
{
|
|
1684
|
+
"__typename": "TipGroup",
|
|
1685
|
+
"groupId": null,
|
|
1686
|
+
"groupName": null,
|
|
1687
|
+
"tipContents": [
|
|
1688
|
+
{
|
|
1689
|
+
"__typename": "TipContent",
|
|
1690
|
+
"description": "The gatcha prize you seek is inside a silver ball, but which one? You just have to keep playing to find out. ",
|
|
1691
|
+
"displayName": "Since 1995",
|
|
1692
|
+
"mediaId": "psn534f6d378d6841939cd709202c46a220",
|
|
1693
|
+
"mediaType": "VIDEO",
|
|
1694
|
+
"mediaUrl": "https://gms-ght.playstation-cloud.com/2/417ff4e103ec31d38e559f87ff12e53e131e1d2c/psn534f6d378d6841939cd709202c46a220/private/video/master_playlist.m3u8?token=redacted",
|
|
1695
|
+
"tipId": "NPWR20188_00__GATCHA_SECRET_H1"
|
|
1696
|
+
}
|
|
1697
|
+
]
|
|
1698
|
+
}
|
|
1699
|
+
],
|
|
1700
|
+
"id": "NPWR20188_00::18",
|
|
1701
|
+
"totalGroupCount": 1,
|
|
1702
|
+
"trophyId": "18"
|
|
1703
|
+
}
|
|
1704
|
+
]
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
```
|
|
1709
|
+
|
|
1710
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
1711
|
+
```powershell
|
|
1712
|
+
Invoke-RestMethod -Uri 'https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetTips&variables={"npCommId":"NPWR20188_00","trophies":[{"trophyId":"18","udsObjectId":"GATCHA_SECRET","helpType":"HINT"}]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"93768752a9f4ef69922a543e2209d45020784d8781f57b37a5294e6e206c5630"}}' -Headers @{"apollographql-client-name"="PlayStationApp-Android";"content-type"="application/json"} -Authentication Bearer -Token $token | ConvertTo-Json -Depth 10
|
|
1713
|
+
```
|
|
1714
|
+
|
|
1715
|
+
**Example 2 - Retrieve the Game Help for a trophy where the help includes multiple steps to complete**
|
|
1716
|
+
|
|
1717
|
+
https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetTips&variables={"npCommId":"NPWR20842_00","trophies":[{"trophyId":"21","udsObjectId":"Weapon_to_Level_5","helpType":"HINT"}]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"93768752a9f4ef69922a543e2209d45020784d8781f57b37a5294e6e206c5630"}}
|
|
1718
|
+
|
|
1719
|
+
```json
|
|
1720
|
+
{
|
|
1721
|
+
"data": {
|
|
1722
|
+
"tipsRetrieve": {
|
|
1723
|
+
"__typename": "Tips",
|
|
1724
|
+
"hasAccess": true,
|
|
1725
|
+
"trophies": [
|
|
1726
|
+
{
|
|
1727
|
+
"__typename": "TrophyTip",
|
|
1728
|
+
"groups": [
|
|
1729
|
+
{
|
|
1730
|
+
"__typename": "TipGroup",
|
|
1731
|
+
"groupId": null,
|
|
1732
|
+
"groupName": null,
|
|
1733
|
+
"tipContents": [
|
|
1734
|
+
{
|
|
1735
|
+
"__typename": "TipContent",
|
|
1736
|
+
"description": "To max out a weapon to level five, you'll want to use it on enemies at every possible opportunity. AoE (Area of Effect) weapons are typically the fastest to level, as they can hit multiple enemies at once, earning you more XP per ammo refill. Make a habit of kiting enemies into groups to get the most out of this strategy. ",
|
|
1737
|
+
"displayName": "HIGH FIVE",
|
|
1738
|
+
"mediaId": "psncbc9ffb8d893459688563506d4a1b78e",
|
|
1739
|
+
"mediaType": "VIDEO",
|
|
1740
|
+
"mediaUrl": "https://gms-ght.playstation-cloud.com/2/b3375403cf98e61102c97ebfba134389300aa653/psncbc9ffb8d893459688563506d4a1b78e/private/video/master_playlist.m3u8?token=redacted",
|
|
1741
|
+
"tipId": "NPWR20842_00__21_Weapon_to_Level_5_h1"
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"__typename": "TipContent",
|
|
1745
|
+
"description": "Always upgrade your weapon with Raritanium as it levels; the increased stats will usually make it gain XP faster. ",
|
|
1746
|
+
"displayName": "INCREASED STATS",
|
|
1747
|
+
"mediaId": "psn7e4553c0088e4cf09101f12d1dcb609b",
|
|
1748
|
+
"mediaType": "VIDEO",
|
|
1749
|
+
"mediaUrl": "https://gms-ght.playstation-cloud.com/3/b3375403cf98e61102c97ebfba134389300aa653/psn7e4553c0088e4cf09101f12d1dcb609b/private/video/master_playlist.m3u8?token=redacted",
|
|
1750
|
+
"tipId": "NPWR20842_00__21_Weapon_to_Level_5_h2"
|
|
1751
|
+
}
|
|
1752
|
+
]
|
|
1753
|
+
}
|
|
1754
|
+
],
|
|
1755
|
+
"id": "NPWR20842_00::21",
|
|
1756
|
+
"totalGroupCount": 1,
|
|
1757
|
+
"trophyId": "21"
|
|
1758
|
+
}
|
|
1759
|
+
]
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
```
|
|
1764
|
+
|
|
1765
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
1766
|
+
```powershell
|
|
1767
|
+
Invoke-RestMethod -Uri 'https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetTips&variables={"npCommId":"NPWR20842_00","trophies":[{"trophyId":"21","udsObjectId":"Weapon_to_Level_5","helpType":"HINT"}]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"93768752a9f4ef69922a543e2209d45020784d8781f57b37a5294e6e206c5630"}}' -Headers @{"apollographql-client-name"="PlayStationApp-Android";"content-type"="application/json"} -Authentication Bearer -Token $token | ConvertTo-Json -Depth 10
|
|
1768
|
+
```
|
|
1769
|
+
|
|
1770
|
+
**Example 3 - Retrieve the Game Help for trophy 18 and 45 in PS5 title ASTRO’s PLAYROOM**
|
|
1771
|
+
|
|
1772
|
+
https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetTips&variables={"npCommId":"NPWR20188_00","trophies":[{"trophyId":"18","udsObjectId":"GATCHA_SECRET","helpType":"HINT"}, {"trophyId":"45","udsObjectId":"DAY1__GRAVITY_DAZE","helpType":"HINT"}]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"93768752a9f4ef69922a543e2209d45020784d8781f57b37a5294e6e206c5630"}}
|
|
1773
|
+
|
|
1774
|
+
```json
|
|
1775
|
+
{
|
|
1776
|
+
"data": {
|
|
1777
|
+
"tipsRetrieve": {
|
|
1778
|
+
"__typename": "Tips",
|
|
1779
|
+
"hasAccess": true,
|
|
1780
|
+
"trophies": [
|
|
1781
|
+
{
|
|
1782
|
+
"__typename": "TrophyTip",
|
|
1783
|
+
"groups": [
|
|
1784
|
+
{
|
|
1785
|
+
"__typename": "TipGroup",
|
|
1786
|
+
"groupId": null,
|
|
1787
|
+
"groupName": null,
|
|
1788
|
+
"tipContents": [
|
|
1789
|
+
{
|
|
1790
|
+
"__typename": "TipContent",
|
|
1791
|
+
"description": "In CPU Plaza, punch ten bots to get them to follow you. Lead the bot group to the glass dome in the center of CPU Plaza and punch the glass to tease the CPU Chip.",
|
|
1792
|
+
"displayName": "You Kat get me",
|
|
1793
|
+
"mediaId": "psnea251771293d407fa81bf0fc7fb0e2da",
|
|
1794
|
+
"mediaType": "VIDEO",
|
|
1795
|
+
"mediaUrl": "https://gms-ght.playstation-cloud.com/2/417ff4e103ec31d38e559f87ff12e53e131e1d2c/psnea251771293d407fa81bf0fc7fb0e2da/private/video/master_playlist.m3u8?token=redacted",
|
|
1796
|
+
"tipId": "NPWR20188_00__DAY1__GRAVITY_DAZE_H1"
|
|
1797
|
+
}
|
|
1798
|
+
]
|
|
1799
|
+
}
|
|
1800
|
+
],
|
|
1801
|
+
"id": "NPWR20188_00::45",
|
|
1802
|
+
"totalGroupCount": 1,
|
|
1803
|
+
"trophyId": "45"
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
"__typename": "TrophyTip",
|
|
1807
|
+
"groups": [
|
|
1808
|
+
{
|
|
1809
|
+
"__typename": "TipGroup",
|
|
1810
|
+
"groupId": null,
|
|
1811
|
+
"groupName": null,
|
|
1812
|
+
"tipContents": [
|
|
1813
|
+
{
|
|
1814
|
+
"__typename": "TipContent",
|
|
1815
|
+
"description": "The gatcha prize you seek is inside a silver ball, but which one? You just have to keep playing to find out. ",
|
|
1816
|
+
"displayName": "Since 1995",
|
|
1817
|
+
"mediaId": "psn534f6d378d6841939cd709202c46a220",
|
|
1818
|
+
"mediaType": "VIDEO",
|
|
1819
|
+
"mediaUrl": "https://gms-ght.playstation-cloud.com/2/417ff4e103ec31d38e559f87ff12e53e131e1d2c/psn534f6d378d6841939cd709202c46a220/private/video/master_playlist.m3u8?token=redacted",
|
|
1820
|
+
"tipId": "NPWR20188_00__GATCHA_SECRET_H1"
|
|
1821
|
+
}
|
|
1822
|
+
]
|
|
1823
|
+
}
|
|
1824
|
+
],
|
|
1825
|
+
"id": "NPWR20188_00::18",
|
|
1826
|
+
"totalGroupCount": 1,
|
|
1827
|
+
"trophyId": "18"
|
|
1828
|
+
}
|
|
1829
|
+
]
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
```
|
|
1834
|
+
|
|
1835
|
+
Executing this example using Powershell - see [Querying the API](#powershell-7)
|
|
1836
|
+
```powershell
|
|
1837
|
+
Invoke-RestMethod -Uri 'https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetTips&variables={"npCommId":"NPWR20188_00","trophies":[{"trophyId":"18","udsObjectId":"GATCHA_SECRET","helpType":"HINT"}, {"trophyId":"45","udsObjectId":"DAY1__GRAVITY_DAZE","helpType":"HINT"}]}&extensions={"persistedQuery":{"version":1,"sha256Hash":"93768752a9f4ef69922a543e2209d45020784d8781f57b37a5294e6e206c5630"}}' -Headers @{"apollographql-client-name"="PlayStationApp-Android";"content-type"="application/json"} -Authentication Bearer -Token $token | ConvertTo-Json -Depth 10
|
|
1838
|
+
```
|
|
1839
|
+
|
|
1840
|
+
# Querying the API
|
|
1841
|
+
|
|
1842
|
+
## Powershell 7
|
|
1843
|
+
|
|
1844
|
+
Powershell includes the [`Invoke-RestMethod`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.1) cmdlet which enables you to to make a request to a URL and process the response - in this case JSON - into a Powershell object.
|
|
1845
|
+
|
|
1846
|
+
First configure the authentication token which you will use. See [obtaining an authentication token](#obtaining-an-authentication-token) for more detail.
|
|
1847
|
+
|
|
1848
|
+
Now make a request to one of the API URLs using `Invoke-RestMethod`. This will output the response to the screen, but you could instead store the response in a variable or pipe it elsewhere for further processing.
|
|
1849
|
+
|
|
1850
|
+
An example to request the authenticating accounts trophy title list and output the original JSON response. A number of other examples are included in the documentation above.
|
|
1851
|
+
|
|
1852
|
+
```powershell
|
|
1853
|
+
Invoke-RestMethod -Uri "https://m.np.playstation.com/api/trophy/v1/users/me/trophyTitles" -Authentication Bearer -Token $token | ConvertTo-Json -Depth 3
|
|
1854
|
+
```
|
|
1855
|
+
## Obtaining an Authentication Token
|
|
1856
|
+
|
|
1857
|
+
1. Open a Powershell session and paste in the following function
|
|
1858
|
+
```powershell
|
|
1859
|
+
function Get-AuthenticationToken {
|
|
1860
|
+
param(
|
|
1861
|
+
[Parameter(Mandatory=$true)]
|
|
1862
|
+
[string]$npsso
|
|
1863
|
+
)
|
|
1864
|
+
|
|
1865
|
+
if ($PSVersionTable.PSVersion.Major -lt 7) {
|
|
1866
|
+
Write-Host "This function requires PowerShell 7. Download it from https://github.com/PowerShell/PowerShell"
|
|
1867
|
+
return
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
$params = @(
|
|
1871
|
+
"access_type=offline",
|
|
1872
|
+
"client_id=09515159-7237-4370-9b40-3806e67c0891",
|
|
1873
|
+
"response_type=code",
|
|
1874
|
+
"scope=psn:mobile.v2.core psn:clientapp",
|
|
1875
|
+
"redirect_uri=com.scee.psxandroid.scecompcall://redirect"
|
|
1876
|
+
)
|
|
1877
|
+
$url = "https://ca.account.sony.com/api/authz/v3/oauth/authorize?$($params -join "&")"
|
|
1878
|
+
|
|
1879
|
+
try {
|
|
1880
|
+
$result = Invoke-WebRequest -Uri $url -Headers @{
|
|
1881
|
+
"Cookie"="npsso=$npsso"
|
|
1882
|
+
}
|
|
1883
|
+
Write-Host "Error: Check npsso"
|
|
1884
|
+
return
|
|
1885
|
+
}
|
|
1886
|
+
catch {
|
|
1887
|
+
if ($_.Exception.Response.Headers.Location.Query -like "?code=v3*") {
|
|
1888
|
+
$query = [System.Web.HttpUtility]::ParseQueryString($_.Exception.Response.Headers.Location.Query)
|
|
1889
|
+
}
|
|
1890
|
+
else { Write-Host "Error: Check npsso"; return }
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
$body = @{
|
|
1894
|
+
code=$query['code']
|
|
1895
|
+
redirect_uri="com.scee.psxandroid.scecompcall://redirect"
|
|
1896
|
+
grant_type="authorization_code"
|
|
1897
|
+
token_format="jwt"
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
$contentType = "application/x-www-form-urlencoded"
|
|
1901
|
+
$url = "https://ca.account.sony.com/api/authz/v3/oauth/token"
|
|
1902
|
+
|
|
1903
|
+
try {
|
|
1904
|
+
$result = Invoke-WebRequest -Method POST -Uri $url -body $body -ContentType $ContentType -Headers @{
|
|
1905
|
+
"Authorization"="Basic MDk1MTUxNTktNzIzNy00MzcwLTliNDAtMzgwNmU2N2MwODkxOnVjUGprYTV0bnRCMktxc1A="
|
|
1906
|
+
}
|
|
1907
|
+
$token = ConvertTo-SecureString ($result.Content | ConvertFrom-Json).access_token -AsPlainText
|
|
1908
|
+
if ($token) {
|
|
1909
|
+
Write-Host "Authentication Token successfully granted"
|
|
1910
|
+
return $token
|
|
1911
|
+
}
|
|
1912
|
+
else { Write-Host "Error: Unable to obtain Authentication Token" }
|
|
1913
|
+
}
|
|
1914
|
+
catch { Write-Host "Error: Unable to obtain Authentication Token" }
|
|
1915
|
+
}
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
2. In your web browser access https://store.playstation.com and log in with a PSN account.
|
|
1919
|
+
3. In the same browser access https://ca.account.sony.com/api/v1/ssocookie<br>You should see a response with `npsso` followed by a string of letters and numbers. Highlight and copy this.
|
|
1920
|
+

|
|
1921
|
+
4. In the Powershell session run the following command, substituting in your npsso token copied in the previous step
|
|
1922
|
+
```powershell
|
|
1923
|
+
$token = Get-AuthenticationToken -npsso "Hwl9Vq%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
|
1924
|
+
```
|
|
1925
|
+

|
|
1926
|
+
|
|
1927
|
+
The `$token` variable is now ready to be used in combination with `Invoke-RestMethod` to authenticate your requests to the API.
|
|
1928
|
+
|
|
1929
|
+
This will be valid for ~60 minutes after which you will need to repeat these steps to obtain an updated token.
|
|
1930
|
+
|
|
1931
|
+
## API Rate Limit
|
|
1932
|
+
|
|
1933
|
+
!> This information requires confirmation and may be inaccurate for this revision of the API
|
|
1934
|
+
|
|
1935
|
+
The API has a rate limit which under testing appears to be 300 requests during a 15 minute period.
|
|
1936
|
+
|
|
1937
|
+
Once the limit has been reached the API will begin responding with status code 429. The header of this response will contain `X-RateLimit-Next-Available` the value of which is a unix timestamp for when you will next be able to make requests to the API.
|