0
任何人都可以引導我如何使用C#asp.net中的Linkedin Invitation API來解決問題。我想通過這個API向我的應用發送特定用戶的邀請,但是沒有找到足夠的信息來啓動它。任何人都可以給我一些例子來開始。我已經從LinkedIn搜索API獲得用戶列表。現在我想向這些用戶發送邀請。如何在c#Asp.NET中處理Linkedin的邀請API
謝謝先進。希望最好的答案會出來。
謝謝
任何人都可以引導我如何使用C#asp.net中的Linkedin Invitation API來解決問題。我想通過這個API向我的應用發送特定用戶的邀請,但是沒有找到足夠的信息來啓動它。任何人都可以給我一些例子來開始。我已經從LinkedIn搜索API獲得用戶列表。現在我想向這些用戶發送邀請。如何在c#Asp.NET中處理Linkedin的邀請API
謝謝先進。希望最好的答案會出來。
謝謝
最後,它完成了。我已經用asp.net c#成功實現了linkedin邀請API。 我在這裏發佈示例代碼,供其他想要實現它的用戶使用。
try
{
string uid=uniqueid of user,to whom you want to send request.
// if you get this user bysearch api or 1st connection, then from http-header response, you will find value field. split this value by ':' and store in two variable
string name=splitvalue1;
string namevalue=splitvalue2;
string xml = "<?xml version='1.0' encoding='UTF-8'?><mailbox-item><recipients><recipient><person path=\"/people/id=" + uid + "\" /></recipient></recipients>";
xml += "<subject>Invitation to Connect</subject>";
xml += "<body>Please join my professional network on LinkedIn.</body>";
xml += "<item-content><invitation-request><connect-type>friend</connect-type><authorization><name>" + name + "</name><value>" + namevalue + "</value></authorization></invitation-request></item-content></mailbox-item>";
string accessCodeUri = "https://api.linkedin.com/v1/people/~/mailbox?oauth2_access_token=" + Session["accessCode"]; // this is session value which you get on authorization success return by linkedin
WebRequest request = WebRequest.Create(accessCodeUri);
request.Method = "POST";
request.ContentType = "application/xml";
request.ContentLength = xml.Length;
StreamWriter requestWriter = new StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII);
requestWriter.Write(xml);
requestWriter.Close();
WebResponse webResponse = request.GetResponse();
//success
}
catch(WebException exc)
{
}
希望它有助於其他。
試過了什麼? –
這就是我想說的。我不知道如何開始。我訪問這個鏈接https://developer.linkedin.com/documents/invitation-api但仍不清楚,如何開始。你能指導我嗎? –