views:

52

answers:

1

I wish to access the FaceBook Ads API using the FaceBook toolkit for .NET (which i found in codeplex.com)

Wish to access the ads.estimateTargetingStats in particular .

details of FaceBook Ads API

FaceBook Ads API reference

Are there any frameworks(in .NET) developed around the FaceBook APIs . I am aware of

  1. FaceBook Toolkit ,
  2. FaceBook .NET

both are from codeplex.

Does someone let me know how to achieve the above quoted requirement with any .NET framework ?

Thanks, Vijay

A: 

The SDK I developed called the Facebook .Net SDK will do this. http://facebooksdk.codeplex.com The SDK supports .Net 3.5 and .Net 4.0. If you can, I would recommend using .Net 4.0 as the experience will be better.

Example code using dynamic on .net 4.0 would be:

FacebookApp app = new FacebookApp();
dynamic parameters = new ExpandoObject();
parameters.method = "ads.estimateTargetingStats";
parameters.account_id = "account_id";
parameters.targeting_spec = new List<string> { "spec1", "spec2" };
parameters.currency = "USD";
dynamic result = app.Api(parameters);
// from here just access the properties dyanmically
string s = result.something; // I dont remember exactly what all the return values are. You can view the dynamic result if you set a breakpoint when debugging.
Nathan Totten