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

PowerBuilder Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Bitfinex v2 REST
Bluzone
BrickLink
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Etsy
Facebook
Faire
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
Mastercard

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

 

 

 

(PowerBuilder) 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

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
integer li_Id
string ls_First_name
string ls_Last_name
string ls_Email
string ls_Telephone
string ls_Timezone
integer li_Weekly_capacity
integer li_Has_access_to_all_future_projects
integer li_Is_contractor
integer li_Is_admin
integer li_Is_project_manager
integer li_Can_see_rates
integer li_Can_create_projects
integer li_Can_create_invoices
integer li_Is_active
string ls_Created_at
string ls_Updated_at
string ls_Default_hourly_rate
string ls_Cost_rate
string ls_Avatar_url
integer i
integer li_Count_i
string ls_StrVal

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

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

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

loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")

li_Success = loo_Http.QuickGetSb("https://api.harvestapp.com/api/v2/users/me.json",loo_SbResponseBody)
if li_Success <> 1 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_SbResponseBody
    return
end if

loo_JResp = create oleobject
li_rc = loo_JResp.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()

li_RespStatusCode = loo_Http.LastStatus
Write-Debug "Response Status Code = " + string(li_RespStatusCode)

if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Http.LastResponseHeader
    destroy loo_Http
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

// 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

li_Id = loo_JResp.IntOf("id")
ls_First_name = loo_JResp.StringOf("first_name")
ls_Last_name = loo_JResp.StringOf("last_name")
ls_Email = loo_JResp.StringOf("email")
ls_Telephone = loo_JResp.StringOf("telephone")
ls_Timezone = loo_JResp.StringOf("timezone")
li_Weekly_capacity = loo_JResp.IntOf("weekly_capacity")
li_Has_access_to_all_future_projects = loo_JResp.BoolOf("has_access_to_all_future_projects")
li_Is_contractor = loo_JResp.BoolOf("is_contractor")
li_Is_admin = loo_JResp.BoolOf("is_admin")
li_Is_project_manager = loo_JResp.BoolOf("is_project_manager")
li_Can_see_rates = loo_JResp.BoolOf("can_see_rates")
li_Can_create_projects = loo_JResp.BoolOf("can_create_projects")
li_Can_create_invoices = loo_JResp.BoolOf("can_create_invoices")
li_Is_active = loo_JResp.BoolOf("is_active")
ls_Created_at = loo_JResp.StringOf("created_at")
ls_Updated_at = loo_JResp.StringOf("updated_at")
ls_Default_hourly_rate = loo_JResp.StringOf("default_hourly_rate")
ls_Cost_rate = loo_JResp.StringOf("cost_rate")
ls_Avatar_url = loo_JResp.StringOf("avatar_url")
i = 0
li_Count_i = loo_JResp.SizeOfArray("roles")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("roles[i]")
    i = i + 1
loop


destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp

 

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