Join Free
+ Reply to Thread
Results 1 to 4 of 4
  1. #1

    [PHP] Retrieving a list of merchants

    I am simply trying to retrieve a list of merchants with a simple query and I just cannot seem to get a correct json response.

    PHP Code:
    require_once("lib/Prosperent_Api_new.php");

        
    $prosperent = new Prosperent_Api(array(
            
    'api_key' => $api_key,
            
    'limit' => 24,
            
    'page' => 1
        
    ));

        
    $prosperent->fetchMerchants(); 
    For some reason, in the json response, I am only getting integer keys not string keys. For example, I should be getting something like this:

    Code:
    "data": [
    {
    "merchant": "0800 REPAIR",
    "merchantId": "126141",
    "logoUrl": "http://img1.prosperent.com/images/logo/merchant/original/120x60/126141.jpg",
    "domain": "0800repair.com",
    "category": "Service",
    "description": null,
    "productDatafeed": "0",
    "deepLinking": "1",
    "numProducts": 0,
    "numProductsCA": 0,
    "numProductsUK": 0,
    "numCouponsUS": 0,
    "numTravelOffersUS": 0,
    "numLocalDealsUS": 0,
    "minPaymentPercentage": 0,
    "maxPaymentPercentage": 0,
    "conversionRate": 0,
    "epc": 0,
    "merchantWeight": 1,
    "averageCommission": 0,
    "dateActive": "2013-12-12"
    }
    But, instead I am getting:

    Code:
    "data": [
    {
    "0": "0800 REPAIR",
    "1": "126141",
    "2": "http://img1.prosperent.com/images/logo/merchant/original/120x60/126141.jpg",
    ...
    }
    Why is this happening?

  2. #2
    Nevermind, I have fixed this issue.

  3. #3
    Quote Originally Posted by dealkeep View Post
    Nevermind, I have fixed this issue.
    Care to tell anyone who might encounter the same issue how you fixed it? Or is the internet exclusively for you to gain knowledge and give nothing back?

  4. #4
    You need to add the following to the code above:

    PHP Code:
    $merchants $prosperent->getAllData(); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
coupons | coupons and deals