Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Tcl) Etsy: Find a Shop's Active ListingsFinds all active Listings associated with a Shop. For more information, see https://www.etsy.com/developers/documentation/reference/listing
load ./chilkat.dll # This example assumes the Chilkat API to have been previously unlocked. # See Global Unlock Sample for sample code. set http [new_CkHttp] # Implements the following CURL command: # curl -X GET \ # https://openapi.etsy.com/v2/shops/shop_id/listings/active?api_key=MY_ETSY_KEYSTRING&limit=2 set sbResponseBody [new_CkStringBuilder] set success [CkHttp_QuickGetSb $http "https://openapi.etsy.com/v2/shops/shop_id/listings/active?api_key=MY_ETSY_KEYSTRING&limit=2" $sbResponseBody] if {$success == 0} then { puts [CkHttp_lastErrorText $http] delete_CkHttp $http delete_CkStringBuilder $sbResponseBody exit } set jResp [new_CkJsonObject] CkJsonObject_LoadSb $jResp $sbResponseBody CkJsonObject_put_EmitCompact $jResp 0 puts "Response Body:" puts [CkJsonObject_emit $jResp] set respStatusCode [CkHttp_get_LastStatus $http] puts "Response Status Code = $respStatusCode" if {$respStatusCode >= 400} then { puts "Response Header:" puts [CkHttp_lastHeader $http] puts "Failed." delete_CkHttp $http delete_CkStringBuilder $sbResponseBody delete_CkJsonObject $jResp exit } # Sample JSON response: # (Sample code for parsing the JSON response is shown below) # { # "count": 176, # "results": [ # { # "listing_id": 720138253, # "state": "active", # "user_id": 17132443, # "category_id": 68890894, # "title": "Star face, Galaxy wall mask, Weird wall mask, Crazy art sculpture, Original Wall Mask, Wire art sculpture, Wall art sculpture, 3D art", # "description": "The crazy hair says it all. This galaxy face is something every art lover should possess in their collection. The two crazy eyes are so lovable and so in tune with the nose. The thin decorative black lines emphasize the facial characteristics and the white dots around the face all lead to this gorgeous crazy hair, made of thick metal wire. This unique star face is made of terracotta, ceramic elements, and sand plaster than it was glued to a wooden board, painted in dark blue. There is a hook on the back for easy hanging. The awesome art piece is perfect for your personal collection or a gift for someone very special.\n\nThe night sky can always be an artist\u2019s inspiration: the countless stars and the vastness can acquire different images and shapes. In this case, this incredible face, filled with numerous stars, emerges from the sky for me. \n \nTagged: 99heads\n\nThe following materials are used: \n\nTerracotta, ceramic elements, ceramic glaze, ceramic paint, wood, metal wire, glass, sand plaster.\n\nSize:\nHeight: (hair included): 30 cm (11 3\/4")\nWidth: 36cm (14 1\/4 )\nDepth: 6 cm ( 2 1\/2")", # "creation_tsz": 1562700678, # "ending_tsz": 1573331478, # "original_creation_tsz": 1562700678, # "last_modified_tsz": 1562704479, # "price": "160.00", # "currency_code": "USD", # "quantity": 1, # "sku": [ # ], # "tags": [ # "Crazy art sculpture", # "Wall Ceramic mask", # "Abstract face", # "3D sculpture", # "Wall art Sculpture", # "wire art sculpture", # "wired art", # "modern ceramics", # "wall mask", # "star face", # "galaxy art", # "galaxy wall mask", # "galaxy sculpture" # ], # "category_path": [ # "Art", # "Mixed Media" # ], # "category_path_ids": [ # 68887312, # 68890894 # ], # "materials": [ # "Terracotta", # "ceramic elements", # "ceramic glaze", # "ceramic paint", # "wood", # "metal wire", # "glass", # "sand plaster" # ], # "shop_section_id": 24002839, # "featured_rank": null, # "state_tsz": 1562700678, # "url": "https:\/\/www.etsy.com\/listing\/720138253\/star-face-galaxy-wall-mask-weird-wall?utm_source=chilkattest&utm_medium=api&utm_campaign=api", # "views": 7, # "num_favorers": 1, # "shipping_template_id": null, # "processing_min": 1, # "processing_max": 2, # "who_made": "i_did", # "is_supply": "false", # "when_made": "2010_2019", # "item_weight": null, # "item_weight_unit": "g", # "item_length": null, # "item_width": null, # "item_height": null, # "item_dimensions_unit": "mm", # "is_private": false, # "recipient": null, # "occasion": null, # "style": null, # "non_taxable": false, # "is_customizable": true, # "is_digital": false, # "file_data": "", # "should_auto_renew": false, # "language": "en-US", # "has_variations": false, # "taxonomy_id": 101, # "taxonomy_path": [ # "Art & Collectibles", # "Mixed Media & Collage", # "Other Assemblage" # ], # "used_manufacturer": false # }, # { # "listing_id": 643852266, # "state": "active", # "user_id": 17132443, # "category_id": 68890894, # "title": "Art gift for couple, Weird art figures, Ceramic Wall Figurines, Colorful sculptures, 3D wall art, Mixed Media Sculpture by 99heads", # "description": "The faces of the sculptures are made of white clay elements and ceramic glazes. Their bodies are wooden and painted with acrylic paints. Each sculpture has got a hook on the back for you to hang it on the desired place and in the desired arrangement. These two look amazing next to each other on the wall... they look like good buddies. They are indeed very good friends that want to make your home more comfortable for you and your family or be a surprise gift for someone special :)\n\nMaterials:\nWhite clay, ceramic elements, wood, glass.\n\nTagged by 99heads\n\nSize:\n\nBlue Figure:\nHeight 62cm, width 10cm, depth 3cm\n(Height 24 1\/4" width 4", depth 1 1\/4")\n\nRed Figure:\nHeight 61,5cm, width 9cm, depth 3cm\n(Height 24" width 3 1\/2", depth 1 1\/4")\n\nIf you're interested in having only one of them:\n\nBlue figure:\nhttps:\/\/www.etsy.com\/listing\/609986541\/abstract-ceramic-modern-ceramic-doll\n\nRed figure:\nhttps:\/\/www.etsy.com\/listing\/596145976\/abstract-doll-figure-colorful-sculpture", # "creation_tsz": 1562699323, # "ending_tsz": 1573330123, # "original_creation_tsz": 1541802400, # "last_modified_tsz": 1562699323, # "price": "230.00", # "currency_code": "USD", # "quantity": 1, # "sku": [ # ], # "tags": [ # "ceramic home decor", # "wall art ceramic", # "abstract ceramic", # "ceramic wall art", # "ceramic sculpture", # "3d wall art", # "Ceramic doll", # "wall art sculpture", # "wall sculpture", # "weird art figures", # "Art gift for couple", # "colorful sculpture", # "Fun wall hanging art" # ], # "category_path": [ # "Art", # "Mixed Media" # ], # "category_path_ids": [ # 68887312, # 68890894 # ], # "materials": [ # "white clay", # "ceramic elements", # "glass", # "ceramic glazes", # "wood" # ], # "shop_section_id": 24002915, # "featured_rank": null, # "state_tsz": 1541802400, # "url": "https:\/\/www.etsy.com\/listing\/643852266\/art-gift-for-couple-weird-art-figures?utm_source=chilkattest&utm_medium=api&utm_campaign=api", # "views": 143, # "num_favorers": 16, # "shipping_template_id": null, # "processing_min": 1, # "processing_max": 2, # "who_made": "i_did", # "is_supply": "false", # "when_made": "2010_2019", # "item_weight": null, # "item_weight_unit": "g", # "item_length": null, # "item_width": null, # "item_height": null, # "item_dimensions_unit": "mm", # "is_private": false, # "recipient": null, # "occasion": null, # "style": [ # "Abstract" # ], # "non_taxable": false, # "is_customizable": true, # "is_digital": false, # "file_data": "", # "should_auto_renew": false, # "language": "en-US", # "has_variations": false, # "taxonomy_id": 101, # "taxonomy_path": [ # "Art & Collectibles", # "Mixed Media & Collage", # "Other Assemblage" # ], # "used_manufacturer": false # } # ], # "params": { # "limit": "2", # "offset": 0, # "page": null, # "shop_id": "6634711", # "keywords": null, # "sort_on": "created", # "sort_order": "down", # "min_price": null, # "max_price": null, # "color": null, # "color_accuracy": 0, # "tags": null, # "category": null, # "translate_keywords": "false", # "include_private": 0 # }, # "type": "Listing", # "pagination": { # "effective_limit": 2, # "effective_offset": 0, # "next_offset": 2, # "effective_page": 1, # "next_page": 2 # } # } # Sample code for parsing the JSON response... # Use the following online tool to generate parsing code from sample JSON: # Generate Parsing Code from JSON set count [CkJsonObject_IntOf $jResp "count"] set paramsLimit [CkJsonObject_stringOf $jResp "params.limit"] set paramsOffset [CkJsonObject_IntOf $jResp "params.offset"] set paramsPage [CkJsonObject_stringOf $jResp "params.page"] set paramsShop_id [CkJsonObject_stringOf $jResp "params.shop_id"] set paramsKeywords [CkJsonObject_stringOf $jResp "params.keywords"] set paramsSort_on [CkJsonObject_stringOf $jResp "params.sort_on"] set paramsSort_order [CkJsonObject_stringOf $jResp "params.sort_order"] set paramsMin_price [CkJsonObject_stringOf $jResp "params.min_price"] set paramsMax_price [CkJsonObject_stringOf $jResp "params.max_price"] set paramsColor [CkJsonObject_stringOf $jResp "params.color"] set paramsColor_accuracy [CkJsonObject_IntOf $jResp "params.color_accuracy"] set paramsTags [CkJsonObject_stringOf $jResp "params.tags"] set paramsCategory [CkJsonObject_stringOf $jResp "params.category"] set paramsTranslate_keywords [CkJsonObject_stringOf $jResp "params.translate_keywords"] set paramsInclude_private [CkJsonObject_IntOf $jResp "params.include_private"] set v_type [CkJsonObject_stringOf $jResp "type"] set paginationEffective_limit [CkJsonObject_IntOf $jResp "pagination.effective_limit"] set paginationEffective_offset [CkJsonObject_IntOf $jResp "pagination.effective_offset"] set paginationNext_offset [CkJsonObject_IntOf $jResp "pagination.next_offset"] set paginationEffective_page [CkJsonObject_IntOf $jResp "pagination.effective_page"] set paginationNext_page [CkJsonObject_IntOf $jResp "pagination.next_page"] set i 0 set count_i [CkJsonObject_SizeOfArray $jResp "results"] while {$i < $count_i} { CkJsonObject_put_I $jResp $i set listing_id [CkJsonObject_IntOf $jResp "results[i].listing_id"] set state [CkJsonObject_stringOf $jResp "results[i].state"] set user_id [CkJsonObject_IntOf $jResp "results[i].user_id"] set category_id [CkJsonObject_IntOf $jResp "results[i].category_id"] set title [CkJsonObject_stringOf $jResp "results[i].title"] set description [CkJsonObject_stringOf $jResp "results[i].description"] set creation_tsz [CkJsonObject_IntOf $jResp "results[i].creation_tsz"] set ending_tsz [CkJsonObject_IntOf $jResp "results[i].ending_tsz"] set original_creation_tsz [CkJsonObject_IntOf $jResp "results[i].original_creation_tsz"] set last_modified_tsz [CkJsonObject_IntOf $jResp "results[i].last_modified_tsz"] set price [CkJsonObject_stringOf $jResp "results[i].price"] set currency_code [CkJsonObject_stringOf $jResp "results[i].currency_code"] set quantity [CkJsonObject_IntOf $jResp "results[i].quantity"] set shop_section_id [CkJsonObject_IntOf $jResp "results[i].shop_section_id"] set featured_rank [CkJsonObject_stringOf $jResp "results[i].featured_rank"] set state_tsz [CkJsonObject_IntOf $jResp "results[i].state_tsz"] set url [CkJsonObject_stringOf $jResp "results[i].url"] set views [CkJsonObject_IntOf $jResp "results[i].views"] set num_favorers [CkJsonObject_IntOf $jResp "results[i].num_favorers"] set shipping_template_id [CkJsonObject_stringOf $jResp "results[i].shipping_template_id"] set processing_min [CkJsonObject_IntOf $jResp "results[i].processing_min"] set processing_max [CkJsonObject_IntOf $jResp "results[i].processing_max"] set who_made [CkJsonObject_stringOf $jResp "results[i].who_made"] set is_supply [CkJsonObject_stringOf $jResp "results[i].is_supply"] set when_made [CkJsonObject_stringOf $jResp "results[i].when_made"] set item_weight [CkJsonObject_stringOf $jResp "results[i].item_weight"] set item_weight_unit [CkJsonObject_stringOf $jResp "results[i].item_weight_unit"] set item_length [CkJsonObject_stringOf $jResp "results[i].item_length"] set item_width [CkJsonObject_stringOf $jResp "results[i].item_width"] set item_height [CkJsonObject_stringOf $jResp "results[i].item_height"] set item_dimensions_unit [CkJsonObject_stringOf $jResp "results[i].item_dimensions_unit"] set is_private [CkJsonObject_BoolOf $jResp "results[i].is_private"] set recipient [CkJsonObject_stringOf $jResp "results[i].recipient"] set occasion [CkJsonObject_stringOf $jResp "results[i].occasion"] set style [CkJsonObject_stringOf $jResp "results[i].style"] set non_taxable [CkJsonObject_BoolOf $jResp "results[i].non_taxable"] set is_customizable [CkJsonObject_BoolOf $jResp "results[i].is_customizable"] set is_digital [CkJsonObject_BoolOf $jResp "results[i].is_digital"] set file_data [CkJsonObject_stringOf $jResp "results[i].file_data"] set should_auto_renew [CkJsonObject_BoolOf $jResp "results[i].should_auto_renew"] set language [CkJsonObject_stringOf $jResp "results[i].language"] set has_variations [CkJsonObject_BoolOf $jResp "results[i].has_variations"] set taxonomy_id [CkJsonObject_IntOf $jResp "results[i].taxonomy_id"] set used_manufacturer [CkJsonObject_BoolOf $jResp "results[i].used_manufacturer"] set j 0 set count_j [CkJsonObject_SizeOfArray $jResp "results[i].sku"] while {$j < $count_j} { CkJsonObject_put_J $jResp $j set j [expr $j + 1] } set j 0 set count_j [CkJsonObject_SizeOfArray $jResp "results[i].tags"] while {$j < $count_j} { CkJsonObject_put_J $jResp $j set strVal [CkJsonObject_stringOf $jResp "results[i].tags[j]"] set j [expr $j + 1] } set j 0 set count_j [CkJsonObject_SizeOfArray $jResp "results[i].category_path"] while {$j < $count_j} { CkJsonObject_put_J $jResp $j set strVal [CkJsonObject_stringOf $jResp "results[i].category_path[j]"] set j [expr $j + 1] } set j 0 set count_j [CkJsonObject_SizeOfArray $jResp "results[i].category_path_ids"] while {$j < $count_j} { CkJsonObject_put_J $jResp $j set intVal [CkJsonObject_IntOf $jResp "results[i].category_path_ids[j]"] set j [expr $j + 1] } set j 0 set count_j [CkJsonObject_SizeOfArray $jResp "results[i].materials"] while {$j < $count_j} { CkJsonObject_put_J $jResp $j set strVal [CkJsonObject_stringOf $jResp "results[i].materials[j]"] set j [expr $j + 1] } set j 0 set count_j [CkJsonObject_SizeOfArray $jResp "results[i].taxonomy_path"] while {$j < $count_j} { CkJsonObject_put_J $jResp $j set strVal [CkJsonObject_stringOf $jResp "results[i].taxonomy_path[j]"] set j [expr $j + 1] } set j 0 set count_j [CkJsonObject_SizeOfArray $jResp "results[i].style"] while {$j < $count_j} { CkJsonObject_put_J $jResp $j set strVal [CkJsonObject_stringOf $jResp "results[i].style[j]"] set j [expr $j + 1] } set i [expr $i + 1] } delete_CkHttp $http delete_CkStringBuilder $sbResponseBody delete_CkJsonObject $jResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.