LinkedIn API:检索组织实体统计信息和关注者数据时出现一致的 500 内部服务器错误

问题描述 投票:0回答:1

尝试使用 LinkedIn API 检索组织实体统计信息和关注者时遇到内部服务器错误(HTTP 状态代码 500)。组织 URN 为 12668855。以下是该问题的详细信息:

端点:

  1. https://api.linkedin.com/rest/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=%7Borganization_URN%7D
  2. https://api.linkedin.com/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=%7Borganization_URN%7D

错误响应:

{ "message": "内部服务器错误", “状态”:500 }

预期结果: 我希望收到指定组织实体的有效统计数据和关注者数据

附加信息: 我已经联系了 LinkedIn 支持人员,他们建议将此问题发布到 Stack Overflow 上以获得进一步帮助。

我正在使用的Python代码:

import os

import requests

from dotenv import load_dotenv

load_dotenv()

ACCESS_TOKEN = os.getenv('ACCESS_TOKEN')

ORGANIZATION_ID = os.getenv('ORGANIZATION_ID')

headers = {
    'Authorization': f'Bearer {ACCESS_TOKEN}',
    'LinkedIn-Version': '202405',
    'X-Restli-Protocol-Version':'2.0.0'
}

url_1 = f'https://api.linkedin.com/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity={ORGANIZATION_ID}'

url_2 =f"https://api.linkedin.com/rest/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity={ORGANIZATION_ID}"

shares_response = requests.get(url=url_1, headers=headers)

shares_data = shares_response.json()

print(shares_data)

followers_response = requests.get(url=url_2,headers=headers)

follwers_data = followers_response.json()

print(follwers_data)


**Output I am getting :**

{'message': 'Internal Server Error', 'status': 500}

{'message': 'Internal Server Error', 'status': 500}

预期结果:

 Expected to receive valid statistical data and followers data for the specified organizational entity

API 参考文档:

https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/follower-statistics?view=li-lms-2024-05&tabs=http

python linkedin-api internal-server-error http-status-code-500
1个回答
-3
投票

我也有同样的问题。不幸的是,我还没有找到解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.