LinkedIn ugcPosts 统计

LinkedIn ugcPosts 统计

是否可以检索类似于组织共享统计 API 的 ugc 帖子分析

GET https://api.linkedin.com/v2/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity={organization URN}

我有这个ugcPost:urn:li:ugcPost:6588481880721633280

尝试使用 ugc id 访问统计数据但维护共享 urn:

14:21:17.487 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "{"message":"Unable to get activityIds from any of the given shares. Either the shares/ugcPosts do not have corresponding activities or the organizational entity did not post them.","status":404}"
14:21:17.487 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Close connection
14:21:17.488 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded
14:21:17.489 [main] DEBUG com.codahale.metrics.httpclient.InstrumentedHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://api.linkedin.com:443][total kept alive: 0; route allocated: 0 of 1024; total allocated: 0 of 1024]

url: https://api.linkedin.com/v2/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:10874981&shares[0]=urn:li:share:6588481880721633280&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start=1570216877135, detailMessage: 404 Not Found headers: [.....], responseBody: {"message":"Unable to get activityIds from any of the given shares. Either the shares/ugcPosts do not have corresponding activities or the organizational entity did not post them.","status":404}, responseStatusLine: Not Found, responseCode: 404

    at com.lithium.bandolier.retrofit.LithiumErrorHandler.handleError(LithiumErrorHandler.java:35)

上述结果表明该 api 实际上可能支持 ugcPosts,因为错误消息包含“share/ugcPosts”,因此接下来尝试使用 ugcPost urn:

14:16:03.295 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "{"message":"Array parameter 'shares' value 'urn:li:ugcPost:6588481880721633280' is invalid. Reason: Deserializing output 'urn:li:ugcPost:6588481880721633280' failed","status":400}"
14:16:03.295 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Close connection
14:16:03.296 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded
14:16:03.296 [main] DEBUG com.codahale.metrics.httpclient.InstrumentedHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://api.linkedin.com:443][total kept alive: 0; route allocated: 0 of 1024; total allocated: 0 of 1024]

url: https://api.linkedin.com/v2/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:10874981&shares[0]=urn:li:ugcPost:6588481880721633280&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start=1570216562816, detailMessage: 400 Bad Request headers: [......], responseBody: {"message":"Array parameter 'shares' value 'urn:li:ugcPost:6588481880721633280' is invalid. Reason: Deserializing output 'urn:li:ugcPost:6588481880721633280' failed","status":400}, responseStatusLine: Bad Request, responseCode: 400

    at com.lithium.bandolier.retrofit.LithiumErrorHandler.handleError(LithiumErrorHandler.java:35)

如能提供关于如何获取类似于 ugcPosts 共享统计数据的基本帖子参与度数据的指导,我们将不胜感激。

答案1

刚刚遇到您的问题(同时面临同样的问题:D)您必须使用查询参数ugcPosts才能使其工作。

curl --location --request GET 'https://api.linkedin.com/v2/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:12XXXXX&ugcPosts=urn:li:ugcPost:661228XXXX'

相关内容