Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get the JSON output for the API? #10

Open
fluke opened this issue Sep 17, 2014 · 2 comments
Open

How do I get the JSON output for the API? #10

fluke opened this issue Sep 17, 2014 · 2 comments

Comments

@fluke
Copy link

fluke commented Sep 17, 2014

According to the LinkedIn API:

Indicating you want to use JSON or JSONP

You can retrieve JSON data using the new "format" parameter:

GET
https://api.linkedin.com/v1/people/~:(id)?format=json

You can also tell us you want JSON by sending a HTTP header of x-li-format with a value of json.

x-li-format: json
Now you receive JSON-formatted data from API calls instead of the default format of XML.

There doesn't seem to be anything documented for this. But it seems like it'd be easy to implement.

@fluke
Copy link
Author

fluke commented Sep 17, 2014

Actually it seems that you're requesting json and converting it to a ruby hash. My bad. Is there a way to turn this off it I want to work with the json?

@mordof-work
Copy link

This issue is quite old, but just in case anyone else comes across it:

https://github.com/emorikawa/linkedin-oauth2/blob/master/lib/linked_in/api_resource.rb#L44-L50

I imagine all you'd need to do is overwrite the get method there, and do everything the same expect return just the response.body (without converting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants