1

I'm working with LinkedIn's new Community Management API and I'm encountering error when trying to retrieve organization's data.

I'm using the following API request:

curl --location 'https://api.linkedin.com/rest/organizations/MY_ORG_ID' \
--header 'LinkedIn-Version: 202306' \
--header 'X-Restli-Protocol-Version: 2.0.0' \
--header 'Authorization: Bearer MY_TOKEN'

I expect to receive organization's details but I get:

{
    "status": 403,
    "serviceErrorCode": 100,
    "code": "ACCESS_DENIED",
    "message": "Not enough permissions to access: organizations.GET.20230601"
}

According to LinkedIn's Community Management API Migration guide this may happen for BATCH_GET requests as they are limited in the Development Tier.

I would not expect it to happen in my case, though, because I'm requesting a single organization and according to LI's documentation it's a "GET" request vs "BATCH_GET".

Some facts and prior checks

  1. I do have access to Community Management API (Developer Tier)
  2. I have set my backend correctly with necessary scope (rw_organization_admin)
  3. I have reset the access token, I have reset granted permissions, etc - I'm 100% sure there is nothing wrong with the access token
  4. I have not exceeded my daily request limits
  5. I have tried calling the deprecated v2 API and it successfully retrieves the organization's details (https://api.linkedin.com/v2/organizations/MY_ORG_ID) - I cannot rely on this solution though because it will be sunset soon.

Have anyone encoutered this issue and can share a solution?

Can #linkedin team help?

4
  • I'm running into the exact same problem. All worked fine on the v2 API, but it fails on the versioned API. No permissions have changed. The clock is ticking for the v2 API is being deactivated. Need help from #linkedin quickly! Commented Jun 28, 2023 at 9:34
  • I eventually got it working. I'm not entirely sure what did the actual trick, but it seems it had to do with me URI encoding the path string with which I called my get method from my code. When I removed the URI encoding, it worked. Commented Jun 29, 2023 at 7:07
  • Hey @PascalLindelauf, thanks for commenting on my thread. Would you be so kind as to provide a before and after example? Commented Jun 30, 2023 at 9:11
  • I think I might know what's going on here... The LinkedIn API has a caching bug in their auth system. After you request (or use) an access token, it will be cached and used for future requests -- even after you switch to a new token! So, if you create a new access token with different scopes, the API will still use the old permissions (from the old token) for up to 5 minutes. In short: wait 5+ minutes and try that curl command again. Then let me know how it goes, and I'll update my answer to warn others about the caching. Commented Aug 18, 2023 at 17:42

1 Answer 1

0

Wait 5 Minutes and Try Again

Everything you are doing looks good, and I don't get any permission errors. You might have been a victim of a bug in the LinkedIn API auth...

After changing permissions/scopes, you must wait at least 5 minutes before testing. Otherwise, your API requests (with the new access token) might actually use an old access token (and the old permissions).

Scenario where the auth uses an old access token

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.