PHP code example of breakpoint / etsy-php

1. Go to this page and download the library: Download breakpoint/etsy-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

breakpoint / etsy-php example snippets


$esty = new \breakpoint\etsy\EtsyClient('your-keystring', 'your-secret');
$results = $etsy->listing->findAllFeaturedListings();

foreach ($results as $item) {
    echo $item->listing_id;
}

$etsy->listing-> // method found in API documentation

$etsy->listing->getListing(['listing_id' => '123abc']);

$etsy->listing->fields(['listing_id', 'title', 'description', 'url'])->getListing(['listing_id' => '123abc']);

$etsy->shop->associations(['Listings' => [
                'scope' => 'draft',
                'limit' => 10,
                'offset' => 0,
                'select' => array('listing_id', 'title'),
                // you can also specify sub-associations
                //'associations' => // scope, limit, select, etc
                ]])
                ->getShop(['shop_id' => '123abc']);

$etsy->userprofile->updateUserProfile(

    // first array is parameters
    ['user_id', 'user_123'], 
    
    // second array is data you are changing
    ['first_name' => 'john', 'last_name' => 'developer']);

$results = $etsy->listing->findAllFeaturedListings();

$results[0]; // access the item at that position
$results->count(); // returns number of items
$results->first(); // access the first item
$results->add(object); // useful if you are performing requests with multiple pages

$listing = $etsy->listing->getListing(['listing_id' => 'listing_123']);

echo $listing->title;
echo $listing->getType(); // 'Listing'

$esty = new \breakpoint\etsy\EtsyClient('your-keystring', 'your-secret', 'access_token', 'token_secret');

$etsy->application->addProvisional(['user_id' => 'user_123']);
$etsy->application->removeProvisional(['user_id' => 'user_123']);

// returns all users with access
$etsy->application->getProvisional();

$raw = $etsy->listing->raw()->getTrendingListings();
bash
composer 
shell
php generate.php