Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Visual FoxPro Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

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

 

 

 

(Visual FoxPro) Faire - Get All Products

See more Faire Examples

Retrieves a list of products, ordered ascending by updated_at. By default, it only returns non-deleted products.

For more information, see https://faire.github.io/external-api-docs/#get-all-products

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL lnSuccess
LOCAL loQueryParams
LOCAL loResp
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode
LOCAL lcId
LOCAL lcBrand_id
LOCAL lcShort_description
LOCAL lcDescription
LOCAL lnWholesale_price_cents
LOCAL lnRetail_price_cents
LOCAL lcSale_state
LOCAL lnActive
LOCAL lnDeleted
LOCAL lcName
LOCAL lnUnit_multiplier
LOCAL lcTaxonomy_typeId
LOCAL lcTaxonomy_typeName
LOCAL lcCreated_at
LOCAL lcUpdated_at
LOCAL j
LOCAL lnCount_j
LOCAL lnPage
LOCAL lnLimit
LOCAL i
LOCAL lnCount_i

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

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')

* Implements the following CURL command:

* curl -X GET -H "X-FAIRE-ACCESS-TOKEN: <access_token>" -d "limit=50" -d "page=1" https://www.faire.com/api/v1/products

* Use the following online tool to generate HTTP code from a CURL command
* Convert a cURL Command to HTTP Source Code

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loQueryParams = CreateObject('Chilkat.JsonObject')
loQueryParams.UpdateInt("limit",50)
loQueryParams.UpdateInt("page",1)

loHttp.SetRequestHeader("X-FAIRE-ACCESS-TOKEN","<access_token>")

loResp = loHttp.QuickRequestParams("GET","https://www.faire.com/api/v1/products",loQueryParams)
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loQueryParams
    CANCEL
ENDIF

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponseBody = CreateObject('Chilkat.StringBuilder')
loResp.GetBodySb(loSbResponseBody)

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJResp = CreateObject('Chilkat.JsonObject')
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = 0

? "Response Body:"
? loJResp.Emit()

lnRespStatusCode = loResp.StatusCode
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode >= 400) THEN
    ? "Response Header:"
    ? loResp.Header
    ? "Failed."
    RELEASE loResp
    RELEASE loHttp
    RELEASE loQueryParams
    RELEASE loSbResponseBody
    RELEASE loJResp
    CANCEL
ENDIF

RELEASE loResp

* Sample JSON response:
* (Sample code for parsing the JSON response is shown below)

* {
*   "page": 1,
*   "limit": 50,
*   "products": [
*     {
*       "id": "p_123",
*       "brand_id": "b_abc",
*       "short_description": "Our candles smell fantastic. Want to know how good? Read our description!",
*       "description": "Glad you decided to read our description! We have significantly more characters to describe to you just how good our candles smell.",
*       "wholesale_price_cents": 500,
*       "retail_price_cents": 1000,
*       "sale_state": "FOR_SALE",
*       "active": true,
*       "deleted": false,
*       "name": "Faire's fantastic candle",
*       "unit_multiplier": 8,
*       "taxonomy_type": {
*         "id": "tt_23nl3bzl00",
*         "name": "Votive Candle"
*       },
*       "options": [
*       ],
*       "created_at": "20190314T000915.000Z",
*       "updated_at": "20190315T000915.000Z"
*     }
*   ]
* }

* Sample code for parsing the JSON response...
* Use the following online tool to generate parsing code from sample JSON:
* Generate Parsing Code from JSON

lnPage = loJResp.IntOf("page")
lnLimit = loJResp.IntOf("limit")
i = 0
lnCount_i = loJResp.SizeOfArray("products")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcId = loJResp.StringOf("products[i].id")
    lcBrand_id = loJResp.StringOf("products[i].brand_id")
    lcShort_description = loJResp.StringOf("products[i].short_description")
    lcDescription = loJResp.StringOf("products[i].description")
    lnWholesale_price_cents = loJResp.IntOf("products[i].wholesale_price_cents")
    lnRetail_price_cents = loJResp.IntOf("products[i].retail_price_cents")
    lcSale_state = loJResp.StringOf("products[i].sale_state")
    lnActive = loJResp.BoolOf("products[i].active")
    lnDeleted = loJResp.BoolOf("products[i].deleted")
    lcName = loJResp.StringOf("products[i].name")
    lnUnit_multiplier = loJResp.IntOf("products[i].unit_multiplier")
    lcTaxonomy_typeId = loJResp.StringOf("products[i].taxonomy_type.id")
    lcTaxonomy_typeName = loJResp.StringOf("products[i].taxonomy_type.name")
    lcCreated_at = loJResp.StringOf("products[i].created_at")
    lcUpdated_at = loJResp.StringOf("products[i].updated_at")
    j = 0
    lnCount_j = loJResp.SizeOfArray("products[i].options")
    DO WHILE j < lnCount_j
        loJResp.J = j
        j = j + 1
    ENDDO
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loQueryParams
RELEASE loSbResponseBody
RELEASE loJResp


 

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