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

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

 

 

 

(Xojo Plugin) 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 Xojo Plugin Download

Xojo Plugin for Windows, Linux, Mac OS X, and ARM, ARM64

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

Dim jsonToken As New Chilkat.JsonObject
Dim success As Boolean
success = jsonToken.LoadFile("qa_data/tokens/googlePeople.json")
If (success <> True) Then
    System.DebugLog("Failed to load googleContacts.json")
    Return
End If

Dim http As New Chilkat.Http

http.AuthToken = jsonToken.StringOf("access_token")

Dim sbResponseBody As New Chilkat.StringBuilder
success = http.QuickGetSb("https://people.googleapis.com/v1/people/me/connections?personFields=names,addresses,emailAddresses",sbResponseBody)
If (success = False) Then
    System.DebugLog(http.LastErrorText)
    System.DebugLog(sbResponseBody.GetAsString())
    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
// }

Dim json As New Chilkat.JsonObject
json.EmitCompact = False
success = json.Load(sbResponseBody.GetAsString())
System.DebugLog(json.Emit())

Dim resourceName As String
Dim etag As String
Dim j As Int32
Dim count_j As Int32
Dim metadataPrimary As Boolean
Dim metadataSourceType As String
Dim metadataSourceId As String
Dim displayName As String
Dim familyName As String
Dim givenName As String
Dim displayNameLastFirst As String
Dim unstructuredName As String
Dim value As String
Dim formattedValue As String
Dim streetAddress As String
Dim city As String
Dim region As String
Dim postalCode As String
Dim country As String
Dim countryCode As String

Dim totalPeople As Int32
totalPeople = json.IntOf("totalPeople")
Dim totalItems As Int32
totalItems = json.IntOf("totalItems")
Dim i As Int32
i = 0
Dim count_i As Int32
count_i = json.SizeOfArray("connections")
While i < count_i
    json.I = i
    resourceName = json.StringOf("connections[i].resourceName")
    etag = json.StringOf("connections[i].etag")
    j = 0
    count_j = json.SizeOfArray("connections[i].names")
    While j < count_j
        json.J = j
        metadataPrimary = json.BoolOf("connections[i].names[j].metadata.primary")
        metadataSourceType = json.StringOf("connections[i].names[j].metadata.source.type")
        metadataSourceId = json.StringOf("connections[i].names[j].metadata.source.id")
        displayName = json.StringOf("connections[i].names[j].displayName")
        familyName = json.StringOf("connections[i].names[j].familyName")
        givenName = json.StringOf("connections[i].names[j].givenName")
        displayNameLastFirst = json.StringOf("connections[i].names[j].displayNameLastFirst")
        unstructuredName = json.StringOf("connections[i].names[j].unstructuredName")
        j = j + 1
    Wend
    j = 0
    count_j = json.SizeOfArray("connections[i].emailAddresses")
    While j < count_j
        json.J = j
        metadataPrimary = json.BoolOf("connections[i].emailAddresses[j].metadata.primary")
        metadataSourceType = json.StringOf("connections[i].emailAddresses[j].metadata.source.type")
        metadataSourceId = json.StringOf("connections[i].emailAddresses[j].metadata.source.id")
        value = json.StringOf("connections[i].emailAddresses[j].value")
        j = j + 1
    Wend
    j = 0
    count_j = json.SizeOfArray("connections[i].addresses")
    While j < count_j
        json.J = j
        metadataPrimary = json.BoolOf("connections[i].addresses[j].metadata.primary")
        metadataSourceType = json.StringOf("connections[i].addresses[j].metadata.source.type")
        metadataSourceId = json.StringOf("connections[i].addresses[j].metadata.source.id")
        formattedValue = json.StringOf("connections[i].addresses[j].formattedValue")
        streetAddress = json.StringOf("connections[i].addresses[j].streetAddress")
        city = json.StringOf("connections[i].addresses[j].city")
        region = json.StringOf("connections[i].addresses[j].region")
        postalCode = json.StringOf("connections[i].addresses[j].postalCode")
        country = json.StringOf("connections[i].addresses[j].country")
        countryCode = json.StringOf("connections[i].addresses[j].countryCode")
        j = j + 1
    Wend
    i = i + 1
Wend

 

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