简体   繁体   English

有没有人成功使用Commission Junction API?

[英]Anyone successfully using Commission Junction API?

Is anyone successfully using the CJ web services? 是否有人成功使用CJ Web服务? I just keep getting java.lang.NullPointerException s even though my app is .net (clearly their errors). 我只是继续得到java.lang.NullPointerException即使我的应用程序是.net(显然是他们的错误)。 CJ support doesn't even know what a web service is. CJ支持甚至不知道Web服务是什么。 I googled and found many people getting this or other errors. 我用谷歌搜索,发现很多人得到这个或其他错误。 Question is: is it a temporary problem or am I doomed to parse manually downloaded reports for eternity? 问题是:这是一个暂时的问题,还是我注定要解析手工下载的永恒报告?

The specific API I'm trying to use is the daily publisher commission service . 我正在尝试使用的特定API是每日发布商佣金服务 Here is the WSDL. 是WSDL。

Links: 链接:

After a spending many days, this code is working for me. 花了很多天后,这段代码对我有用。

$client = new SoapClient($cjCommissionUrl,

    array('trace' => 1,
    'soap_version' => SOAP_1_1,
    'style' => SOAP_DOCUMENT,
    'encoding' => SOAP_LITERAL
    ));


$date = '06/23/2010';
    $results = $client->findPublisherCommissions(array(
    "developerKey" => $cjDeveloperKey,
    "date" => $date,
    "dateType" => 'posting',
    "countries" => 'all',
));

I have successfully used CJ's API with PHP, though not this particular WSDL. 我已成功使用CJ的API与PHP,但不是这个特定的WSDL。 I am seriously troubled by the lack of documentation and even cannot find any serious programmer using it (all amateurs basically trying to copy-paste). 我很缺乏文档,甚至找不到任何严肃的程序员使用它(所有业余爱好者基本上都试图复制粘贴)。 If you have some more experience we may be able to help each other out. 如果您有更多经验,我们可以互相帮助。

I had written a Python library for retrieving commission info from CJ. 我编写了一个Python库,用于从CJ中检索佣金信息。 Here is the code: https://github.com/sidchilling/commissionjunction-python-lib 这是代码: https//github.com/sidchilling/commissionjunction-python-lib

Works for me. 适合我。

create a page cjcall.php forexample 创建一个页面cjcall.php例如

paste this code and do according to your requirement ie keyword , dev id , records per page 粘贴此代码并根据您的要求进行操作,即关键字,开发ID,每页记录

include('../../../../wp-load.php');

$stringkeyw=urlencode(get_option('cj_keyword'));
if(get_option('rm_num_products')==''){
$pperkeyword=50;
}else{
$pperkeyword= get_option('rm_num_products');
}//number of products against keyword

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://product-search.api.cj.com/v2/product-search?website-id=".get_option('cj_siteid')."&keywords=".$stringkeyw."&records-per-page=".$pperkeyword."&serviceable-area=US");

curl_setopt($ch, CURLOPT_HEADER,false); 

curl_setopt($ch, CURLOPT_HTTPGET, true); 

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml",  "Authorization:".get_option('cj_devid').""));

$result = curl_exec($ch);

create another page and paste the following code to bring xml from this page: 创建另一个页面并粘贴以下代码以从此页面引入xml:

$hurl= home_url();
$homepage = file_get_contents(''.$hurl.'/wp-content/plugins/rapid_monetizer/cronjob/cjcall.php');
$object = simplexml_load_string($homepage);

    foreach($object->products->product as $cjres)
    {
       //do your code with products coming in $cjres
         }

EDIT: First and foremost, you will not get any results back if there are no commissions to report. 编辑:首先,如果没有可报告的佣金,您将无法获得任何结果。

I am working with these API's, I have no problem with any of the REST API's, the SOAP API for the daily publisher commission service does not appear to be working. 我正在使用这些API,我对任何REST API没有任何问题,每日发布商佣金服务的SOAP API似乎不起作用。 The results from: 结果来自:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="https://pubcommission.api.cj.com">
       <soapenv:Header/>
       <soapenv:Body>
          <api:findPublisherCommissions>
             <api:developerKey>*DEVKEY*</api:developerKey>
             <api:date>01/19/2007</api:date>
             <api:dateType>event</api:dateType>
             <api:advertiserIds></api:advertiserIds>
             <api:websiteIds>123456</api:websiteIds>
             <api:actionStatus>all</api:actionStatus>
             <api:actionTypes></api:actionTypes>
             <api:adIds></api:adIds>
             <api:countries></api:countries>
             <api:correctionStatus></api:correctionStatus>
             <api:sortBy>commissionAmount</api:sortBy>
             <api:sortOrder>desc</api:sortOrder>
          </api:findPublisherCommissions>
       </soapenv:Body>
    </soapenv:Envelope>

Which is completely valid and correct, gives me an HTML page back. 这是完全有效和正确的,给我一个HTML页面。 Your error is probably related to parsing the page as XML. 您的错误可能与将页面解析为XML有关。

The results are: 结果是:

<html>
<head>
<title>Web Services</title>
</head>

<body vlink="#333333" alink="#FFCC33" bgcolor="#FFFFFF" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td background="images/header_bg.gif">
                <a href="http://webservices.cj.com"><img src="images/header.gif" width="600" height="63" border="0" alt="webservices.cj.com" /></a>
            </td>
        </tr>
    </table>



<h3>Latest WSDLs</h3>
<table width=70%><tr><td>
<ul>
  <li>ProductSearchServiceV2.0<a href="wsdl/version2/productSearchServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></li>
  <li>LinkSearchServiceV2.0<a href="wsdl/version2/linkSearchServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></</li>  
  <li>PublisherCommissionService and ItemDetails V2.0<a href="wsdl/version2/publisherCommissionServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></</li>
  <li>RealTimeCommissionServiceV2.0<a href="wsdl/version2/realtimeCommissionServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></</li>
  <li>AdvertiserSearchService<a href="wsdl/version2/advertiserSearchServiceV2.wsdl">[wsdl]</a></li>
  <li>FieldTypesSupportService<a href="wsdl/version2/supportServiceV2.wsdl">[wsdl]</a></li>
</ul>
</td></tr></table>

<h3>Previously Released WSDLs</h3>
For previous versions of the wsdls <a href="old_versions.jsp">click here.</a><p>

<h3>Sign Up</h3>
<ul>
  <li><a href="sign_up.cj">Sign Up</a></li>
</ul>

</body>
</html>

I have sent them an email, and expect a response today. 我已经给他们发了一封电子邮件,并期待今天的回复。 I will confirm with you that this API is still available, it may have been completely replaced by the Real Time publisher commission API. 我将与您确认此API仍然可用,它可能已被Real Time发布商佣金API完全取代。

I can make a user interface for you to lift your curse !!! 我可以为你制作一个用户界面来解除你的诅咒!

To use Daily Publisher Commission Report Service !! 使用Daily Publisher Commission报告服务!!

Let me know here if you still need help. 如果你还需要帮助,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM