![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Datev - Get a List of ClientsSee more Datev ExamplesDemonstrates 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
$oHttp = ObjCreate("Chilkat.Http") Local $bSuccess ; 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 $oQueryParams = ObjCreate("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. $oHttp.AuthToken = "REPLACE_BEARER_TOKEN" $oHttp.SetRequestHeader "accept","application/json;charset=utf-8" $oHttp.SetRequestHeader "X-Datev-Client-ID","DATEV_CLIENT_ID" Local $oResp = $oHttp.QuickRequestParams("GET","https://accounting-clients.api.datev.de/platform-sandbox/v2/clients",$oQueryParams) If ($oHttp.LastMethodSuccess = False) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf ConsoleWrite($oResp.StatusCode & @CRLF) ConsoleWrite($oResp.BodyStr & @CRLF) $oJarr = ObjCreate("Chilkat.JsonArray") ; Insert code here to load the above JSON array into the jarr object. $oJarr.Load($oResp.BodyStr) Local $oJson Local $iClient_number Local $iConsultant_number Local $sId Local $sName Local $iJ Local $iCount_j Local $iK Local $iCount_k Local $strVal Local $i = 0 Local $iCount_i = $oJarr.Size While $i < $iCount_i $oJson = $oJarr.ObjectAt($i) $iClient_number = $oJson.IntOf("client_number") $iConsultant_number = $oJson.IntOf("consultant_number") $sId = $oJson.StringOf("id") $sName = $oJson.StringOf("name") $iJ = 0 $iCount_j = $oJson.SizeOfArray("services") While $iJ < $iCount_j $oJson.J = $iJ $sName = $oJson.StringOf("services[j].name") $iK = 0 $iCount_k = $oJson.SizeOfArray("services[j].scopes") While $iK < $iCount_k $oJson.K = $iK $strVal = $oJson.StringOf("services[j].scopes[k]") $iK = $iK + 1 Wend $iJ = $iJ + 1 Wend $i = $i + 1 Wend |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.