简体   繁体   English

使用Linkedin API时出现400错误的请求

[英]400 bad request when using Linkedin api

From LinkedIn developer forum thread I downloaded this sample: LinkedInAuth.rar.zip, it works. 我从LinkedIn开发人员论坛线程下载了此示例:LinkedInAuth.rar.zip,它可以工作。

When I use: 当我使用时:

string response = _oauth.APIWebRequest(
    "GET",
    "http://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name,counts-by-category))?membership-state=member",
     null);

It returns all groups. 它返回所有组。

But when I use: 但是当我使用时:

string response = _oauth.APIWebRequest(
    "GET",
    "http://api.linkedin.com/v1/groups/{2139884}/posts:(creation-timestamp,title,summary,creator:(first-name,last-name,picture-url,headline),likes,attachment:(image-url,content-domain,content-url,title,summary),relation-to-viewer)?category=discussion&order=recency&modified-since=1302727083000&count=5",
    null);`

It returns the error: 它返回错误:

400 bad request 400错误的要求

I used a groups id hard-coded which exist and return by 1st. 我使用了一组硬编码的组ID,该组ID于1日返回。 I tried to follow the documentation . 我试图按照文档进行操作 Anyone face this problem before or I am missing something. 任何人之前都会遇到此问题,否则我会丢失一些东西。

Double check your server time. 仔细检查您的服务器时间。 I experienced the same the issue before I changed it (the issue started to happen after the summer time change). 在更改之前,我遇到了同样的问题(该问题在夏季时间更改后开始发生)。

You don't need the curly braces around the ID. 您不需要ID周围的花括号。 The curly braces indicate that you're going to put a variable there. 花括号指示您将在其中放置一个变量。 Try: 尝试:

http://api.linkedin.com/v1/groups/{2139884}/posts:(creation-timestamp,title,summary,creator:(first-name,last-name,picture-url,headline),likes,attachment:(image-url,content-domain,content-url,title,summary),relation-to-viewer)?category=discussion&order=recency&modified-since=1302727083000&count=5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM