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) SCIS Search

See more SCiS Schools Catalogue Examples

Demonstrates the SCIS (Schools Catalogue Information Service) search API call.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL lnSuccess
LOCAL loSbQuery
LOCAL loSbUrl
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode
LOCAL lcV_index
LOCAL lcV_type
LOCAL lnV_sourceDateIssuedMarc
LOCAL lcV_sourceIsbn13
LOCAL lcV_sourceImageFileName
LOCAL lcV_sourcePublicationDetails
LOCAL lcV_sourceIsbn10
LOCAL lcV_sourceId
LOCAL lcV_id
LOCAL lcV_score
LOCAL j
LOCAL lnCount_j
LOCAL lcStrVal
LOCAL lnDataHitsTotal
LOCAL lcDataHitsMax_score
LOCAL lnDataTook
LOCAL lnDataTimed_out
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 -i -X GET --url 'https://api.scisdata.com/catalogue/api/search?query=titleSearch%3Adogs%20AND%20publicationYear%3A2015&from=0&size=20&sort=author&order=asc' -H 'Authorization: Basic ****'

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

* This causes the "Authorization: Basic ****" to be added to each request.
loHttp.Login = "myLogin"
loHttp.Password = "myPassword"
loHttp.BasicAuth = 1

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbQuery = CreateObject('Chilkat.StringBuilder')
loSbQuery.Append("titleSearch:dogs AND publicationYear:2015")

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbUrl = CreateObject('Chilkat.StringBuilder')
loSbUrl.Append("https://api.scisdata.com/catalogue/api/search?query=")
* If non-usascii chars are included in the search, we don't know if utf-8 or windows-1252 is desired by the server.  You'll need to find out..
loSbUrl.Append(loSbQuery.GetEncoded("url","utf-8"))
loSbUrl.Append("&from=0&size=20&sort=author&order=asc")

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponseBody = CreateObject('Chilkat.StringBuilder')
lnSuccess = loHttp.QuickGetSb(loSbUrl.GetAsString(),loSbResponseBody)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loSbQuery
    RELEASE loSbUrl
    RELEASE loSbResponseBody
    CANCEL
ENDIF

* 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 = loHttp.LastStatus
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode >= 400) THEN
    ? "Response Header:"
    ? loHttp.LastHeader
    ? "Failed."
    RELEASE loHttp
    RELEASE loSbQuery
    RELEASE loSbUrl
    RELEASE loSbResponseBody
    RELEASE loJResp
    CANCEL
ENDIF

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

* {
*   "data": {
*     "hits": {
*       "hits": [
*         {
*           "_index": "scisdata2",
*           "_type": "bibdatatype",
*           "_source": {
*             "isbn": [
*               "9781517638160"
*             ],
*             "languageTermCode": [
*               "eng"
*             ],
*             "mainAuthor": {
*               "namePersonalPrimary": [
*                 "Abbott, Eleanor Hallowell."
*               ]
*             },
*             "title": {
*               "titlePrimary": [
*                 "Peace on Earth, good-will to dogs"
*               ],
*               "noteStmOfResponsibility": [
*                 "by Eleanor Hallowell Abbott."
*               ]
*             },
*             "scisType": [
*               "Book"
*             ],
*             "dateIssuedMarc": 2015,
*             "languageTermValue": [
*               "English"
*             ],
*             "contributor": {},
*             "isbn13": "9781517638160",
*             "imageFileName": "9781517638160.jpg",
*             "publicationDetails": "United States, Create Space Independent Publishing Platform, 2015",
*             "isbn10": "151763816X",
*             "id": "1867852"
*           },
*           "_id": "1867852",
*           "sort": [
*             "abbott, eleanor hallowell."
*           ],
*           "_score": null
*         },
*         {
*           "_index": "scisdata2",
*           "_type": "bibdatatype",
*           "_source": {
*             "isbn": [
*               "9781780747910"
*             ],
*             "languageTermCode": [
*               "eng"
*             ],
*             "mainAuthor": {
*               "namePersonalPrimary": [
*                 "Adams, Richard."
*               ]
*             },
*             "title": {
*               "titlePrimary": [
*                 "The plague dogs"
*               ],
*               "noteStmOfResponsibility": [
*                 "Richard Adams."
*               ]
*             },
*             "scisType": [
*               "Book"
*             ],
*             "dateIssuedMarc": 2015,
*             "languageTermValue": [
*               "English"
*             ],
*             "contributor": {},
*             "isbn13": "9781780747910",
*             "imageFileName": "9781780747910.jpg",
*             "publicationDetails": "New York, Rock the Boat, 2015",
*             "isbn10": "1780747918",
*             "id": "1749228"
*           },
*           "_id": "1749228",
*           "sort": [
*             "adams, richard."
*           ],
*           "_score": null
*         },
*          ...
*       ],
*       "total": 84,
*       "max_score": null
*     },
*     "took": 585,
*     "timed_out": false
*   },
*   "subscriptionStatus": {}
* }

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

lnDataHitsTotal = loJResp.IntOf("data.hits.total")
lcDataHitsMax_score = loJResp.StringOf("data.hits.max_score")
lnDataTook = loJResp.IntOf("data.took")
lnDataTimed_out = loJResp.BoolOf("data.timed_out")
i = 0
lnCount_i = loJResp.SizeOfArray("data.hits.hits")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcV_index = loJResp.StringOf("data.hits.hits[i]._index")
    lcV_type = loJResp.StringOf("data.hits.hits[i]._type")
    lnV_sourceDateIssuedMarc = loJResp.IntOf("data.hits.hits[i]._source.dateIssuedMarc")
    lcV_sourceIsbn13 = loJResp.StringOf("data.hits.hits[i]._source.isbn13")
    lcV_sourceImageFileName = loJResp.StringOf("data.hits.hits[i]._source.imageFileName")
    lcV_sourcePublicationDetails = loJResp.StringOf("data.hits.hits[i]._source.publicationDetails")
    lcV_sourceIsbn10 = loJResp.StringOf("data.hits.hits[i]._source.isbn10")
    lcV_sourceId = loJResp.StringOf("data.hits.hits[i]._source.id")
    lcV_id = loJResp.StringOf("data.hits.hits[i]._id")
    lcV_score = loJResp.StringOf("data.hits.hits[i]._score")
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.isbn")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.isbn[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.languageTermCode")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.languageTermCode[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.mainAuthor.namePersonalPrimary")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.mainAuthor.namePersonalPrimary[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.title.titlePrimary")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.title.titlePrimary[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.title.noteStmOfResponsibility")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.title.noteStmOfResponsibility[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.scisType")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.scisType[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.languageTermValue")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.languageTermValue[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i].sort")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i].sort[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.contributor.namePersonalOther")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.contributor.namePersonalOther[j]")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJResp.SizeOfArray("data.hits.hits[i]._source.contributor.nameCorporateOther")
    DO WHILE j < lnCount_j
        loJResp.J = j
        lcStrVal = loJResp.StringOf("data.hits.hits[i]._source.contributor.nameCorporateOther[j]")
        j = j + 1
    ENDDO
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loSbQuery
RELEASE loSbUrl
RELEASE loSbResponseBody
RELEASE loJResp


 

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