psn-php icon indicating copy to clipboard operation
psn-php copied to clipboard

PSN App 20.9.3 - API changes

Open Tustin opened this issue 3 years ago • 0 comments

With the release of the brand new PSN app redesign, it's time to talk API. Not only did they revamp the UI, but they also completely revamped the backend API. While it is much nicer, it seems like some things have changed.

To keep this library consistent with these new changes that Sony have put forward, I'm going to implement these new API routes into the library. The reason being is the old API they used was very inconsistent. Between using different base URLs, to inconsistent error response formats, inconsistent API responses in general -- it was just a mess. Not only that, but with the PS5 coming out soon, that old API might not even support PS5 games, which would be problematic considering it seems like Sony will be introducing trophy progress tracking (amongst other things), which will be nice to have in this library.

What changed?

  • Outside of authentication requests, the API has been streamlined into one single base URL: https://m.np.playstation.net/api/. This just straight up allows me to write cleaner code which is always a good thing 😄.
  • Seemingly consistent API response formats and error responses. This will be much nicer for error handling and naming conventions.
  • PARTY CHAT! This one is cool, but it's very unlikely I'll be able to do much with it in a PHP library. I do have some neat ideas I will be exploring outside of this library though 😉.
  • JWT is now used for the access token (but not for refresh tokens...). Weird change but I'm sure Sony has a reason for it.
  • Probably more things I'll eventually figure out...

Be sure to watch this repo as I make changes over the next while. I have no clue how long it'll take to update everything but I'll try to track progress either in this issue or in the project.

Tustin avatar Oct 29 '20 17:10 Tustin