我们的应用程序运行正常已经有一段时间了。突然之间,LinkedIn API的/v1/companies
端点上的分页似乎已经中断。
问题的核心似乎在于start
参数无效。 LinkedIn documentation指出“您将需要使用可选的start
和count
参数来浏览整个结果集。”
我们的代码以前可以正常运行,一次可以请求100家公司。但是,我们看到无论使用start
参数,总是返回结果1-100。
其他人是否也在遇到此问题,或者仅仅是我们吗? API有什么变化吗?
详细的日志表明了问题所在:(已编辑简化和敏感数据)
DEBUG -- 1.2.3.4 -- 2018-08-06T20:39:49+00:00 -- OAuth2Client::request(). dump request info: -- a:26:{s:3:"url";s:453:"https://api.linkedin.com/v1/companies?is-company-admin=true&start=0&count=100&format=json&access_token=REDACTED";s:12:"content_type";s:30:"application/json;charset=UTF-8";s:9:"http_code";i:200;s:11:"header_size";i:545;s:12:"request_size";i:1089;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:0;s:14:"redirect_count";i:0;s:10:"total_time";d:0.2361520000000000008011369345695129595696926116943359375;s:15:"namelookup_time";d:1.900000000000000104603825601401467793039046227931976318359375E-5;s:12:"connect_time";d:0.0228149999999999984756637871896600699983537197113037109375;s:16:"pretransfer_time";d:0.0793250000000000066169292267659329809248447418212890625;s:11:"size_upload";d:0;s:13:"size_download";d:7298;s:14:"speed_download";d:30903;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0.23613899999999998779998122699907980859279632568359375;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"2.3.4.5";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:13:"3.4.5.6";s:10:"local_port";i:36442;}
DEBUG -- 1.2.3.4 -- 2018-08-06T20:39:49+00:00 -- OAuth2Client::request(). dump request result: -- s:7298:"{
"_count": 100,
"_start": 0,
"_total": 141,
"values": [
{
"id": 11111,
"name": "Company 1"
},
{
"id": 22222,
"name": "Company 2"
},
(...)
{
"id": 99999,
"name": "Company 100"
}
]
}";
INFO -- 1.2.3.4 -- 2018-08-06T20:39:49+00:00 -- Enter OAuth2Client::request( https://api.linkedin.com/v1/companies?is-company-admin=true&start=100&count=100&format=json )
DEBUG -- 1.2.3.4 -- 2018-08-06T20:39:49+00:00 -- OAuth2Client::request(). dump request params: -- a:1:{s:12:"access_token";s:350:"REDACTED";}
DEBUG -- 1.2.3.4 -- 2018-08-06T20:39:50+00:00 -- OAuth2Client::request(). dump request info: -- a:26:{s:3:"url";s:455:"https://api.linkedin.com/v1/companies?is-company-admin=true&start=100&count=100&format=json&access_token=REDACTED";s:12:"content_type";s:30:"application/json;charset=UTF-8";s:9:"http_code";i:200;s:11:"header_size";i:545;s:12:"request_size";i:1091;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:0;s:14:"redirect_count";i:0;s:10:"total_time";d:0.272065000000000001278976924368180334568023681640625;s:15:"namelookup_time";d:1.800000000000000045601543374740316494353464804589748382568359375E-5;s:12:"connect_time";d:0.02279899999999999982147613764027482829988002777099609375;s:16:"pretransfer_time";d:0.08506299999999999972288833305356092751026153564453125;s:11:"size_upload";d:0;s:13:"size_download";d:7300;s:14:"speed_download";d:26831;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0.271733999999999975560882603531354106962680816650390625;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"2.3.4.5";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:13:"3.4.5.6";s:10:"local_port";i:36450;}
DEBUG -- 1.2.3.4 -- 2018-08-06T20:39:50+00:00 -- OAuth2Client::request(). dump request result: -- s:7300:"{
"_count": 100,
"_start": 100,
"_total": 141,
"values": [
{
"id": 11111,
"name": "Company 1"
},
{
"id": 22222,
"name": "Company 2"
},
(...)
{
"id": 99999,
"name": "Company 100"
}
]
}";