Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Tcl) Bitfinex v2 REST User InfoRetrieve the user ID, email, username and timezone setting for the account associated with the API key used. For more information, see https://docs.bitfinex.com/reference#rest-auth-info-user
load ./chilkat.dll # This example assumes the Chilkat API to have been previously unlocked. # See Global Unlock Sample for sample code. set http [new_CkHttp] # Implements the following CURL command: # curl -X POST -H "bfx-nonce: nonce" \ # -H "bfx-apikey: apiKey" \ # -H "bfx-signature: sig" \ # https://api.bitfinex.com/v2/auth/r/info/user # Use the following online tool to generate HTTP code from a CURL command # Convert a cURL Command to HTTP Source Code set crypt [new_CkCrypt2] set apiPath "v2/auth/r/info/user" set apiKey "MY_API_KEY" set apiSecret "MY_API_SECRET" set dt [new_CkDateTime] CkDateTime_SetFromCurrentSystemTime $dt set sbNonce [new_CkStringBuilder] CkStringBuilder_Append $sbNonce [CkDateTime_getAsUnixTimeStr $dt 0] CkStringBuilder_Append $sbNonce "000" set nonce [CkStringBuilder_getAsString $sbNonce] # This particular request has an empty body. set body "" set sbSignature [new_CkStringBuilder] CkStringBuilder_Append $sbSignature "/api/" CkStringBuilder_Append $sbSignature $apiPath CkStringBuilder_Append $sbSignature $nonce CkStringBuilder_Append $sbSignature $body CkCrypt2_put_EncodingMode $crypt "hex_lower" CkCrypt2_put_HashAlgorithm $crypt "sha384" CkCrypt2_put_MacAlgorithm $crypt "hmac" CkCrypt2_SetMacKeyString $crypt $apiSecret set sig [CkCrypt2_macStringENC $crypt [CkStringBuilder_getAsString $sbSignature]] CkHttp_SetRequestHeader $http "bfx-apikey" $apiKey CkHttp_SetRequestHeader $http "bfx-signature" $sig CkHttp_SetRequestHeader $http "bfx-nonce" $nonce # resp is a CkHttpResponse set resp [CkHttp_QuickRequest $http "POST" "https://api.bitfinex.com/v2/auth/r/info/user"] if {[CkHttp_get_LastMethodSuccess $http] == 0} then { puts [CkHttp_lastErrorText $http] delete_CkHttp $http delete_CkCrypt2 $crypt delete_CkDateTime $dt delete_CkStringBuilder $sbNonce delete_CkStringBuilder $sbSignature exit } puts "Response body:" puts [CkHttpResponse_bodyStr $resp] # Sample response body: # [1234567,"joe@example.com","joe_trader",1527691729000,0,null,null,"Central Time (US & Canada)"] delete_CkHttp $http delete_CkCrypt2 $crypt delete_CkDateTime $dt delete_CkStringBuilder $sbNonce delete_CkStringBuilder $sbSignature |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.