YPCrumble Posted December 14, 2017 Report Posted December 14, 2017 Hi - I'm new to Revive Adserver, but really appreciate what you all are building. I'd love to get involved. The first thing I'd like to do is help with the API setup and documentation. Is that something that would be desirable? I'm seeing quite a few unanswered questions about it and would love to contribute what I learn as I install it myself. Please bear with me - my first question is where could I contribute PR's to the documentation? I don't see anything on GitHub. In terms of the API, I've done the following and still receive this response when I navigate to http://localhost:8080/www/api/v2/xmlrpc/: ``` <methodResponse> <fault> <value> <struct> <member> <name>faultCode</name> <value> <int>105</int> </value> </member> <member> <name>faultString</name> <value> <string>XML error: Invalid document end at line 1</string> </value> </member> </struct> </value> </fault> </methodResponse> ``` Here's what I did (pasting from my Dockerfile): ``` RUN apt-get install -y php5-fpm RUN apt-get install -y php5-curl RUN apt-get install -y php5-gd RUN apt-get install -y php5-json RUN apt-get install -y php5-mysql RUN apt-get install -y php-pear RUN apt-get install -y curl RUN pear install XML_RPC2 ``` I built the Revive server, created an advertiser, banner, zone, website all manually. No problems at all doing that. Then I went into the InvocationTags plugin and enabled the "Allow XML-RPC Invocation Tag" setting. After doing the above, I still get that error when I try to navigate to that endpoint. Is there a next step to beginning to access the API? Thank you for any help! Quote
andrewatfornax Posted December 28, 2017 Report Posted December 28, 2017 Hi @YPCrumble, Thanks, I have added that XML-RPC API documentation is something that needs to be done to my TODO list: https://documentation.revive-adserver.com/display/DOCS/TODO However, if you would like to have a go at documenting it, that would be great! Unfortunately, the does are not in a system that supports PRs, so, if you want to just do something in plain text, that would be a fine start, thanks. The "Allow XML-RPC Invocation Tag" option is for a separate XML-RPC invocation tag type, and actually has nothing to do with the XML-RPC API. The endpoint you are going to is just a base URL, AFAIK - you probably need to generate a valid XML request that defines the API action you are looking to perform... Quote
prime Posted December 28, 2017 Report Posted December 28, 2017 how use XML-RPC API ? i see api is in /www/api/v2/xmlrpc/index.php ,but i unkonw params is what Quote
YPCrumble Posted December 28, 2017 Author Report Posted December 28, 2017 (edited) Hey @andrewatfornax thanks for your note! I am sure I am confusing these endpoints. I'm also happy to start documenting the API and sending you a text file (or markdown?) is fine. > AFAIK - you probably need to generate a valid XML request that defines the API action you are looking to perform... I'm looking into generating a valid XML request. As I get started, is there a particular part of the codebase you could point me to where the XML endpoints are written? EDIT: I see that prime just mentioned /www/api/v2/xmlrpc/index.php - that's what I was looking for. There I see what looks like routes for (what appears to be) endpoints like `ox.logon`. What would be helpful is an explanation of how one of these endpoints works. Once I get one, I'm sure the rest would be easy to grok. For instance, would I create an XML request to: http://localhost:8080/www/api/v2/xmlrpc/ox.logon ? (I doubt this is correct, but I think it explains what I mean). Edited December 28, 2017 by YPCrumble Realized one of my questions had already been answered. Quote
andrewatfornax Posted December 29, 2017 Report Posted December 29, 2017 Unfortunately, I have never actually once in my life used the API! Shameful, I know, but that stems from back in the really, really old days, when the product was commercially owned, and it just wasn't an area where I did any work. So, I'm unable to help at this stage, until I get a chance to dig into it! Quote
YPCrumble Posted January 2, 2018 Author Report Posted January 2, 2018 @andrewatfornax haha that's completely understandable! I'm coming back to my adserver in ~February so will respond then. andrewatfornax 1 Quote
Artistan Posted May 1, 2018 Report Posted May 1, 2018 lib/xmlrpc/php/openads-xmlrpc.inc.php is the script used to call from php to get a XML-RPC ad this is a sample from my current server.... <?php /* <!-- Revive Adserver XML-RPC Tag - Generated with Revive Adserver v4.1.3 --> */ //ini_set('include_path', '.:/usr/local/lib'); require 'openads-xmlrpc.inc.php'; if (!isset($OA_context)) $OA_context = array(); $oaXmlRpc = new OA_XmlRpc('ads.mr.com', '/www/delivery/axmlrpc.php', 80, false, 15); $adArray = $oaXmlRpc->view('zone:1', 0, '', '', 0, $OA_context, ''); echo $adArray['html']; ?> so if you can mimic that class, you should be able to get and deliver an xml-rpc ad. if you want to do management tasks you will need to utilize or reverse engineer the lib/xmlrpc/php/openads-api-xmlrpc.inc.php file. there is java classes available as well... https://github.com/revive-adserver/revive-adserver/tree/master/lib/xmlrpc Quote
Artistan Posted May 1, 2018 Report Posted May 1, 2018 @YPCrumble I just created a composer package that we can us to access this xml api. https://packagist.org/packages/artistan/revive-xmlrpc Cheers! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.