3

In my web project I have to serve ads through our openx server but after searching for documentation on how to implement openx's API on .NET, I haven't found anything. Does anyone know how to implement their API on .NET and how to serve ads through it? Documentation is appreciated.

Note: I have done my searches and I didn't find anything relating this matter. Using their own API is a priority to third parties API.

EDIT:

Public Class OpenXAdsProcessor

    Dim session As OpenXNet.ISession
    Dim s As IOpenXProxy

    Public Sub New()

        s = CookComputing.XmlRpc.XmlRpcProxyGen.Create(Of IOpenXProxy)()
        s.Url = "ourserverurl/www/api/v1/xmlrpc/LogonXmlRpcService.php"        
        s.XmlRpcMethod = "logon"

        session = New SessionImpl(s, "username", "password")

    End Sub
End Class

Above I am implementing OpenX API. Right now I'm waiting to get permissions for my user because the server returned "Server returned a fault exception: [801] User must be OA installation admin" on my attempt to login.

Will the above code suffice to make use of your API?

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
Hallaghan
  • 1,910
  • 6
  • 32
  • 47
  • This question really is a godsend. I have recently started looking into this same kind of thing. If I could upvote this twice, I would. – Snowy Mar 23 '12 at 00:37
  • @Snowy, that is the beauty of Stackoverflow. A place where we share our problems so they might become solutions for us and everyone else. – Hallaghan Mar 23 '12 at 16:53

2 Answers2

5

I'm the author of OpenX.NET. If you just need to serve OpenX ads in a web application, you don't need to use these API bindings. Just place the OpenX javascript in your web page.

If you really need to use the API for other kind of scenarios and are new to OpenX, I recommend first getting familiar with OpenX concepts, see the OpenX Developer Zone. Then see some OpenX.NET tests. OpenX.NET is a 1-to-1 mapping to OpenX entities and methods.

EDIT: unless you want to debug something or really know what you're doing, you never need to handle the proxy directly. Simply use the session constructor:

SessionImpl(string username, string password, string url)

The URL is the root URL for the OpenX v2 API, e.g. http://localhost:10002/openx/api/v2/xmlrpc/, see the sample app.config in the tests.

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
  • It's a web service so I can't really use javascript. In my specific case, I am going to use your API. I must serve ads, randomize which ads will display at what time, provide statistics, and so on. I already began implementing your API. Please check the edit on my question to see if I'm doing things right. – Hallaghan Mar 13 '12 at 16:43
  • By the way, Mauricio, thank you a lot for developing OpenX.NET – Hallaghan Mar 13 '12 at 16:51
  • thank you for leading me the right way. I'm working on the implementation of your API. – Hallaghan Mar 14 '12 at 11:03
  • Mauricio, thank you++ for developing this. I have been staring at the obtuse OpenX (and its predecessors and variants) bits for a while now, and your translation has really made things easy. Thanks! – Snowy Mar 23 '12 at 00:39
  • Mauricio, many thanks for putting this together. Does this support version 3 of the OpenX API? – CodeWarrior Mar 27 '12 at 18:58
  • @opadilla : no, it's built for the OpenX API v2. I wasn't even aware there's already v3, where are the docs? – Mauricio Scheffer Mar 27 '12 at 20:32
  • Java, PHP, and Perl OpenX version 3 API clients are available on GitHub at https://github.com/openx. These pretty much only demonstrate how to authenticate with OAuth, which I believe is new in version 3. – CodeWarrior Mar 28 '12 at 15:13
  • @opadilla : thanks, just created a new issue about this: https://github.com/mausch/OpenX.Net/issues/9 feel free to send a pull request ;) – Mauricio Scheffer Mar 28 '12 at 15:47
0

There are some bindings available for .NET.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • Is there any documentation available for this API? I looked up his website but I didn't find anything there. – Hallaghan Mar 13 '12 at 09:28