Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

MFC Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Bitfinex v2 REST
Bluzone
BrickLink
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun
Mastercard

MedTunnel
MercadoLibre
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
Trello
Twilio
Twitter
UniPin
VoiceBase
Vonage
Walmart
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yousign
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(MFC) Etsy: Find a Shop's Active Listings

Finds all active Listings associated with a Shop.

For more information, see https://www.etsy.com/developers/documentation/reference/listing

Chilkat C/C++ Library Downloads

MS Visual C/C++ Libs

See Also: Using MFC CString in Chilkat

#include <CkHttp.h>
#include <CkStringBuilder.h>
#include <CkJsonObject.h>

void ChilkatSample(void)
    {
    CkString strOut;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttp http;
    bool success;

    // 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

    CkStringBuilder sbResponseBody;
    success = http.QuickGetSb("https://openapi.etsy.com/v2/shops/shop_id/listings/active?api_key=MY_ETSY_KEYSTRING&limit=2",sbResponseBody);
    if (success == false) {
        strOut.append(http.lastErrorText());
        strOut.append("\r\n");
        SetDlgItemText(IDC_EDIT1,strOut.getUnicode());
        return;
    }

    CkJsonObject jResp;
    jResp.LoadSb(sbResponseBody);
    jResp.put_EmitCompact(false);

    strOut.append("Response Body:");
    strOut.append("\r\n");
    strOut.append(jResp.emit());
    strOut.append("\r\n");

    int respStatusCode = http.get_LastStatus();
    strOut.append("Response Status Code = ");
    strOut.appendInt(respStatusCode);
    strOut.append("\r\n");
    if (respStatusCode >= 400) {
        strOut.append("Response Header:");
        strOut.append("\r\n");
        strOut.append(http.lastHeader());
        strOut.append("\r\n");
        strOut.append("Failed.");
        strOut.append("\r\n");
        SetDlgItemText(IDC_EDIT1,strOut.getUnicode());
        return;
    }

    // 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&quot;)\nWidth: 36cm (14 1\/4 )\nDepth: 6 cm ( 2 1\/2&quot;)",
    //       "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&quot; width 4&quot;, depth 1 1\/4&quot;)\n\nRed Figure:\nHeight 61,5cm, width 9cm, depth 3cm\n(Height 24&quot; width 3 1\/2&quot;, depth 1 1\/4&quot;)\n\nIf you&#39;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

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
    // See this example explaining how this memory should be used: const char * functions.

    int listing_id;
    const char *state = 0;
    int user_id;
    int category_id;
    const char *title = 0;
    const char *description = 0;
    int creation_tsz;
    int ending_tsz;
    int original_creation_tsz;
    int last_modified_tsz;
    const char *price = 0;
    const char *currency_code = 0;
    int quantity;
    int shop_section_id;
    const char *featured_rank = 0;
    int state_tsz;
    const char *url = 0;
    int views;
    int num_favorers;
    const char *shipping_template_id = 0;
    int processing_min;
    int processing_max;
    const char *who_made = 0;
    const char *is_supply = 0;
    const char *when_made = 0;
    const char *item_weight = 0;
    const char *item_weight_unit = 0;
    const char *item_length = 0;
    const char *item_width = 0;
    const char *item_height = 0;
    const char *item_dimensions_unit = 0;
    bool is_private;
    const char *recipient = 0;
    const char *occasion = 0;
    const char *style = 0;
    bool non_taxable;
    bool is_customizable;
    bool is_digital;
    const char *file_data = 0;
    bool should_auto_renew;
    const char *language = 0;
    bool has_variations;
    int taxonomy_id;
    bool used_manufacturer;
    int j;
    int count_j;
    const char *strVal = 0;
    int intVal;

    int count = jResp.IntOf("count");
    const char *paramsLimit = jResp.stringOf("params.limit");
    int paramsOffset = jResp.IntOf("params.offset");
    const char *paramsPage = jResp.stringOf("params.page");
    const char *paramsShop_id = jResp.stringOf("params.shop_id");
    const char *paramsKeywords = jResp.stringOf("params.keywords");
    const char *paramsSort_on = jResp.stringOf("params.sort_on");
    const char *paramsSort_order = jResp.stringOf("params.sort_order");
    const char *paramsMin_price = jResp.stringOf("params.min_price");
    const char *paramsMax_price = jResp.stringOf("params.max_price");
    const char *paramsColor = jResp.stringOf("params.color");
    int paramsColor_accuracy = jResp.IntOf("params.color_accuracy");
    const char *paramsTags = jResp.stringOf("params.tags");
    const char *paramsCategory = jResp.stringOf("params.category");
    const char *paramsTranslate_keywords = jResp.stringOf("params.translate_keywords");
    int paramsInclude_private = jResp.IntOf("params.include_private");
    const char *v_type = jResp.stringOf("type");
    int paginationEffective_limit = jResp.IntOf("pagination.effective_limit");
    int paginationEffective_offset = jResp.IntOf("pagination.effective_offset");
    int paginationNext_offset = jResp.IntOf("pagination.next_offset");
    int paginationEffective_page = jResp.IntOf("pagination.effective_page");
    int paginationNext_page = jResp.IntOf("pagination.next_page");
    int i = 0;
    int count_i = jResp.SizeOfArray("results");
    while (i < count_i) {
        jResp.put_I(i);
        listing_id = jResp.IntOf("results[i].listing_id");
        state = jResp.stringOf("results[i].state");
        user_id = jResp.IntOf("results[i].user_id");
        category_id = jResp.IntOf("results[i].category_id");
        title = jResp.stringOf("results[i].title");
        description = jResp.stringOf("results[i].description");
        creation_tsz = jResp.IntOf("results[i].creation_tsz");
        ending_tsz = jResp.IntOf("results[i].ending_tsz");
        original_creation_tsz = jResp.IntOf("results[i].original_creation_tsz");
        last_modified_tsz = jResp.IntOf("results[i].last_modified_tsz");
        price = jResp.stringOf("results[i].price");
        currency_code = jResp.stringOf("results[i].currency_code");
        quantity = jResp.IntOf("results[i].quantity");
        shop_section_id = jResp.IntOf("results[i].shop_section_id");
        featured_rank = jResp.stringOf("results[i].featured_rank");
        state_tsz = jResp.IntOf("results[i].state_tsz");
        url = jResp.stringOf("results[i].url");
        views = jResp.IntOf("results[i].views");
        num_favorers = jResp.IntOf("results[i].num_favorers");
        shipping_template_id = jResp.stringOf("results[i].shipping_template_id");
        processing_min = jResp.IntOf("results[i].processing_min");
        processing_max = jResp.IntOf("results[i].processing_max");
        who_made = jResp.stringOf("results[i].who_made");
        is_supply = jResp.stringOf("results[i].is_supply");
        when_made = jResp.stringOf("results[i].when_made");
        item_weight = jResp.stringOf("results[i].item_weight");
        item_weight_unit = jResp.stringOf("results[i].item_weight_unit");
        item_length = jResp.stringOf("results[i].item_length");
        item_width = jResp.stringOf("results[i].item_width");
        item_height = jResp.stringOf("results[i].item_height");
        item_dimensions_unit = jResp.stringOf("results[i].item_dimensions_unit");
        is_private = jResp.BoolOf("results[i].is_private");
        recipient = jResp.stringOf("results[i].recipient");
        occasion = jResp.stringOf("results[i].occasion");
        style = jResp.stringOf("results[i].style");
        non_taxable = jResp.BoolOf("results[i].non_taxable");
        is_customizable = jResp.BoolOf("results[i].is_customizable");
        is_digital = jResp.BoolOf("results[i].is_digital");
        file_data = jResp.stringOf("results[i].file_data");
        should_auto_renew = jResp.BoolOf("results[i].should_auto_renew");
        language = jResp.stringOf("results[i].language");
        has_variations = jResp.BoolOf("results[i].has_variations");
        taxonomy_id = jResp.IntOf("results[i].taxonomy_id");
        used_manufacturer = jResp.BoolOf("results[i].used_manufacturer");
        j = 0;
        count_j = jResp.SizeOfArray("results[i].sku");
        while (j < count_j) {
            jResp.put_J(j);
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("results[i].tags");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("results[i].tags[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("results[i].category_path");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("results[i].category_path[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("results[i].category_path_ids");
        while (j < count_j) {
            jResp.put_J(j);
            intVal = jResp.IntOf("results[i].category_path_ids[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("results[i].materials");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("results[i].materials[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("results[i].taxonomy_path");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("results[i].taxonomy_path[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("results[i].style");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("results[i].style[j]");
            j = j + 1;
        }

        i = i + 1;
    }



    SetDlgItemText(IDC_EDIT1,strOut.getUnicode());

    }

 

© 2000-2022 Chilkat Software, Inc. All Rights Reserved.