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
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) GetHarvest - Test Personal Access Token

Demonstrates how to test your GetHarvest Personal Access Token

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL lnSuccess
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode
LOCAL lnId
LOCAL lcFirst_name
LOCAL lcLast_name
LOCAL lcEmail
LOCAL lcTelephone
LOCAL lcTimezone
LOCAL lnWeekly_capacity
LOCAL lnHas_access_to_all_future_projects
LOCAL lnIs_contractor
LOCAL lnIs_admin
LOCAL lnIs_project_manager
LOCAL lnCan_see_rates
LOCAL lnCan_create_projects
LOCAL lnCan_create_invoices
LOCAL lnIs_active
LOCAL lcCreated_at
LOCAL lcUpdated_at
LOCAL lcDefault_hourly_rate
LOCAL lcCost_rate
LOCAL lcAvatar_url
LOCAL i
LOCAL lnCount_i
LOCAL lcStrVal

* 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')

loHttp.SetRequestHeader("User-Agent","Harvest API Example")
loHttp.SetRequestHeader("Harvest-Account-ID","ACCOUNT_ID")
loHttp.SetRequestHeader("Authorization","Bearer ACCESS_TOKEN")

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponseBody = CreateObject('Chilkat.StringBuilder')
lnSuccess = loHttp.QuickGetSb("https://api.harvestapp.com/api/v2/users/me.json",loSbResponseBody)
IF (lnSuccess <> 1) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    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.LastResponseHeader
    RELEASE loHttp
    RELEASE loSbResponseBody
    RELEASE loJResp
    CANCEL
ENDIF

* Sample JSON response:

* {
*   "id": 2826142,
*   "first_name": "Joe",
*   "last_name": "Johnson",
*   "email": "joe@example.com",
*   "telephone": "",
*   "timezone": "Central Time (US & Canada)",
*   "weekly_capacity": 126000,
*   "has_access_to_all_future_projects": false,
*   "is_contractor": false,
*   "is_admin": true,
*   "is_project_manager": false,
*   "can_see_rates": true,
*   "can_create_projects": true,
*   "can_create_invoices": true,
*   "is_active": true,
*   "created_at": "2019-06-06T15:57:58Z",
*   "updated_at": "2019-06-06T15:58:32Z",
*   "default_hourly_rate": 175.0,
*   "cost_rate": 60.0,
*   "roles": [
*     "role1",
*     "role2"
*   ],
*   "avatar_url": "https://d3s3969qhosaug.cloudfront.net/default-avatars/4d46.png?1559836678"
* }

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

lnId = loJResp.IntOf("id")
lcFirst_name = loJResp.StringOf("first_name")
lcLast_name = loJResp.StringOf("last_name")
lcEmail = loJResp.StringOf("email")
lcTelephone = loJResp.StringOf("telephone")
lcTimezone = loJResp.StringOf("timezone")
lnWeekly_capacity = loJResp.IntOf("weekly_capacity")
lnHas_access_to_all_future_projects = loJResp.BoolOf("has_access_to_all_future_projects")
lnIs_contractor = loJResp.BoolOf("is_contractor")
lnIs_admin = loJResp.BoolOf("is_admin")
lnIs_project_manager = loJResp.BoolOf("is_project_manager")
lnCan_see_rates = loJResp.BoolOf("can_see_rates")
lnCan_create_projects = loJResp.BoolOf("can_create_projects")
lnCan_create_invoices = loJResp.BoolOf("can_create_invoices")
lnIs_active = loJResp.BoolOf("is_active")
lcCreated_at = loJResp.StringOf("created_at")
lcUpdated_at = loJResp.StringOf("updated_at")
lcDefault_hourly_rate = loJResp.StringOf("default_hourly_rate")
lcCost_rate = loJResp.StringOf("cost_rate")
lcAvatar_url = loJResp.StringOf("avatar_url")
i = 0
lnCount_i = loJResp.SizeOfArray("roles")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcStrVal = loJResp.StringOf("roles[i]")
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loSbResponseBody
RELEASE loJResp


 

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