You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Corresponding to my research how PSN works you need npsso to interact with Sony servers.
@@ -44,10 +44,11 @@ Copy this js code:
44
44
- After the login flow is completed, you should see a new log in the developer console that looks like: found npsso <64 character code>. Copy that 64 character code.
45
45
</details>
46
46
47
-
### Functions at this moment
47
+
### Functionality
48
48
- You can get user profile info
49
49
- You can get trophy titles
50
50
- You can get trophy groups
51
+
- You can get trophies
51
52
52
53
### Example
53
54
```go
@@ -60,9 +61,9 @@ import (
60
61
61
62
funcmain() {
62
63
ctx:= context.Background()
63
-
lang:="ru"// known list here https://github.com/sizovilya/go-psn-api/blob/main/langs.go, some languages in list are wrong and unsupported now, feel free to investigate for your own
64
-
region:="ru"// known list here https://github.com/sizovilya/go-psn-api/blob/main/regions.go, some regions in list are wrong and unsupported now, feel free to investigate for your own
65
-
npsso:="your npsso"
64
+
lang:="ru"// known list here https://github.com/sizovilya/go-psn-api/blob/main/langs.go, some languages in list are wrong and unsupported now, feel free to investigate for your own and add it to list
65
+
region:="ru"// known list here https://github.com/sizovilya/go-psn-api/blob/main/regions.go, some regions in list are wrong and unsupported now, feel free to investigate for your own and add it to list
66
+
npsso:="<your npsso>"
66
67
psnApi, err:= psn.NewPsnApi(
67
68
lang,
68
69
region,
@@ -71,7 +72,7 @@ func main() {
71
72
panic(err)
72
73
}
73
74
74
-
// This request will get access token and refresh token from Sony's servers
75
+
// This request will get access and refresh tokens from Sony's servers
75
76
err = psnApi.AuthWithNPSSO(ctx, npsso)
76
77
if err != nil {
77
78
panic(err)
@@ -80,7 +81,7 @@ func main() {
80
81
// If you obtain refresh token you may use it for next logins.
81
82
// Next logins should be like this:
82
83
// refreshToken, _ := psnApi.GetRefreshToken() // store refresh token somewhere for future logins by psnApi.AuthWithRefreshToken method
83
-
err = psnApi.AuthWithRefreshToken(ctx, "your token") // get new access token
84
+
err = psnApi.AuthWithRefreshToken(ctx, "<your token>") //will get new access token, feel free to manage tokens by yourself
84
85
if err != nil {
85
86
panic(err)
86
87
}
@@ -106,6 +107,18 @@ func main() {
106
107
panic(err)
107
108
}
108
109
fmt.Println(trophyGroups)
110
+
111
+
// How to get trophies in certain trophy title and trophy group
0 commit comments