可以更新现有的照片标签
Can Update a photo tags in existing One
我的问题是可以从现有的标签中添加标签(指现有的照片)。现在我可以使用此代码在新上传的朋友中添加标签
private const string ExtendedPermissions = "user_about_me,user_photos,publish_stream";
[HttpPost]
[FacebookAuthorize(Permissions = ExtendedPermissions, LoginUrl = "/Home/LogOn?ReturnUrl=~/Home")]
public ActionResult MensagemPost(string message)
{
var fb = new FacebookWebClient();
dynamic me = fb.Get("me");
string friendId_1 = // get the first one friend id
string friendId_2 = // get the second one friend id
var tags = new[]
{
new { tag_uid = friendId_1, x = 20, y = 20 },
new { tag_uid = friendId_2, x = 40, y = 40 },
new { tag_uid = (string)me.id, x = 60, y = 60 }
};
dynamic parameters = new ExpandoObject();
parameters.message = message;
parameters.tags = tags;
parameters.url = "http://1.bp.blogspot.com/-evheT51sfeM/TlO_wZ8YDqI/AAAAAAAAA8I/fjlg0G8AgMY/s1600/The-best-top-hd-desktop-naruto-shippuden-wallpaper-naruto-shippuden-wallpapers-hd-11.jpg";
dynamic result = fb.Post("me/photos", parameters);
return RedirectToAction("Index", new { success = true });
}
但我不能更新现有标签中的标签。
My try IS
var res = FbClient.Post("/4333418373210452/tags", PostInfo);
AccessToken = Properties.Settings.Default.FBAccessToken;
FacebookClient FbClient = new FacebookClient(AccessToken);
var PostInfo = new Dictionary<string, object>();
var tags = new[] { new { tag_uid = "870415313026255", tag_text = "Tag updated", x = 90, y = 110 } };
PostInfo.Add("tags", tags);
var result = FbClient.Post("/4333418373210452/tags", PostInfo);
此代码从 facebook.The 中获取错误
(GraphMethodException - #100) Unsupported post request. Please read
the Graph API documentation at
https://developers.facebook.com/docs/graph-api
我尝试谷歌搜索,但直到现在都无法找到解决方案..任何人都可以帮助我..也欢迎您发表评论
Jagadeesh Govindaraj
Found the solution...previously i'm try to POST REQUEST Against my friend ID, But now i changed to phtoID..Its Worked.
AccessToken = Properties.Settings.Default.FBAccessToken;
FacebookClient FbClient = new FacebookClient(AccessToken);
var PostInfo = new Dictionary<string, object>();
var tags = new[] { new { tag_uid = "870415313026255", tag_text = "Tag updated", x = 90, y = 110 } };
PostInfo.Add("tags", tags);
var result = FbClient.Post("/"Existing PhotoID"/tags", PostInfo);
我的问题是可以从现有的标签中添加标签(指现有的照片)。现在我可以使用此代码在新上传的朋友中添加标签
private const string ExtendedPermissions = "user_about_me,user_photos,publish_stream";
[HttpPost]
[FacebookAuthorize(Permissions = ExtendedPermissions, LoginUrl = "/Home/LogOn?ReturnUrl=~/Home")]
public ActionResult MensagemPost(string message)
{
var fb = new FacebookWebClient();
dynamic me = fb.Get("me");
string friendId_1 = // get the first one friend id
string friendId_2 = // get the second one friend id
var tags = new[]
{
new { tag_uid = friendId_1, x = 20, y = 20 },
new { tag_uid = friendId_2, x = 40, y = 40 },
new { tag_uid = (string)me.id, x = 60, y = 60 }
};
dynamic parameters = new ExpandoObject();
parameters.message = message;
parameters.tags = tags;
parameters.url = "http://1.bp.blogspot.com/-evheT51sfeM/TlO_wZ8YDqI/AAAAAAAAA8I/fjlg0G8AgMY/s1600/The-best-top-hd-desktop-naruto-shippuden-wallpaper-naruto-shippuden-wallpapers-hd-11.jpg";
dynamic result = fb.Post("me/photos", parameters);
return RedirectToAction("Index", new { success = true });
}
但我不能更新现有标签中的标签。
My try IS
var res = FbClient.Post("/4333418373210452/tags", PostInfo);
AccessToken = Properties.Settings.Default.FBAccessToken;
FacebookClient FbClient = new FacebookClient(AccessToken);
var PostInfo = new Dictionary<string, object>();
var tags = new[] { new { tag_uid = "870415313026255", tag_text = "Tag updated", x = 90, y = 110 } };
PostInfo.Add("tags", tags);
var result = FbClient.Post("/4333418373210452/tags", PostInfo);
此代码从 facebook.The 中获取错误
(GraphMethodException - #100) Unsupported post request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
我尝试谷歌搜索,但直到现在都无法找到解决方案..任何人都可以帮助我..也欢迎您发表评论
Jagadeesh Govindaraj
Found the solution...previously i'm try to POST REQUEST Against my friend ID, But now i changed to phtoID..Its Worked.
AccessToken = Properties.Settings.Default.FBAccessToken;
FacebookClient FbClient = new FacebookClient(AccessToken);
var PostInfo = new Dictionary<string, object>();
var tags = new[] { new { tag_uid = "870415313026255", tag_text = "Tag updated", x = 90, y = 110 } };
PostInfo.Add("tags", tags);
var result = FbClient.Post("/"Existing PhotoID"/tags", PostInfo);