Looking for some help on posting an open graph action using v6 of the SDK. I have been scouring for a couple of days, and can't find any examples of how to do this. So far I have:
protected void btnDyno_Click(object sender, EventArgs e)
{
FacebookSDKInterface fbData = new FacebookSDKInterface();
var fb = new FacebookClient(fbData.FacebookAccessToken);
dynamic parameters = new ExpandoObject();
parameters.appnamespace = "thedynoroom";
parameters.action = "added";
parameters.object_name = "dyno_run";
parameters.object_url = "http://thedynoroom.com/DesktopModules/Incite/InciteCore/FBObject.aspx";
try
{
dynamic result = fb.Post("me/", parameters);
lblPostMessageResult.Text = result;
txtMessage.Text = string.Empty;
}
catch (FacebookApiException ex)
{
lblPostMessageResult.Text = ex.Message;
}
}
I know this is not correct, as I was just guessing as I was unable to find any documentation on this specifically. Is there any more documentation other than what is on http://csharpsdk.org?
Thanks in advance for the help! Chad
UPDATE: Ok, figured it finally... If, when in your facebook developer graph dashboard, the Get Code link for your action looks like this:
curl -F 'access_token=blahblahblah' \
-F 'dyno_run=http://samples.ogp.me/266692056752346' \
'https://graph.facebook.com/me/thedynoroom:add'
Then your code should look like this:
dynamic parameters = new ExpandoObject();
parameters.dyno_run = "http://samples.ogp.me/266692056752346";
try
{
dynamic result = fb.Post("me/thedynoroom:add", parameters);
lblPostMessageResult.Text = result;
txtMessage.Text = string.Empty;
}
Note that in the "parameters.xxxxxxx" the xxxxx is = to your action name.
Now I just need to figure out how to parse the JSON result :)
dicFBPostParams.Add(YOUROBJECT, URL to your Object page)
dynamic result = fb.Post("me/YOURAPPNAMESPACE:YOUACTION", dicFBPostParams); – crichavin May 24 '12 at 06:38