I am using @abraham’s twitteroauth library which works great with OAuth. But unfortunately it seems not have support of Ads API because its picking Api Host internally which is https://api.twitter.com.
Currently I am thinking to fork his repository and add my code to support Ads Api host, further I can send pull request. Is there any other better idea or somebody know of some PHP library which already has Ads Api Support?
@mahsanamin there is currently no officially supported Twitter Ads API PHP library. You might want to have a look at @brandonmblack’s post here that details some of our plans to create and release some officially supported SDKs. This point that Brandon makes might be of interest to you, since PHP is not in our immediate pipeline:
With all these we’ll also be releasing a full suite of cross platform behavior tests that define how an SDK should behave in case you wanted to build your own or implement an SDK in a language we’ve chosen not to support officially. We’ll be regularly updating both the SDKs and our independent test suite with new features and changes as they release in the API.
@andrs, Thank you! I also saw that link before but currently my project is in PHP, so for now I have added support of Host in existing abrahms library and the Ads api are working great with this addition.
@abraham , Thank you for your feed back. I am not sure I did right way but for now I added two methods (get/post) which take Host and APi version. Reason of taking Host and version as parameter is because Ads API also have support of Sandbox URL. I could do it your way like you did for root Twitter URL but I think adding a support to use any kind of Host in your library can be a good addition.
I will share the pull request after consulting the code changes with my other team members. The good news is that your library works great with Twitter Ads Api.
@abraham we should sync up. We’re building out SDKs in Ruby, Python and Java now all of which work well with their corresponding community Twitter gems. The Ads API iterates really quickly, new features every week and that’s why we wanted to officially support these APIs to help developers stay on top of those changes. We have more language support planned later, but we don’t have PHP on our list at the moment. We’d love to help support a community effort though.
In the Twitter Ads API, there are multiple methods that can be reached by HTTP GET, POST, PUT and/or DELETE. While Codebird does its best to guess which HTTP verb you’ll want to use, it’s the safest bet to give a hint yourself, like this: