You need to pass LinkedIn-Version
header as per below example:
# Before
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${req.body.accessToken}`,
},
# Now
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${req.body.accessToken}`,
"LinkedIn-Version": "202401",
},
Go to https://www.linkedin.com/developers/apps/<appid>/products/share-on-linkedin/endpoints
where you need to replace <appid>
with you application id provided by linkedin which should look like 224036728
.
Then you will get Product version:
as per below screenshot which you need to pass while calling api.