LinkedIn:如何使用organizationalEntityShareStatistics端点检索特定份额的统计信息?

时间:2019-04-25 10:25:22

标签: linkedin linkedin-api

LinkedIn的API V2文档在其Organization Share Statistics页上专门解决了这种情况,但是在尝试基于其示例的请求时,我总是遇到错误。

LinkedIn的示例请求:

GET https://api.linkedin.com/v2/organizationalEntityShareStatistics
        ?q=organizationalEntity
        &organizationalEntity=urn:li:organization:2414183
        &shares[0]=urn:li:share:1000000
        &shares[1]=urn:li:share:1000001

我的请求(来自REST客户端):

GET https://api.linkedin.com/v2/organizationalEntityShareStatistics
        ?q=organizationalEntity
        &organizationalEntity=urn%3Ali%3Aorganization%3A(my org id)
        &shares[0]=urn%3Ali%3Ashare%3A(my share id)

响应:

{
    "serviceErrorCode": 100,
    "message": "Unpermitted fields present in PARAMETER: Data Processing Exception while processing fields [/shares[0]]",
    "status": 403
}

我还尝试了对方括号进行URL编码(相同的错误),并从参数中删除了[0](错误“参数共享的无效值类型”)。有谁知道格式化此请求的正确方法?

1 个答案:

答案 0 :(得分:0)

知道了:正确的格式是

const query = {
    text: "SELECT * FROM users WHERE name = $1 AND cred = $2", 
    values: [String(req.body.usr), String(req.body.pword)]
};
client.query(query, function(err, result) {