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

 

 

 

(PowerBuilder) Google People API - List the User's Contacts

Gets a list of people in the user's contacts.

For more information, see https://developers.google.com/people/v1/contacts

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
oleobject loo_JsonToken
integer li_Success
oleobject loo_Http
oleobject loo_SbResponseBody
oleobject loo_Json
string ls_ResourceName
string ls_Etag
integer j
integer li_Count_j
integer li_MetadataPrimary
string ls_MetadataSourceType
string ls_MetadataSourceId
string ls_DisplayName
string ls_FamilyName
string ls_GivenName
string ls_DisplayNameLastFirst
string ls_UnstructuredName
string ls_Value
string ls_FormattedValue
string ls_StreetAddress
string ls_City
string ls_Region
string ls_PostalCode
string ls_Country
string ls_CountryCode
integer li_TotalPeople
integer li_TotalItems
integer i
integer li_Count_i

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

// It is assumed we previously obtained an OAuth2 access token.
// This example loads the JSON access token file 

// originally obtained by this example: Get Google People API OAuth2 Access Token
// or refreshed by this example: Refresh Google People API OAuth2 Access Token

loo_JsonToken = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JsonToken.ConnectToNewObject("Chilkat.JsonObject")
if li_rc < 0 then
    destroy loo_JsonToken
    MessageBox("Error","Connecting to COM object failed")
    return
end if
li_Success = loo_JsonToken.LoadFile("qa_data/tokens/googlePeople.json")
if li_Success <> 1 then
    Write-Debug "Failed to load googleContacts.json"
    destroy loo_JsonToken
    return
end if

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")

loo_Http.AuthToken = loo_JsonToken.StringOf("access_token")

loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

li_Success = loo_Http.QuickGetSb("https://people.googleapis.com/v1/people/me/connections?personFields=names,addresses,emailAddresses",loo_SbResponseBody)
if li_Success = 0 then
    Write-Debug loo_Http.LastErrorText
    Write-Debug loo_SbResponseBody.GetAsString()
    destroy loo_JsonToken
    destroy loo_Http
    destroy loo_SbResponseBody
    return
end if

// Sample JSON Response

// Use this online tool to generate parsing code from sample JSON: 
// Generate Parsing Code from JSON

// {
//   "connections": [
//     {
//       "resourceName": "people/c8871101035606120608",
//       "etag": "%EgkBAj0JQhBANy4aBAECBQciDERLSGdVTFNPbzNJPQ==",
//       "names": [
//         {
//           "metadata": {
//             "primary": true,
//             "source": {
//               "type": "CONTACT",
//               "id": "7b1c7b6409e718a0"
//             }
//           },
//           "displayName": "Chilkat Cloud",
//           "familyName": "Cloud",
//           "givenName": "Chilkat",
//           "displayNameLastFirst": "Cloud, Chilkat",
//           "unstructuredName": "Chilkat Cloud"
//         }
//       ],
//       "emailAddresses": [
//         {
//           "metadata": {
//             "primary": true,
//             "source": {
//               "type": "CONTACT",
//               "id": "7b1c7b6409e718a0"
//             }
//           },
//           "value": "support@***.com"
//         }
//       ]
//     },
//     {
//       "resourceName": "people/c7607335470312011517",
//       "etag": "%EgkBAj0JQhBANy4aBAECBQciDGZETUtHVTVMazI4PQ==",
//       "names": [
//         {
//           "metadata": {
//             "primary": true,
//             "source": {
//               "type": "CONTACT",
//               "id": "6992af4e0b2d36fd"
//             }
//           },
//           "displayName": "Matt Smith",
//           "familyName": "Smith",
//           "givenName": "Matt",
//           "displayNameLastFirst": "Smith, Matt",
//           "unstructuredName": "Matt Smith"
//         }
//       ],
//       "addresses": [
//         {
//           "metadata": {
//             "primary": true,
//             "source": {
//               "type": "CONTACT",
//               "id": "6992af4e0b2d36fd"
//             }
//           },
//           "formattedValue": "2222 E Foorest Ave\nWheaton, IL 60999\nUS",
//           "streetAddress": "2222 E Foorest Ave",
//           "city": "Wheaton",
//           "region": "IL",
//           "postalCode": "60999",
//           "country": "US",
//           "countryCode": "US"
//         }
//       ],
//       "emailAddresses": [
//         {
//           "metadata": {
//             "primary": true,
//             "source": {
//               "type": "CONTACT",
//               "id": "6992af4e0b2d36fd"
//             }
//           },
//           "value": "matt@***.com"
//         },
//         {
//           "metadata": {
//             "source": {
//               "type": "CONTACT",
//               "id": "6992af4e0b2d36fd"
//             }
//           },
//           "value": "admin@***.com"
//         }
//       ]
//     }
//   ],
//   "totalPeople": 2,
//   "totalItems": 2
// }

loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")

loo_Json.EmitCompact = 0
loo_Json.Load(loo_SbResponseBody.GetAsString())
Write-Debug loo_Json.Emit()

li_TotalPeople = loo_Json.IntOf("totalPeople")
li_TotalItems = loo_Json.IntOf("totalItems")
i = 0
li_Count_i = loo_Json.SizeOfArray("connections")
do while i < li_Count_i
    loo_Json.I = i
    ls_ResourceName = loo_Json.StringOf("connections[i].resourceName")
    ls_Etag = loo_Json.StringOf("connections[i].etag")
    j = 0
    li_Count_j = loo_Json.SizeOfArray("connections[i].names")
    do while j < li_Count_j
        loo_Json.J = j
        li_MetadataPrimary = loo_Json.BoolOf("connections[i].names[j].metadata.primary")
        ls_MetadataSourceType = loo_Json.StringOf("connections[i].names[j].metadata.source.type")
        ls_MetadataSourceId = loo_Json.StringOf("connections[i].names[j].metadata.source.id")
        ls_DisplayName = loo_Json.StringOf("connections[i].names[j].displayName")
        ls_FamilyName = loo_Json.StringOf("connections[i].names[j].familyName")
        ls_GivenName = loo_Json.StringOf("connections[i].names[j].givenName")
        ls_DisplayNameLastFirst = loo_Json.StringOf("connections[i].names[j].displayNameLastFirst")
        ls_UnstructuredName = loo_Json.StringOf("connections[i].names[j].unstructuredName")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_Json.SizeOfArray("connections[i].emailAddresses")
    do while j < li_Count_j
        loo_Json.J = j
        li_MetadataPrimary = loo_Json.BoolOf("connections[i].emailAddresses[j].metadata.primary")
        ls_MetadataSourceType = loo_Json.StringOf("connections[i].emailAddresses[j].metadata.source.type")
        ls_MetadataSourceId = loo_Json.StringOf("connections[i].emailAddresses[j].metadata.source.id")
        ls_Value = loo_Json.StringOf("connections[i].emailAddresses[j].value")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_Json.SizeOfArray("connections[i].addresses")
    do while j < li_Count_j
        loo_Json.J = j
        li_MetadataPrimary = loo_Json.BoolOf("connections[i].addresses[j].metadata.primary")
        ls_MetadataSourceType = loo_Json.StringOf("connections[i].addresses[j].metadata.source.type")
        ls_MetadataSourceId = loo_Json.StringOf("connections[i].addresses[j].metadata.source.id")
        ls_FormattedValue = loo_Json.StringOf("connections[i].addresses[j].formattedValue")
        ls_StreetAddress = loo_Json.StringOf("connections[i].addresses[j].streetAddress")
        ls_City = loo_Json.StringOf("connections[i].addresses[j].city")
        ls_Region = loo_Json.StringOf("connections[i].addresses[j].region")
        ls_PostalCode = loo_Json.StringOf("connections[i].addresses[j].postalCode")
        ls_Country = loo_Json.StringOf("connections[i].addresses[j].country")
        ls_CountryCode = loo_Json.StringOf("connections[i].addresses[j].countryCode")
        j = j + 1
    loop
    i = i + 1
loop


destroy loo_JsonToken
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_Json

 

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