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

Visual FoxPro Web API Examples

Primary Categories

ABN AMRO
AWS Translate
Activix CRM
Adyen
Amazon DynamoDB
Amazon MWS
Amazon Rekognition
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bitfinex v2 REST
Bluzone
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
ETrade
Egypt ITIDA
Etsy
Facebook
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
MedTunnel
MercadoLibre

Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Okta OAuth/OIDC
OneLogin OIDC
OneNote
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
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
VoiceBase
Vonage
Walmart
Walmart v3
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yousign
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(Visual FoxPro) Constant Contact - View List Members

View the list membership by making a GET call to the Contact Collection endpointl

For more information, see https://v3.developer.constantcontact.com/api_guide/lists_overview.html#example-request---get-list-membership

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL lnSuccess
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode
LOCAL lcContact_id
LOCAL lcEmail_addressAddress
LOCAL lcEmail_addressPermission_to_send
LOCAL lcEmail_addressCreated_at
LOCAL lcEmail_addressUpdated_at
LOCAL lcEmail_addressOpt_in_source
LOCAL lcEmail_addressOpt_in_date
LOCAL lcEmail_addressConfirm_status
LOCAL lcFirst_name
LOCAL lcLast_name
LOCAL lcUpdate_source
LOCAL lcCreate_source
LOCAL lcCreated_at
LOCAL lcUpdated_at
LOCAL lcJob_title
LOCAL lcCompany_name
LOCAL lnBirthday_month
LOCAL lnBirthday_day
LOCAL lcAnniversary
LOCAL i
LOCAL lnCount_i

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

* Implements the following CURL command:

* curl -X GET \
*   'https://api.cc.email/v3/contacts?lists={list_id},{list_id2}' \
*   -H 'accept: application/json' \
*   -H 'authorization: Bearer {access_token}' \
*   -H 'cache-control: no-cache' \
*   -H 'content-type: application/json'

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

loHttp.SetRequestHeader("content-type","application/json")
* Adds the "Authorization: Bearer ACCESS_TOKEN" header.
loHttp.AuthToken = "ACCESS_TOKEN"
loHttp.SetRequestHeader("cache-control","no-cache")
loHttp.SetRequestHeader("accept","application/json")

loSbResponseBody = CreateObject('Chilkat_9_5_0.StringBuilder')
lnSuccess = loHttp.QuickGetSb("https://api.cc.email/v3/contacts?lists={list_id},{list_id2}",loSbResponseBody)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loSbResponseBody
    CANCEL
ENDIF

loJResp = CreateObject('Chilkat_9_5_0.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 loSbResponseBody
    RELEASE loJResp
    CANCEL
ENDIF

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

* {
*   "contacts": [
*     {
*       "contact_id": "{contact_id}",
*       "email_address": {
*         "address": "dprice@example.com",
*         "permission_to_send": "implicit",
*         "created_at": "2013-11-26T15:45:42-05:00",
*         "updated_at": "2013-11-26T15:45:42-05:00",
*         "opt_in_source": "Account",
*         "opt_in_date": "2013-11-26T15:45:42-05:00",
*         "confirm_status": "off"
*       },
*       "first_name": "David",
*       "last_name": "Price",
*       "update_source": "Account",
*       "create_source": "Account",
*       "created_at": "2013-11-26T15:45:42-05:00",
*       "updated_at": "2017-09-06T15:48:31-04:00"
*     },
*     {
*       "contact_id": "{contact_id}",
*       "email_address": {
*         "address": "jprice@example.com",
*         "permission_to_send": "implicit",
*         "created_at": "2013-11-26T15:45:50-05:00",
*         "updated_at": "2013-11-26T15:45:50-05:00",
*         "opt_in_source": "Account",
*         "opt_in_date": "2013-11-26T15:45:50-05:00",
*         "confirm_status": "off"
*       },
*       "first_name": "Jennifer",
*       "last_name": "Price",
*       "create_source": "Account",
*       "created_at": "2013-11-26T15:45:50-05:00",
*       "updated_at": "2013-11-26T15:45:50-05:00"
*     },
*     {
*       "contact_id": "{contact_id}",
*       "email_address": {
*         "address": "joe.jones@example.com",
*         "permission_to_send": "implicit",
*         "created_at": "2017-11-06T15:35:30-05:00",
*         "updated_at": "2017-11-06T15:35:30-05:00",
*         "opt_in_source": "Account",
*         "opt_in_date": "2017-11-06T15:35:30-05:00",
*         "confirm_status": "off"
*       },
*       "first_name": "Joe",
*       "last_name": "Jones",
*       "job_title": "Chief Innovation Officer",
*       "company_name": "RelativeGravity, Inc.",
*       "birthday_month": 11,
*       "birthday_day": 24,
*       "anniversary": "2006-11-15",
*       "create_source": "Account",
*       "created_at": "2017-11-06T15:35:30-05:00",
*       "updated_at": "2017-11-06T15:35:30-05:00"
*     },
*     {
*       "contact_id": "{contact_id}",
*       "email_address": {
*         "address": "mmiller@example.com",
*         "permission_to_send": "implicit",
*         "created_at": "2013-11-26T15:46:04-05:00",
*         "updated_at": "2013-11-26T15:46:04-05:00",
*         "opt_in_source": "Account",
*         "opt_in_date": "2013-11-26T15:46:04-05:00",
*         "confirm_status": "off"
*       },
*       "first_name": "Mike",
*       "last_name": "Miller.",
*       "create_source": "Account",
*       "created_at": "2013-11-26T15:46:04-05:00",
*       "updated_at": "2013-11-26T15:46:04-05:00"
*     },
*     {
*       "contact_id": "{contact_id}",
*       "email_address": {
*         "address": "sheryl.kavanaugh@example.com",
*         "permission_to_send": "implicit",
*         "created_at": "2013-11-26T15:46:10-05:00",
*         "updated_at": "2013-11-26T15:46:10-05:00",
*         "opt_in_source": "Account",
*         "opt_in_date": "2013-11-26T15:46:10-05:00",
*         "confirm_status": "off"
*       },
*       "first_name": "Sheryl",
*       "last_name": "Kavanaugh",
*       "create_source": "Account",
*       "created_at": "2013-11-26T15:46:10-05:00",
*       "updated_at": "2013-11-26T15:46:10-05:00"
*     }
*   ]
* }

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

i = 0
lnCount_i = loJResp.SizeOfArray("contacts")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcContact_id = loJResp.StringOf("contacts[i].contact_id")
    lcEmail_addressAddress = loJResp.StringOf("contacts[i].email_address.address")
    lcEmail_addressPermission_to_send = loJResp.StringOf("contacts[i].email_address.permission_to_send")
    lcEmail_addressCreated_at = loJResp.StringOf("contacts[i].email_address.created_at")
    lcEmail_addressUpdated_at = loJResp.StringOf("contacts[i].email_address.updated_at")
    lcEmail_addressOpt_in_source = loJResp.StringOf("contacts[i].email_address.opt_in_source")
    lcEmail_addressOpt_in_date = loJResp.StringOf("contacts[i].email_address.opt_in_date")
    lcEmail_addressConfirm_status = loJResp.StringOf("contacts[i].email_address.confirm_status")
    lcFirst_name = loJResp.StringOf("contacts[i].first_name")
    lcLast_name = loJResp.StringOf("contacts[i].last_name")
    lcUpdate_source = loJResp.StringOf("contacts[i].update_source")
    lcCreate_source = loJResp.StringOf("contacts[i].create_source")
    lcCreated_at = loJResp.StringOf("contacts[i].created_at")
    lcUpdated_at = loJResp.StringOf("contacts[i].updated_at")
    lcJob_title = loJResp.StringOf("contacts[i].job_title")
    lcCompany_name = loJResp.StringOf("contacts[i].company_name")
    lnBirthday_month = loJResp.IntOf("contacts[i].birthday_month")
    lnBirthday_day = loJResp.IntOf("contacts[i].birthday_day")
    lcAnniversary = loJResp.StringOf("contacts[i].anniversary")
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loSbResponseBody
RELEASE loJResp


 

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