有人成功使用了Commission Junction API吗?

时间:2020-03-06 14:51:14  来源:igfitidea点击:

有没有人成功使用CJ Web服务?即使我的应用程序是.net(显然是他们的错误),我仍会不断获取java.lang.NullPointerException。 CJ支持人员甚至不知道Web服务是什么。我在Google上搜索,发现许多人遇到此错误或者其他错误。问题是:这是暂时的问题还是我注定要永久解析手动下载的报告?

我要使用的特定API是每日发布商佣金服务。这是WSDL。

链接:

  • CJ Web服务主页
  • API参考

解决方案

我可以为我们创建一个用户界面,以消除诅咒!!!

要使用每日出版商佣金报告服务!

如果我们仍然需要帮助,请在这里告诉我。

我已经成功地将CJ的API与PHP结合使用,尽管不是这个特定的WSDL。缺少文档使我感到严重困扰,甚至找不到使用它的认真的程序员(所有业余爱好者基本上都在尝试复制粘贴)。如果我们有更多的经验,我们也许可以互相帮助。

编辑:首先,如果没有要报告的佣金,我们将不会得到任何结果。

我正在使用这些API,任何REST API都没有问题,每日发布者佣金服务的SOAP API似乎无法正常工作。结果来自:

<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>

这是完全有效和正确的,给了我HTML页面。错误可能与将页面解析为XML有关。

结果是:

<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>

我已经给他们发送了电子邮件,并希望在今天得到答复。我会与我们确认该API仍然可用,它可能已被实时发布者佣金API完全取代。

花了很多天后,此代码对我有用。

$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',
));