i am trying to make the post using my linkedin api application, The issue with my app is i am not able to make any post on the group wall...even i am able to make a comment on any post of group but not able to make any new post.
I have given access to third party to make a post but some how i am not able to make a new post on group wall.....
Following is the my code to make a post on group's wals.....it gets executed without any error...can anybody help me out with this?
function setGroupPost($status) {
$status_url = $this->base_url . "v1/groups/676767/posts";
$xml = "<post><title>" . htmlspecialchars($status['title'], ENT_NOQUOTES, "UTF-8") . "</title><summary>".htmlspecialchars($status['description'], ENT_NOQUOTES, "UTF-8")."</summary></post>";
$request = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, "POST", $status_url);
$request->sign_request($this->signature_method, $this->consumer, $this->access_token);
$auth_header = $request->to_header("https://api.linkedin.com");
/*if ($debug) {
echo $auth_header . "\n";
} */
$response = $this->httpRequest($status_url, $auth_header, "POST", $xml);
return $response;
}
I'm curious what the status is on the server response. In any case I'm able to make a post to a group using my python code - here's the trace on the HTTP traffic:
URL:
http://api.linkedin.com/v1/groups/4058745/posts
Request Headers:
user-agent: Python-httplib2/0.7.0 (gzip)
Host: api.linkedin.com
accept-encoding: gzip, deflate
content-type: text/xml
Content-Length: 64
authorization: OAuth realm="http://api.linkedin.com", oauth_body_hash="FWbw5dO9thxZvF2L2gMq8d6CTwM%3D", oauth_nonce="14208603", oauth_timestamp="1326913388", oauth_consumer_key="1iK9RUZ1FLJaLUpp90xztjhJXLkdTooiNqXMAORUrpoWJaR0cozd863qyIwvb0ZJ", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="3df261cb-0532-4015-8618-01b0a41cd45e", oauth_signature="Rwv%2BNdFpJuBzoXWSmyYwIT%2FiiC8%3D"
Request body:
<post><title>Test group post</title><summary> </summary></post>
Thoughts: perhaps your Content-Type is not set correctly (must be text/xml)? Can you check the status on the HTTP Response? Generally if it's not a "201 created" then there was an issue, and the code itself can give you guidance about where it's going awry.