获取LinkedIn访问令牌报错求助:缺少client_id参数
Hey there! Let's work through this frustrating auth error you're hitting—getting a invalid_request because of a missing client_id even though you already have one is such a common gotcha, but we can sort it out.
Here are the most likely fixes to check step by step:
Make sure you're sending parameters as form-encoded data
LinkedIn's OAuth 2.0 endpoints require parameters to be sent inx-www-form-urlencodedformat, not JSON. In Postman:- Go to the Body tab of your request
- Select the x-www-form-urlencoded option
- Add your
client_id,client_secret, and other required parameters (likegrant_type) as key-value pairs here.
Sending these in a JSON body is a super common mistake that triggers this exact error.
Double-check parameter spelling and case
Confirm you're usingclient_id(with an underscore, not a hyphen likeclient-id)—LinkedIn's API is case-sensitive, so even a tiny typo will break the request. Also make sure you haven't accidentally added extra spaces when copying the ID from the developer portal.Verify the request is actually sending the parameter
Use Postman's built-in Console (click the icon in the bottom-left corner) to inspect the full request being sent. Look for theForm Datasection to confirmclient_idis present with the correct value. Sometimes Postman doesn't save parameter changes, so this is a quick way to validate.Confirm your app details are correct
Head back to the LinkedIn Developer Portal and double-check:- You're using the
client_idfrom the correct app (if you have multiple) - Your app is in an active state (even test apps should work for basic token requests)
- You didn't mix up
client_idandclient_secret(easy to do when copying!)
- You're using the
Test with a minimal request
Strip down your request to only the essentials to rule out other issues. For example, if using the Client Credentials flow:- Request URL:
https://www.linkedin.com/oauth/v2/accessToken - Method: POST
- Form-encoded body:
grant_type=client_credentialsclient_id=YOUR_ACTUAL_CLIENT_IDclient_secret=YOUR_ACTUAL_CLIENT_SECRET
If this works, the problem was likely extra parameters or incorrect flow setup in your original request.
- Request URL:
Once you get the access token working, you should be good to go with calling LinkedIn's REST APIs from other tools—just make sure to include the token in the Authorization header as Bearer YOUR_ACCESS_TOKEN.
内容的提问来源于stack exchange,提问作者Ali

