1

Is there a C# Client library for twitter Ads Api?

Apparently Tweetinvi doesn't support Ads Api but otherwise is very good library for Twitter.

ViV
  • 1,998
  • 8
  • 27
  • 54
  • May I Reason for down vote please? – ViV Oct 12 '15 at 19:49
  • https://dev.twitter.com/ads/overview – Rj Geraci Oct 12 '15 at 20:00
  • Right, I have gone through that link and have created an application on twitter account as well. I wanted to know if there was a C# Client Library which allows me to make API calls not having to make REST calls directly. – ViV Oct 12 '15 at 20:07
  • The answer is probably no. If you worked for twitter you could probably use their internal one, but otherwise you should be making the REST calls yourself. – Rj Geraci Oct 12 '15 at 20:09
  • If I were working for Twitter, I would not have asked this on SO in the first place. Thanks for your help. – ViV Oct 12 '15 at 20:27
  • You asked whether the Client Library exists. So a reasonable answer is that it might, internally at Twitter! You might want to email the Tweetinvi developer(s) and ask them if support for Ads is in the works, it might be worth waiting for if you are already using that library. – Rj Geraci Oct 12 '15 at 20:33

2 Answers2

1

I am the developer of the library Tweetinvi. The Twitter Ads API will be implemented for version 2.0 so it won't be done before quite some time (months or a year).

Though if you are fine to share your credentials with me, I will be happy to try and see if I can do something quick to help you. With some tweaks or tips the library should be able to let you create your custom Twitter queries for the Ads API.

Feel free to visit github to open issues here : https://github.com/linvi/tweetinvi.

If you want to contact me privately please do so through my codeplex profile (click the 'contact' link visible on https://www.codeplex.com/site/users/view/linvi).

Cheers, Linvi

Linvi
  • 2,077
  • 1
  • 14
  • 28
  • Thanks for your reply Linvi. I an not allowed to share the credentials. (I myself am yet to receive the credentials ). However, I am trying the method TwitterAccessor.ExecuteJsonGETQuery(); in the TweetInvi library. e.g. var userJson = TwitterAccessor.ExecuteJsonGETQuery("https://ads-api.twitter.com/0/accounts"); and hoping to get the JSON result back. Is that correct approach? – ViV Oct 13 '15 at 18:09
1

I would guess that you can setup the authentication the same way as you'd do with Tweetinvi and then use the TwitterAccessor.

You can find the documentation here : https://github.com/linvi/tweetinvi/wiki/Custom-Queries#simple-query

Instead of using the JSON I would instead simplify the process by creating DTO's decorated with [JsonProperty] attributes (example in UserDTO).

// Example of DTO class
public class AdDTO
{
    [JsonProperty("name")] // This is the name json field of the response
    public string Name { get; set; }
}

And then you will be able to get the AdDTO as followed:

var adDTO = TwitterAccessor.ExecuteGETQuery<AdDTO>("my_twitter_ads_api_query");

I hope this is of any help.

Finally just for the sake of your knowledge, I have been working with multiple companies, and I have signed confidentiality clauses/contracts in order to always preserve their credentials safe. If needed I will be happy to do this with you too.

Have an happy ads coding :)

Linvi
  • 2,077
  • 1
  • 14
  • 28