3

I'm having trouble retrieving the whole JSON from Live ID API call.

I'm working thru the OAuth2 flow with Windows Live ID, in order to get profile info (& some related items, like phone numbers and preferred email). I'm using perl & Net::OAuth2.

The OAuth2 portion of this seems to be working fine; I can get an access token. What I want to do now is turn it around and retrieve the profile info that is the point of this authentication/authorization process.

If I just plug the URL back into the browser https://apis.live.net/v5.0/me?access_token=EwA.... I get what I want, looks like JSON:

{
   "id": "dd62296f10db01bf", 
   "name": "Michael Helm", 
 ....

   "locale": "en_US", 
   "updated_time": "2012-05-03T01:02:59+0000"
}

When I use some perl modules to build the url string, make the request, & retrieve ( use LWP::UserAgent; use HTTP::Request::Common; )

what comes back as a result of client->request is what looks like the last part of that JSON above, the part with updated_time, plus some punctuation.

What am I missing? What do I need to do to get the whole object?

This technique worked before (but with a couple OAuth 1 providers). I'm not real familiar with Microsoft & Windows Live ID but the process seemed straightforward until now.

Pere Villega
  • 16,429
  • 5
  • 63
  • 100
  • Are you using the [JSON](http://search.cpan.org/perldoc?JSON) module? – mob May 09 '12 at 20:40
  • Not yet - I would, to parse the data inside, but since it doesn't look like I am getting the whole JSON object yet, I haven't fed the fragment to it. – Michael Helm May 09 '12 at 21:57
  • I took your implied suggestion & tried it - the JSON module can read & parse out the entire content, even if Dumper can't print it. That's a mystery but I don't have a strong interest in solving it - the API & the perl modules are doing what I need them to do. Thanks! – Michael Helm May 10 '12 at 00:18

1 Answers1

0

As said above the JSON module can read & parse out the entire content, even if Dumper can't print it. So there is no problem with OAuth 2 handling or Windows Live APIs.