【问题标题】:Anyone successfully using Commission Junction API?有人成功使用 Commission Junction API 吗?
【发布时间】:2008-09-28 22:22:38
【问题描述】:

有人成功使用 CJ 网络服务吗?即使我的应用程序是 .net (显然是他们的错误),我也会不断收到 java.lang.NullPointerExceptions。 CJ 支持甚至不知道 Web 服务是什么。我用谷歌搜索,发现很多人遇到这个或其他错误。问题是:这是一个暂时的问题,还是我注定要永远解析手动下载的报告?

我尝试使用的特定 API 是 daily publisher commission serviceHere 是 WSDL。

链接:

【问题讨论】:

  • 你能链接到这个 API(文档等)吗?
  • 我添加了指向 API 参考和 WSDL 的链接

标签: api cj commission-junction


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

    • 嗨,Michiel,我终于放弃了那个,而求助于手动导出/导入数据。我最近使用了另一个 API,通过 REST (help.cj.com/en/web_services/…) 进行产品搜索,它工作正常(当服务没有关闭时,这种情况经常发生)。也许我应该通过 REST 再次尝试发布者佣金 API。
    【解决方案3】:

    我编写了一个 Python 库,用于从 CJ 检索佣金信息。这是代码:https://github.com/sidchilling/commissionjunction-python-lib

    为我工作。

    【讨论】:

      【解决方案4】:

      例如创建一个页面cjcall.php

      粘贴此代码并根据您的要求进行操作,即关键字、设备 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);
      

      创建另一个页面并粘贴以下代码以从该页面获取 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
               }
      

      【讨论】:

        【解决方案5】:

        我可以为你做一个用户界面来解除你的诅咒!!!

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

        如果您仍需要帮助,请在此处告诉我。

        【讨论】:

        • 谢谢,但我需要以编程方式访问他们的 API,而不是用户界面......无论如何,我目前正在通过手动将报告导出为 xml,然后将其导入我的应用程序来解决这个问题。这不是一个重要的功能,所以我只需要每月执行一次或两次。
        【解决方案6】:

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

        我正在使用这些 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 取代。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-02-10
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-09-16
          相关资源
          最近更新 更多