How should HTTP 202 Accepted response be handled? (groups posting API)

13 posts / 0 new
Last post
Will Redd's picture
Joined: 09/26/2011
Mon, 02/13/2012 - 16:03
How should HTTP 202 Accepted response be handled? (groups posting API)

In the groups posting API (http://api.linkedin.com/v1/groups/{group-id}/posts), creating a new post usually returns a 201 Created HTTP response. But sometimes (about 25% of the time in my experience) the API returns a 202 Accepted HTTP response. When 202 is returned, the Location HTTP response header is omitted, which makes it so that I don't know how to refer to the post, which means that I am unable to make subsequent updates to it (e.g. move it to the Jobs section or delete it).

What is the recommended way to deal with this situation?

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Tue, 02/14/2012 - 13:26

Hi Will,

I think this might be a bug, but I will need to investigate more to find out. I'll let you know as soon as I have more information.

-Jeremy

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Tue, 02/14/2012 - 14:03

Hi Will,

By chance do you know if it's a moderated group that you are posting too?

-Jeremy

Will Redd's picture
Joined: 09/26/2011
Wed, 02/15/2012 - 12:32

We post to a variety of groups, many of them moderated. Moderators of groups have complained about our jobs not being moved from discussions to jobs, which is the end result of the 202 messages (since we don't have an ID for the posted content, we can't issue the API request to move the job to the jobs tab). I don't know if all of the 202s are from moderated groups or not.

Will Redd's picture
Joined: 09/26/2011
Wed, 02/15/2012 - 12:41

Jeremy - here are a few group_ids where we see this problem. The 202 vs. 201 does appear to be correlated to the group_id that we're posting to (i.e. for a given group_id, we generally see either all 201 or all 202 response codes).

2881314
42031
42596
39919

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Mon, 02/20/2012 - 01:47

Hi Will,

From my understanding, the 202 response comes from moderated groups. When posting to a moderated group, the post isn't actually "made" until the moderator approves it, hence why a post id isn't returned.

-Jeremy

Hardik Oza's picture
Joined: 12/23/2011
Tue, 02/21/2012 - 12:01

Question: Is it possible to post a job discussion directly from the API?
I am seeing there is some flag in the API to mark it as a Job.
Also, my post has no response and I am also not seeing my message getting posted.
What should that mean?
Thanks.

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Tue, 02/21/2012 - 20:52

Hi Hardik,

Your question is unrelated to this thread generally. Please open new threads rather than pigging backing on slightly related threads. That said, yes, you can mark a post as a job discussion via the API as indicated in the docs, but you can't do it when making the post (hence the topic of discussion here) and have to do it after the post is created (and moderated if applicable).

-Jeremy

Hardik Oza's picture
Joined: 12/23/2011
Tue, 02/21/2012 - 21:34

Thanks Jeremy for the info. I did try to open my threads before but somehow got no answers there .. Anyways, so I have to make a regular post and then get my post, get its ID and then mark it as job, right?

Kirsten Jones's picture
Joined: 06/30/2011
Wed, 02/22/2012 - 08:52

Yes, that's correct.

Hardik Oza's picture
Joined: 12/23/2011
Wed, 02/22/2012 - 10:51

Beautiful! :)

Will Redd's picture
Joined: 09/26/2011
Thu, 02/23/2012 - 12:56

> When posting to a moderated group, the post isn't actually "made" until the moderator approves it, hence why a post id isn't returned.

It sounds like there is no way to post to the Jobs section of a moderated group. The moderator would have to approve the Post into the Discussions section, which they often don't want to do if they think it belongs in the Jobs section. Disappointing.

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Tue, 02/28/2012 - 19:09

Hi Will,

I agree. The issue is that the API wasn't built against this use case (otherwise it wouldn't require the two API calls in the first place and would be possible in a single call). I've forwarded this use case on to the relevant PM though, so hopefully it can be incorporated into a future release. My apologies on not having a better solution at this time.

-Jeremy