curl - LinkedIn API PHP -


i getting weird error when trying authenticate user linkedin api. var_dump() of data shows this:

string(156) "{"error_description":"missing required parameters, includes invalid parameter value, parameter more once. : ssl required","error":"invalid_request"}"  

i not sure why happening can me out on issue.

    $ch = curl_init();      curl_setopt($ch, curlopt_url, "https://www.linkedin.com/uas/oauth2/accesstoken?");     curl_setopt($ch, curlopt_post, 1);     curl_setopt($ch, curlopt_returntransfer, 1);     curl_setopt($ch, curlopt_ssl_verifypeer, false);     curl_setopt($ch, curlopt_httpheader, array(         'content-type: application/x-www-form-urlencoded',     ));     curl_setopt($ch, curlopt_postfields, array(         'grant_type'    => 'authorization_code',         'client_id'     => $account['linkedin']['api_key'],         'client_secret' => $account['linkedin']['api_secret'],         'code'          => $_get['code'],         'redirect_uri'  => get_admin_url() . 'admin.php?page=' . self::$accounts_dashboard_page . '&linkedin=authorization&account=' . urlencode($account['id']),     ));      $response = curl_exec($ch);     curl_close($ch);      var_dump($response); 

i got same error got work changing way of sending parameters. instead of , array sent them typical query_string.

i mean:

curl_setopt($ch, curlopt_postfields,'grant_type=authorization_code&client_id=xxxxxxx&client_secret=zzzzzzz&code=yyyyy&redirect_uri=/path/to/your/redirect/uri') 

i don't know why, worked me...


Comments