curl获取Linkedin Access Token时出错

I need to show my company updates from Linkedin so I have created a Linkedin APP. I need to authenticate with OAuth2 in Linkedin with my app, not the user who visit my site.

I'm trying to get the acces token with curl, but I get always this error:

string(153) "{"error_description":"missing required parameters, includes an invalid parameter value, parameter more than once. : client_id","error":"invalid_request"}"

My code is:

$code = isset($_REQUEST['code'])?$_REQUEST['code']:"";                

        $curl_request = curl_init();
        curl_setopt_array($curl_request, array(
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => "https://www.linkedin.com/uas/oauth2/accessToken",
            CURLOPT_POST => 1,
            CURLOPT_HTTPHEADER => array('Content-Type: application/x-www-form-urlencoded'),
            CURLOPT_POSTFIELDS => array(
                grant_type => "authorization_code",
                code => $code,
                redirect_uri => LINKEDIN_CALLBACK_URL,
                client_id => LINKEDIN_API_KEY,
                client_secret =>  LINKEDIN_API_SECRETE_KEY
            )
        ));

        $curl_result = curl_exec($curl_request);

        var_dump($curl_result);

LinkedIn's OAuth 2.0 implementation does not currently support two-legged authentication. You will have to authenticate with a particular member - whether it's the currently active user, or your own account that you authenticate one-time and then silently keep reusing that access token for and renewing it ever 60 days to prevent it from expiring.

That said, your error seems related to the fact that you are not properly formulating the request to get an accessToken from LinkedIn because the client_id parameter is not being recognized. Walk through the OAuth 2.0 documentation to ensure you're formatting your HTTP requests properly throughout the authentication process: https://developer.linkedin.com/docs/oauth2