无法从LinkedIn REST Api v2获取邮箱地址 求技术协助
Hey there, let’s work through this permission issue step by step—this is a common gotcha with LinkedIn’s v2 API, so I’ve got a few concrete fixes for you:
Double-check your requested permissions: While you mentioned having
r_basicprofileandr_emailaddress, note thatr_basicprofileis a v1 API permission. For LinkedIn’s v2 Primary Contact API (the one you’re using to fetch emails), you should requestr_liteprofile(the v2 equivalent of basic profile access) alongsider_emailaddress. Make sure your OAuth flow explicitly asks for both scopes when generating the access token.Verify the API endpoint and request format: Ensure you’re calling the correct v2 endpoint with the right parameters. The valid request for fetching email should look like this:
GET https://api.linkedin.com/v2/clientAwareMemberHandles?q=members&memberId=meDon’t forget to include the
Authorization: Bearer {your_access_token}header in your request—missing or invalid tokens can sometimes masquerade as permission errors.Check your app’s permission approval status: Even if you selected
r_emailaddressin your app settings, LinkedIn requires manual approval for certain permissions (especially if your app is still in development mode). Head to your LinkedIn Developer Dashboard, navigate to your app’s "Products" tab, and confirm that the "Sign In with LinkedIn" product (which includesr_emailaddress) is enabled and approved. If it’s pending, you’ll need to complete the app review process to unlock full access.Regenerate your access token: Sometimes tokens don’t properly include all requested scopes, especially if you updated permissions after the initial token was generated. Go through the OAuth authorization flow again, making sure to explicitly prompt the user for
r_liteprofileandr_emailaddress, then use the new token to test the API call.Rule out user privacy settings: In rare cases, a user’s email might be set to private in their LinkedIn account. While this usually returns an empty result instead of a 403, it’s worth checking if you can reproduce the issue with a test account where email is set to public.
Just to recap the error you’re seeing:
{ "serviceErrorCode": 100, "message": "Not enough permissions to access: GET-members /clientAwareMemberHandles", "status": 403 }
This almost always points to a mismatch between the scopes in your token and what the API expects, or an unapproved permission in your app settings. Start with rechecking the scopes and app approval status—those are the most likely fixes.
内容的提问来源于stack exchange,提问作者Dhruvi

