Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript LinkedIn API read-only on a specific user

Tags:

I'm trying to get read-only public information from my LinkedIn profile through the javascript API. I currently have this code, which I know is incomplete:

<script>
    function linkedinAuthorized() {
        console.log("Linked in authorized");
    }

    function linkedinLoaded() {
        console.log("Linked in loaded");

        IN.Event.on(IN, "auth", linkedinAuthorized);

        var url = "/people/~?format=json";

        IN.API.Raw()
            .url(url)
            .method("GET")
            .result(function (result) {
                console.log(result);
            })
            .error(function (error) {
                console.log(error);
            });
    }
</script>
<script type="text/javascript" src="//platform.linkedin.com/in.js">
    api_key:   [my key]
    onLoad:    linkedinLoaded
</script>

I am able to load the linked in successfully, but when perform the IN.API.Raw call I get:

enter image description here
which I suspect is because I have not logged into an account with one of those LinkedIn login buttons.

My question is if can I get read-only profile information from a specific user without going through one of those manual authorization processes?

like image 753
Braden Steffaniak Avatar asked Aug 04 '16 17:08

Braden Steffaniak


1 Answers

Might this be linked to this answer ?

My question is if can I get read-only profile information from a specific user without going through one of those manual authorization processes?

The answer is no. LinkedIn use OAuth 2.0, even the tool they provide can't perform the request https://api.linkedin.com/v1/people/~?format=json.

You need to get the user logged-in to perform such actions !

like image 182
Gregoire Avatar answered Sep 24 '22 16:09

Gregoire