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) Docusign: Return Brand Data Associated with a User

Demonstrates a call using an OAuth2 access token in combination with the account ID for which we have authorization.

For more information, see https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-jsonwebtoken

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL lnSuccess
LOCAL loJsonToken
LOCAL loSbResponseBody
LOCAL loJson
LOCAL lnRespStatusCode
LOCAL lcBrandCompany
LOCAL lcBrandId
LOCAL lcBrandName
LOCAL lcErrorDetailsErrorCode
LOCAL lcErrorDetailsMessage
LOCAL lcIsOverridingCompanyName
LOCAL lcIsSendingDefault
LOCAL lcIsSigningDefault
LOCAL lcLogosPrimary
LOCAL lcLogosSecondary
LOCAL lcLogosEmail
LOCAL lcResourcesEmail
LOCAL lcResourcesSending
LOCAL lcResourcesSigning
LOCAL lcResourcesSigningCaptive
LOCAL j
LOCAL lnCount_j
LOCAL lcLinkType
LOCAL lcUrlOrMailTo
LOCAL lcLinkText
LOCAL lcShowLink
LOCAL lcEmailContentType
LOCAL lcContent
LOCAL lcEmailToLink
LOCAL lcRecipientBrandIdDefault
LOCAL lcSenderBrandIdDefault
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 --request GET https://account-d.docusign.com/restapi/v2/accounts/18b4799a-xxxx-xxxx-xxxx-b5b4b8a97604/brands --header "Authorization: Bearer eyJ0eXAi.....UE8Kl_V8KroQ"

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

* Adds the "Authorization: Bearer eyJ0eXAi.....UE8Kl_V8KroQ" header.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJsonToken = CreateObject('Chilkat.JsonObject')
* Load a previously obtained OAuth2 access token.
lnSuccess = loJsonToken.LoadFile("qa_data/tokens/docusign.json")
IF (lnSuccess = 0) THEN
    ? loJsonToken.LastErrorText
    RELEASE loHttp
    RELEASE loJsonToken
    CANCEL
ENDIF

loHttp.AuthToken = loJsonToken.StringOf("access_token")

* Use an account ID obtained from DocuSign Get User Account Data
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponseBody = CreateObject('Chilkat.StringBuilder')
lnSuccess = loHttp.QuickGetSb("https://account-d.docusign.com/restapi/v2/accounts/18b4799a-xxxx-xxxx-xxxx-b5b4b8a97604/brands",loSbResponseBody)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loJsonToken
    RELEASE loSbResponseBody
    CANCEL
ENDIF

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

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

lnRespStatusCode = loHttp.LastStatus
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode >= 400) THEN
    ? "Response Header:"
    ? loHttp.LastHeader
    ? "Failed."
    RELEASE loHttp
    RELEASE loJsonToken
    RELEASE loSbResponseBody
    RELEASE loJson
    CANCEL
ENDIF

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

* {
*   "recipientBrandIdDefault": "sample string 1",
*   "senderBrandIdDefault": "sample string 2",
*   "brands": [
*     {
*       "brandCompany": "sample string 1",
*       "brandId": "sample string 2",
*       "brandName": "sample string 3",
*       "colors": [
*         {}
*       ],
*       "errorDetails": {
*         "errorCode": "sample string 1",
*         "message": "sample string 2"
*       },
*       "isOverridingCompanyName": "sample string 4",
*       "isSendingDefault": "sample string 5",
*       "isSigningDefault": "sample string 6",
*       "landingPages": [
*         {}
*       ],
*       "links": [
*         {
*           "linkType": "sample string 1",
*           "urlOrMailTo": "sample string 2",
*           "linkText": "sample string 3",
*           "showLink": "sample string 4"
*         }
*       ],
*       "emailContent": [
*         {
*           "emailContentType": "sample string 1",
*           "content": "sample string 2",
*           "emailToLink": "sample string 3",
*           "linkText": "sample string 4"
*         }
*       ],
*       "logos": {
*         "primary": "sample string 1",
*         "secondary": "sample string 2",
*         "email": "sample string 3"
*       },
*       "resources": {
*         "email": "sample string 1",
*         "sending": "sample string 2",
*         "signing": "sample string 3",
*         "signingCaptive": "sample string 4"
*       }
*     }
*   ]
* }

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

lcRecipientBrandIdDefault = loJson.StringOf("recipientBrandIdDefault")
lcSenderBrandIdDefault = loJson.StringOf("senderBrandIdDefault")
i = 0
lnCount_i = loJson.SizeOfArray("brands")
DO WHILE i < lnCount_i
    loJson.I = i
    lcBrandCompany = loJson.StringOf("brands[i].brandCompany")
    lcBrandId = loJson.StringOf("brands[i].brandId")
    lcBrandName = loJson.StringOf("brands[i].brandName")
    lcErrorDetailsErrorCode = loJson.StringOf("brands[i].errorDetails.errorCode")
    lcErrorDetailsMessage = loJson.StringOf("brands[i].errorDetails.message")
    lcIsOverridingCompanyName = loJson.StringOf("brands[i].isOverridingCompanyName")
    lcIsSendingDefault = loJson.StringOf("brands[i].isSendingDefault")
    lcIsSigningDefault = loJson.StringOf("brands[i].isSigningDefault")
    lcLogosPrimary = loJson.StringOf("brands[i].logos.primary")
    lcLogosSecondary = loJson.StringOf("brands[i].logos.secondary")
    lcLogosEmail = loJson.StringOf("brands[i].logos.email")
    lcResourcesEmail = loJson.StringOf("brands[i].resources.email")
    lcResourcesSending = loJson.StringOf("brands[i].resources.sending")
    lcResourcesSigning = loJson.StringOf("brands[i].resources.signing")
    lcResourcesSigningCaptive = loJson.StringOf("brands[i].resources.signingCaptive")
    j = 0
    lnCount_j = loJson.SizeOfArray("brands[i].colors")
    DO WHILE j < lnCount_j
        loJson.J = j
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJson.SizeOfArray("brands[i].landingPages")
    DO WHILE j < lnCount_j
        loJson.J = j
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJson.SizeOfArray("brands[i].links")
    DO WHILE j < lnCount_j
        loJson.J = j
        lcLinkType = loJson.StringOf("brands[i].links[j].linkType")
        lcUrlOrMailTo = loJson.StringOf("brands[i].links[j].urlOrMailTo")
        lcLinkText = loJson.StringOf("brands[i].links[j].linkText")
        lcShowLink = loJson.StringOf("brands[i].links[j].showLink")
        j = j + 1
    ENDDO
    j = 0
    lnCount_j = loJson.SizeOfArray("brands[i].emailContent")
    DO WHILE j < lnCount_j
        loJson.J = j
        lcEmailContentType = loJson.StringOf("brands[i].emailContent[j].emailContentType")
        lcContent = loJson.StringOf("brands[i].emailContent[j].content")
        lcEmailToLink = loJson.StringOf("brands[i].emailContent[j].emailToLink")
        lcLinkText = loJson.StringOf("brands[i].emailContent[j].linkText")
        j = j + 1
    ENDDO
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loJsonToken
RELEASE loSbResponseBody
RELEASE loJson


 

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