I downloaded the dquail-LinkedinOauth-f169b1f from
https://github.com/dquail/LinkedinOauth
I got it working. Problem is – this code uses the old current-status api which is deprecated and limited to 140 characters
https://developer.linkedin.com/documents/status-update-api
and has been replaced by the share api which allows 700 characters plus a lot of other features
https://developer.linkedin.com/documents/share-api
I edited the code to provide the new xml and the new URL – but I get an error. The new code is:
private void btnUpdateStatus_Click(object sender, EventArgs e)
{
try
{
//string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
//xml += "<current-status>" + txtNewStatus.Text + "</current-status>";
string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><share>";
xml += "<comment>" + txtNewStatus.Text + "</comment><visibility><code>anyone</code></visibility></share>";
//string response = _oauth.APIWebRequest("PUT", "http://api.linkedin.com/v1/people/~/current-status", xml);
string response = _oauth.APIWebRequest("PUT", "http://api.linkedin.com/v1/people/~/shares", xml);
if (response == "")
txtResults.Text += "\n\rYour new status updated. view linkedin for status.";
}
catch (Exception exp)
{
txtResults.Text += "\n\rException: " + exp.Message;
}
}
The XML I am sending is:
<?xml version="1.0" encoding="UTF-8" ?>
<share>
<comment>"Theres a lot of blood, sweat, and guts between dreams and success.", Paul Bryant</comment>
<visibility>
<code>anyone</code>
</visibility>
</share>
the error I get is:
“The remote server returned an error: (405) Method Not Allowed.”
You’re using PUT, but the Share API requires POST as the method.
405 means “You’re using an HTTP method this endpoint doesn’t support”
As far as why, you’re not updating the current status, you’re adding a new share.
https://developer.linkedin.com/documents/share-api