Why is my REST request only returning part of an advertiser's inventory?

Discussion in 'Commission Junction' started by Newwebdesigner, Nov 9, 2010.

  1. #1
    Hello all,

    I am creating a shopping comparison website for books. In order to do that I need to access all of an advertiser's inventory in order to sort it according to price. However, when I attempt to access ValoreBook's inventory for a certain book (ISBN: 9780321543257) my search returns only 2 results, many less than the 73 results that are returned when you go to Valorebooks.com and do a search for the same ISBN.

    So my question is why isn't my code returning all 73 results? Is it missing something? Are there any Commission Junction gurus out there that can help me out? Below is my code.

    Thanks.

    
    <?php
    $websiteid= "Your_WebsiteID_Here";
    $CJ_DevKey= "Your_developmentKey_here";
    $isbn= "9780321543257";
    $listing ="1000";
    $advs ="2876910";
    $page = "";
    $keywords="";
    
    $targeturl="https://product-search.api.cj.com/v2/product-search?";
    $targeturl.="&website-id=$websiteid";
    $targeturl.="&advertiser-ids=$advs";
    $targeturl.="&isbn=$isbn";
    $targeturl.="&records-per-page=$listing";
    $targeturl.="&page-number=$page";
    $targeturl.="&keywords=$keywords";
    
    $ch = curl_init($targeturl);
    curl_setopt($ch, CURLOPT_POST, FAlSE);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: '.$CJ_DevKey));
    
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    $response = curl_exec($ch);
    curl_close($ch);
    $xml = simplexml_load_string($response);
    
    print_r ($xml);
    
    
    ?>
    
    
    PHP:

     
    Newwebdesigner, Nov 9, 2010 IP
  2. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #2
    Probably because the affiliate manager has not uploaded all of the inventory to the CJ database.
     
    QiSoftware, Nov 10, 2010 IP