andshrew / PlayStation-Trophies

Sony has an API for retrieving details of the trophies an account has earned, but there is no public documentation for using it. This is an attempt at documenting the API by capturing the requests made by the https://my.playstation.com web site.
MIT License
100 stars 4 forks source link

Is postman compatible with this api? #16

Closed darias08 closed 1 year ago

darias08 commented 1 year ago

Hello,

I am trying to use Postman from Playstation-trophies api, but I am getting an error message saying:

{ "error": { "referenceId": "e435efb4-70fd-11ed-99c3-01c61dc733aa", "code": 2241025, "message": "Invalid token" } }

Here's a screenshot of what I am setting up with, but let me know if postman is compatible with this api. Thank you!(:

psn

rafaelfgyn commented 1 year ago

Hello darias08.

You're passing the wrong way. Go in authorization tab and choose type "Bearer token" then passa the ONLY the token in the input without double quotes.

Good luck!

darias08 commented 1 year ago

Hello!

So I did place the type as Bearer Token under "Authorization" tab and I placed the token as myNpsso id #, but it's still giving me the same type of error message saying, "Invalid token".

darias08 commented 1 year ago

Also quick question, is it possible I can pull the game cover url of a title from this api?

rafaelfgyn commented 1 year ago

oh no man, I didn't notice that you're passing your npsso key. You shouldn't. you use the npsso to generate a valid token THEN put in the authorization tab

Answering your last question, yes! it's possible.

you can have a better idea of what is possible accessing this page made by myself. psntrophies.com.br

darias08 commented 1 year ago

Hi,

So how exactly do I generate a token from using my npsso?

Because I am reading through this post from

https://andshrew.github.io/PlayStation-Trophies/#/APIv2?id=obtaining-an-authentication-token

to get the Auth token, but that just uses myNppso to grant access. It doesn't generate a token for me. So how can I get this token?

rafaelfgyn commented 1 year ago

about that code, Instead of Write-Host "Authentication Token successfully granted" try "Write-Host $token" to see the content of that variable.

darias08 commented 1 year ago

So I replaced "Authentication Token successfully granted" to Write-Host $token" but it gives me an output of

Write-Host System.Security.SecureString Did I replace it correctly?

psn2

rafaelfgyn commented 1 year ago

sorry that was my mistake

this whole line should be => Write-Host $result dont need to write Write-Host twice and no need of double quotes too

darias08 commented 1 year ago

Okay I got it! Thank you! :D

darias08 commented 1 year ago

Okay, but back to the getting the game image question. So you said I would have to use this link: psntrophies.com.br to find what is the endpoint for a game cover image id, right?

darias08 commented 1 year ago

Because under the api the only image I can see to call is the icon which isn't the game cover.

PSNAPI

rafaelfgyn commented 1 year ago

Okay, but back to the getting the game image question. So you said I would have to use this link: psntrophies.com.br to find what is the endpoint for a game cover image id, right?

No, this site is only for you to have a idea of what is possible because it uses many of the resources available

darias08 commented 1 year ago

Is there a github repo for that site? Just so I can see how the code is designed.

rafaelfgyn commented 1 year ago

just to be sure we're talking about the same thing, what do you mean by "game cover"?

darias08 commented 1 year ago

Like this is what I am talking about.

https://psntrophies.com.br:4000/Games/NPWR22392_00/cover.png

darias08 commented 1 year ago

Like I want to know how can I extract that from a psn account with games the user has. I want to know how can I get that cover image for a game.

rafaelfgyn commented 1 year ago

Because under the api the only image I can see to call is the icon which isn't the game cover.

PSNAPI

if I"m not mistaken this "trophyTitleIconUrl" should give you the cover, is It not?

darias08 commented 1 year ago

Yeah, but that's just the title of the game not really a cover art. Is there any possibility I can get the cover art instead? Like the one I showed you the link.

darias08 commented 1 year ago

I guess what I am saying is the box art cover if there is one.

rafaelfgyn commented 1 year ago

ah ok got it. you can't have cover arts in this api as far as I can tell.

darias08 commented 1 year ago

Oh, bummer. Well anyway I guess I will close this issue since I got everything else resolved. Thank you for helping me with this api! :D