Money-Code

Coding For Online Success

CJ API/WebService version 2

| 18 Comments

There was a comment a couple of days ago about CJ WebService Version 2. I did get this to work. I found some good code another programmer put together that access the v2 WSDL. Basically, this is my API test script, so you need to manually add your keywords and advertiser ID in the code, but it’s a proof of concept. I think I’ve abandoned the CJ API. I personally think it’s not that consistent. I often get ‘internal server error’ in the response XML. I think it might be a riskier move to go version 2 for real time calls.. just my two cents.

This version needs PHP5 with SOAP services built into PHP (–enable-soap). Also it’s using try/catch for handling SOAP exception and it’s only available in PHP5.

As I mentioned above, I’m pretty much ditching CJ web services all together. I still use eBay’s API, but CJ’s seems a little off for me. I’m doing initial tests with CJ Data Feeds now, and this really appears to be the direction I need to go.

span class=”st0″>"soap.wsdl_cache_enabled","0"‘productSearchServiceV2.wsdl’‘trace’‘yourlongdevkey’,
                                        $websiteId              = ‘0000000’,
                                        $advertiserIds  = ‘0000001’‘your keywords’,
                                        $serviceableArea = ,
                                        $isbn                   = ,
                                        $upc                    = ,
                                        $manufacturerName = ,
                                        $manufacturerSku = ,
                                        $advertiserSku = ,
                                        $lowPrice               = ,
                                        $highPrice              = ’50’,
                                        $lowSalePrice   = ,
                                        $highSalePrice  = ,
                                        $currency               = // DEBUG
"<h3>Your search for ‘$keywords’ generated $results->count results</h3>"‘%01.2f’"<br>".$product->advertiserId."<br>""<br>SKU:".$product->sku."<br>""<a href=’$product->buyUrl’><img src =’$product->imageUrl’ height=’70’ ><p>$product->name <br/> Offered by $product->advertiserName($product->advertiserId) at <b>$price ($product->currency)</b></p></a>""<div id=’error’><p>There was an error with your request or the service is unavailable.</p></div>"

You can download productSearchServiceV2.wsdl here.

s

18 Comments

Leave a Reply

Required fields are marked *.


CommentLuv badge

This site uses Akismet to reduce spam. Learn how your comment data is processed.