Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

PowerBuilder 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
Cert Store
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
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
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
X
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(PowerBuilder) Datev - Get a List of Clients

See more Datev Examples
Demonstrates how to get a list of clients in the accounting:clients Datev API.

Note: This example requires Chilkat v10.1.3 or greater.

For more information, see https://developer.datev.de/en/product-detail/accounting-clients/2.0/reference/reference-api-overview/accountingclients/clients-get

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
oleobject loo_Jarr
oleobject loo_Json
integer li_Client_number
integer li_Consultant_number
string ls_Id
string ls_Name
integer j
integer li_Count_j
integer k
integer li_Count_k
string ls_StrVal
integer i
integer li_Count_i

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Implements the following CURL command:

// curl --request GET \
//   --url "https://accounting-clients.api.datev.de/platform/v2/clients?filter=REPLACE_THIS_VALUE&skip=REPLACE_THIS_VALUE&top=REPLACE_THIS_VALUE" \
//   --header "Authorization: Bearer REPLACE_BEARER_TOKEN" \
//   --header "X-Datev-Client-ID: clientId" \
//   --header "accept: application/json;charset=utf-8"

// Use the following online tool to generate HTTP code from a CURL command
// Convert a cURL Command to HTTP Source Code

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

// ignore = queryParams.UpdateString("filter","REPLACE_THIS_VALUE");
// ignore = queryParams.UpdateString("skip","REPLACE_THIS_VALUE");
// ignore = queryParams.UpdateString("top","REPLACE_THIS_VALUE");

// Adds the "Authorization: Bearer REPLACE_BEARER_TOKEN" header.
loo_Http.AuthToken = "REPLACE_BEARER_TOKEN"
loo_Http.SetRequestHeader("accept","application/json;charset=utf-8")
loo_Http.SetRequestHeader("X-Datev-Client-ID","DATEV_CLIENT_ID")

loo_Resp = loo_Http.QuickRequestParams("GET","https://accounting-clients.api.datev.de/platform-sandbox/v2/clients",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_QueryParams
    return
end if

Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr

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

// Insert code here to load the above JSON array into the jarr object.
loo_Jarr.Load(loo_Resp.BodyStr)
destroy loo_Resp

i = 0
li_Count_i = loo_Jarr.Size
do while i < li_Count_i
    loo_Json = loo_Jarr.ObjectAt(i)
    li_Client_number = loo_Json.IntOf("client_number")
    li_Consultant_number = loo_Json.IntOf("consultant_number")
    ls_Id = loo_Json.StringOf("id")
    ls_Name = loo_Json.StringOf("name")
    j = 0
    li_Count_j = loo_Json.SizeOfArray("services")
    do while j < li_Count_j
        loo_Json.J = j
        ls_Name = loo_Json.StringOf("services[j].name")
        k = 0
        li_Count_k = loo_Json.SizeOfArray("services[j].scopes")
        do while k < li_Count_k
            loo_Json.K = k
            ls_StrVal = loo_Json.StringOf("services[j].scopes[k]")
            k = k + 1
        loop
        j = j + 1
    loop
    destroy loo_Json
    i = i + 1
loop


destroy loo_Http
destroy loo_QueryParams
destroy loo_Jarr

 

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