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

AutoIt Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(AutoIt) Outlook List Contacts

See more Outlook Contact Examples

List Outlook Contacts

For more information, see https://docs.microsoft.com/en-us/graph/api/user-list-contacts?view=graph-rest-1.0&tabs=http

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

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

$oHttp = ObjCreate("Chilkat.Http")

; Use your previously obtained access token here: Get Outlook Contacts OAuth2 Access Token (Azure AD v2.0 Endpoint).

$oJsonToken = ObjCreate("Chilkat.JsonObject")
Local $bSuccess = $oJsonToken.LoadFile("qa_data/tokens/outlookContacts.json")
If ($bSuccess = False) Then
    ConsoleWrite($oJsonToken.LastErrorText & @CRLF)
    Exit
EndIf

$oHttp.AuthToken = $oJsonToken.StringOf("access_token")

; Send the following GET:

; GET https://graph.microsoft.com/v1.0/me/contacts
$oSbJson = ObjCreate("Chilkat.StringBuilder")
$bSuccess = $oHttp.QuickGetSb("https://graph.microsoft.com/v1.0/me/contacts",$oSbJson)
If ($bSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

Local $iStatusCode = $oHttp.LastStatus
ConsoleWrite("Response status code = " & $iStatusCode & @CRLF)

If ($iStatusCode <> 200) Then
    ConsoleWrite($oSbJson.GetAsString() & @CRLF)
    ConsoleWrite("Failed." & @CRLF)
    Exit
EndIf

$oJResp = ObjCreate("Chilkat.JsonObject")
$oJResp.LoadSb($oSbJson)
$oJResp.EmitCompact = False
ConsoleWrite($oJResp.Emit() & @CRLF)

; Sample output:

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

; {
;   "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('4ee732c3-322e-4a6b-b729-2fd1eb5c6004')/contacts",
;   "value": [
;     {
;       "@odata.etag": "W/\"EQAAABYAAABUcG0qWqkmQYqWLHQataQxAAD0iYfT\"",
;       "id": "AAMkADYzZWE3YmZmLWU0YzgtNGNkZC04MGE1LWFiYTFlNTRlY2QwYQBGAAAAAAAu7cUXL5YOTrdsUIw7-v8FBwBUcG0qWqkmQYqWLHQataQxAAAAAAEOAABUcG0qWqkmQYqWLHQataQxAAD0sxexAAA=",
;       "createdDateTime": "2021-06-29T16:32:05Z",
;       "lastModifiedDateTime": "2021-06-29T16:32:06Z",
;       "changeKey": "EQAAABYAAABUcG0qWqkmQYqWLHQataQxAAD0iYfT",
;       "categories": [
;       ],
;       "parentFolderId": "AAMkADYzZWE3YmZmLWU0YzgtNGNkZC04MGE1LWFiYTFlNTRlY2QwYQAuAAAAAAAu7cUXL5YOTrdsUIw7-v8FAQBUcG0qWqkmQYqWLHQataQxAAAAAAEOAAA=",
;       "birthday": null,
;       "fileAs": "",
;       "displayName": "Pavel Bansky",
;       "givenName": "Pavel",
;       "initials": null,
;       "middleName": null,
;       "nickName": null,
;       "surname": "Bansky",
;       "title": null,
;       "yomiGivenName": null,
;       "yomiSurname": null,
;       "yomiCompanyName": null,
;       "generation": null,
;       "imAddresses": [
;       ],
;       "jobTitle": null,
;       "companyName": null,
;       "department": null,
;       "officeLocation": null,
;       "profession": null,
;       "businessHomePage": null,
;       "assistantName": null,
;       "manager": null,
;       "homePhones": [
;       ],
;       "mobilePhone": null,
;       "businessPhones": [
;         "+1 732 555 0102"
;       ],
;       "spouseName": null,
;       "personalNotes": "",
;       "children": [
;       ],
;       "emailAddresses": [
;         {
;           "name": "Pavel Bansky",
;           "address": "pavelb@fabrikam.onmicrosoft.com"
;         }
;       ],
;       "homeAddress": {},
;       "businessAddress": {},
;       "otherAddress": {}
;     },
; ...
;   ]
; }

Local $sOdata_etag
Local $sId
Local $sCreatedDateTime
Local $sLastModifiedDateTime
Local $sChangeKey
Local $sParentFolderId
Local $sBirthday
Local $sFileAs
Local $sDisplayName
Local $sGivenName
Local $sInitials
Local $sMiddleName
Local $sNickName
Local $surname
Local $sTitle
Local $sYomiGivenName
Local $sYomiSurname
Local $sYomiCompanyName
Local $sGeneration
Local $sJobTitle
Local $sCompanyName
Local $sDepartment
Local $sOfficeLocation
Local $sProfession
Local $sBusinessHomePage
Local $sAssistantName
Local $sManager
Local $sMobilePhone
Local $spouseName
Local $sPersonalNotes
Local $iJ
Local $iCount_j
Local $strVal
Local $sName
Local $sAddress

Local $sOdata_context = $oJResp.StringOf("""@odata.context""")
Local $i = 0
Local $iCount_i = $oJResp.SizeOfArray("value")
While $i < $iCount_i
    $oJResp.I = $i
    $sOdata_etag = $oJResp.StringOf("value[i].""@odata.etag""")
    $sId = $oJResp.StringOf("value[i].id")
    $sCreatedDateTime = $oJResp.StringOf("value[i].createdDateTime")
    $sLastModifiedDateTime = $oJResp.StringOf("value[i].lastModifiedDateTime")
    $sChangeKey = $oJResp.StringOf("value[i].changeKey")
    $sParentFolderId = $oJResp.StringOf("value[i].parentFolderId")
    $sBirthday = $oJResp.StringOf("value[i].birthday")
    $sFileAs = $oJResp.StringOf("value[i].fileAs")
    $sDisplayName = $oJResp.StringOf("value[i].displayName")
    $sGivenName = $oJResp.StringOf("value[i].givenName")
    $sInitials = $oJResp.StringOf("value[i].initials")
    $sMiddleName = $oJResp.StringOf("value[i].middleName")
    $sNickName = $oJResp.StringOf("value[i].nickName")
    $surname = $oJResp.StringOf("value[i].surname")
    $sTitle = $oJResp.StringOf("value[i].title")
    $sYomiGivenName = $oJResp.StringOf("value[i].yomiGivenName")
    $sYomiSurname = $oJResp.StringOf("value[i].yomiSurname")
    $sYomiCompanyName = $oJResp.StringOf("value[i].yomiCompanyName")
    $sGeneration = $oJResp.StringOf("value[i].generation")
    $sJobTitle = $oJResp.StringOf("value[i].jobTitle")
    $sCompanyName = $oJResp.StringOf("value[i].companyName")
    $sDepartment = $oJResp.StringOf("value[i].department")
    $sOfficeLocation = $oJResp.StringOf("value[i].officeLocation")
    $sProfession = $oJResp.StringOf("value[i].profession")
    $sBusinessHomePage = $oJResp.StringOf("value[i].businessHomePage")
    $sAssistantName = $oJResp.StringOf("value[i].assistantName")
    $sManager = $oJResp.StringOf("value[i].manager")
    $sMobilePhone = $oJResp.StringOf("value[i].mobilePhone")
    $spouseName = $oJResp.StringOf("value[i].spouseName")
    $sPersonalNotes = $oJResp.StringOf("value[i].personalNotes")
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("value[i].categories")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("value[i].imAddresses")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("value[i].homePhones")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("value[i].businessPhones")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $strVal = $oJResp.StringOf("value[i].businessPhones[j]")
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("value[i].children")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("value[i].emailAddresses")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $sName = $oJResp.StringOf("value[i].emailAddresses[j].name")
        $sAddress = $oJResp.StringOf("value[i].emailAddresses[j].address")
        $iJ = $iJ + 1
    Wend
    $i = $i + 1
Wend

 

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