如何在 Yammer 中获取组 ID?
我能够在所有公司以及特定群组中发布消息,但我无法使用 Yammer API 获取特定群组的群组 ID
在下面找到用于在特定组中发布的代码,其中 group_id 是一个字符串变量,我手动输入其值并希望自动执行此过程。
private void Post(string address)
{
System.Uri targetUri = new System.Uri(https://www.yammer.com/api/v1/messages.json?body=HelloTest&group_id=[some_number]&access_token=" + token);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(targetUri);
request.Method = "POST";
request.BeginGetResponse(new AsyncCallback(ReadWebRequestCallback), request);
}
// STEP4 STEP4 STEP4
private void ReadWebRequestCallback(IAsyncResult callbackResult)
{
HttpWebRequest myRequest = (HttpWebRequest)callbackResult.AsyncState;
HttpWebResponse myResponse = (HttpWebResponse)myRequest.EndGetResponse(callbackResult);
string results;
using (StreamReader httpwebStreamReader = new StreamReader(myResponse.GetResponseStream()))
{
results = httpwebStreamReader.ReadToEnd();
//TextBlockResults.Text = results; //-- on another thread!
SkyDriveContent test = new SkyDriveContent();
test.Name = results;
str_results = results;
}
myResponse.Close();
}
我看到了文档,但没有找到任何方法来获取用户所属的组列表?
任何帮助,将不胜感激!