Retrieve detailed trophy information

Topics: Ideas
Sep 10, 2010 at 4:40 AM

So far the service is retrieving profile and games played information perfectly.

Looks like it's only missing a way to retrieve the detailed trophy information for each game.  The codes I've found points at using some URL like the following to get this information:

http://us.playstation.com/playstation/psn/profile/SOME_PSN_ID/get_ordered_title_details_data

However, it seems that SONY changed something on the US site and that URL no longer works.  It only returns the following response:

<TrophyResponse status="1"/>

There must be a way to still retrieve the information because Trofeos still gets the information OK.

Have you found some way to retrieve that missing information?

If I find anything I'll keep posting and if I find a working code I'll post it as well.  It would be awesome if Trofeos could give us a little pointer about this.

Sep 10, 2010 at 5:33 PM

I believe the only way to do that now is to login and use a sessionId cookie.

But if Trofoes has done it as you say, then there must be a work around?

Sep 10, 2010 at 7:00 PM

Exactly.  You can invoke Trofeos' web service using the following address.

 http://www.psnapi.com.ar/ps3/api/psn.asmx

I tried using my PSN ID and the Castle Crashers game (game ID 618850-Castle-Crashers) and it successfully retrieved the trophies I earned, thus there is some way that that web service is retrieving the information without the session ID or my password.

I'll see if I can make it so the information can be retrieved using the session ID and later try to find the workaround.

Sep 11, 2010 at 5:51 PM

It seems the dev for this project has stopped working on this api, however I am continuing from what he left off and if he comes back I would gladly give him the newer source code, The current api can get the users trophies it is just not splitting it up clearly but it is instead mixed in with our profile.

I'll see if I can re-work it for its own section but current I am getting a System.ArgumentOutOfRangeException error on the string "source" and it seems miguel is to on his test api page.

Sep 12, 2010 at 6:24 PM

Then these are good news man.

Would you mind sharing the code?  I know both VB.NET and C# and might be able to check out that exception you're getting.

So far I was able to get working what the creator had written in C# using VB.NET (because the laptop I have only has VB.NET installed :( ) and it's working great so far.  So I'm only missing getting the trophies for each game.

Let me know if I can help you out in any way.

Sep 12, 2010 at 6:57 PM

I think it would be easier to just use the code your using seeing as I couldn't make any progress fixing the bugs, I know how to move it to its own section, could you possibly upload yours for me as the original code is bringing up the errors.

Sep 13, 2010 at 2:01 PM

No prob.  I'll try to upload it tonight around 8PM EST.

It'll be in VB.NET.  If you want it in C# let me know to make the transalation to C#.

Do you by any chance for the address to be used in order to retrieve the info of the trophies earned for each game?  I'm still looking and the only thing that comes up is the requirement to login and using the session ID for retrieval.

Sep 13, 2010 at 4:45 PM
Edited Sep 13, 2010 at 4:53 PM

Thanks very much, and I will continue working in VB as it would help us to work together, and I will see if I can find that URL.

And I'm guessing the bug is due to the code being in C# as the test api linked to this project gets the same errors now.

EDIT: http://us.playstation.com/publictrophy/index.htm?onlinename=string this could be the site, replace the string with your PSN-ID.

:)

Sep 13, 2010 at 6:14 PM
Edited Sep 13, 2010 at 6:16 PM

Okay that link above was a start, the only way to view trophies is with a sessionID cookie (As I thought), But you can view anyone's trophies while logged in, so I believe the workaround he did was use his PSN id or make a new login dedicated to his api, to sign in or stay signed in and then retrieve the person's trophies.

Could that be a possible solution?

It wouldn't be that hard to add to the original API we are using can already do the parsing, this bit would just be like copy and paste and change the DIV tags involved.

Sep 13, 2010 at 6:26 PM

My current implementation is not exposing the API as a web service.  However, making a web service from the code I've got should be very easy.

If the session ID is required and you can see anyone's profile with your own log-in, then it sounds like an option using our own IDs in order to retrieve anyone's information.

The trick would be either to obtain a non-expiring session ID or programatically making the log-in.  The first option is unlikey, because the session ID will most likely be destroyed by the server due to inactivity or any other reason.

The second option sounds more likely.  However, it's still tricky because we would need to log-in programatically, thus requiring us to post the command to the log-in page and retrieve the cookie and session ID.

I remember seeing a page where you can log-in, but I misplaced the address.  I'll try to find it.  If you already got it, please post it.

I've never posted a command to a page using the WebRequest objects exposed in .NET.  Do you have some experience in any language posting these kind of commands?

Sep 13, 2010 at 6:37 PM

OK, I think I got it.

https://store.playstation.com/external/index.vm?returnURL=yoursite

That link will send you to an official SONY log in page.  It should return a session ID.  I'll try to check this out after I post my current code.

Sep 13, 2010 at 8:47 PM

OK thanks if I have problems with changing it to a web-service could you point me in the right direction?

And with the WebRequest, I have done similar functions in Java and Android Java but not in VB.

I believe using the external login would be the only way and as the data retrieval would be one time, for each data call all it needs to do is re-log in to retrieve.

Seems plausable, but not efficient.

Sep 13, 2010 at 11:53 PM

I don't see an option to upload the current code I've got.  Do you have somewhere some repository or e-mail where I can send my current project?

Also, I found an Android app which retrieves PSN friends information.  The developer posted the code he used.  It shows that it can be possible to programatically obtain the session ID and use it to retrieve information.  It also shows that once you get the session ID, it is required to make an extra request to another address in order to obtain the necessary cookies so the rest of the requests are successful.

This is the address to the Android app.

http://code.google.com/p/psnfriends/

I'll be busy until Wednesday, so I won't be able to put much time into the project until Thursday.  Maybe you can find some way to implement that code using .NET until then.  I'll keep checking out this discussion if you need any help I can provide.

Let me know how it goes.

Sep 15, 2010 at 8:12 PM

Im sorry but I can't make no movements on the development for now, as I am going Tokyo and I wont be back for a week. (Sorry)

I have looked into that app, it is very poorly designed in how it gets the data and not much documentation is about for it, the developer hasn't updated it in a while, and now it doesn't connect to PSN so it is redeemed useless. :(

But once I am back, We will be able to share ideas.

Bye,

Brad :)

Coordinator
Sep 21, 2010 at 3:26 PM

Hi,

I'm the developer of this project.

Sorry for the time away but now i'm back.

I don't have too much time to spend on the API but i'll try my best to get this going.

 

Sep 22, 2010 at 4:20 PM

Hi, Im the developer of "Trofeos" now at www.psnapi.com.ar

For getting trophy information you need to be logged in with any account.

Problem is, you can't get Hidden Trophies. So the list of trophies returned can (and will) change between users.

You can use https://store.playstation.com/external/index.vm?returnURL=yoursite  to get a sessionId, and use that (and a bunch of cookies) to browse the site as you were logued in.

Another problem is SONY is changing his server code from time to time, adding new cookies, changing some names or adding a new step in the login process.

 

Nicolas

Coordinator
Sep 22, 2010 at 9:33 PM

Hi Nicolas,

Thanks a lot for your help. your API is fantastic. It inspired me to create my own API.

Again Thanks a lot.

Miguel

Oct 7, 2010 at 4:53 PM
benexus wrote:

Hi, Im the developer of "Trofeos" now at www.psnapi.com.ar

For getting trophy information you need to be logged in with any account.

Problem is, you can't get Hidden Trophies. So the list of trophies returned can (and will) change between users.

You can use https://store.playstation.com/external/index.vm?returnURL=yoursite  to get a sessionId, and use that (and a bunch of cookies) to browse the site as you were logued in.

Another problem is SONY is changing his server code from time to time, adding new cookies, changing some names or adding a new step in the login process.

 

Nicolas

Hi benexus,

I was using your API, which is awesome by the way, but since some time ago it started to throw a forbidden error when invoking it from VB.NET. That's why I'm trying to make my own API.  This project is good because we can make an open source API.  That way anyone can host the source and not worrying about an external service going offline for whatever reason.

If you can give us some pointers to retrieve the cookies, much appreciated.

 

@jmtvms

Goo to have you back man.  I had to translate your code to VB.NET because the computer I'm working on didn't have C# installed.  A couple of weeks back I got it installed, so I'll translate everything back to C# and start working from there on the new stuff.

Dec 29, 2010 at 8:37 AM

Any Update on this Topic?

Coordinator
Dec 30, 2010 at 3:47 PM
Littlelink wrote:

Any Update on this Topic?

Hi Littlelink,

For now i´m not thinking in adding the support to trophy details.

This web service is developed as i need it for my facebook application.

There are no plans for now to add this feature.

You can get all the information you need using http://www.psnapi.com.ar/ from our friend benexus.

HTH...

João Miguel.

Mar 5, 2011 at 4:37 PM

hi Guys, this is such an awesome Idea :)

I have developed a widget for blogEngine that takes advantage of your service.

Check the widget here..

http://albertoncaffeine.net/

 

Mar 19, 2011 at 10:17 PM
Edited Mar 20, 2011 at 8:28 PM

I just built an interface using API at www.psnapi.com.ar to get number of games, trophies, and a list of platinum games for a user. 

 

Mar 2, 2012 at 10:49 AM

Using this API, is there a method to check the status of the PSN network, per region?

Or would a call that fails, assume that the PSN is down?

Coordinator
Jul 11, 2012 at 6:19 PM
Edited Jul 11, 2012 at 6:35 PM

Hi folks,

I was apsent for a long time bug i'm back and so the api development.

In the next version we plan to implement this idea and there's already a task for this.
http://psnapi.codeplex.com/workitem/32924

Dec 28, 2012 at 1:23 AM

Is this project effectively dead?

I recently discovered psnapi.com.ar, but over the holiday it fell apart, taking down my plans for a purely personal website.

(The start is over at http://jamesrskemp.com/Projects/VideoGameProfile )

If the project isn't dead, what can I do to help?