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
(PowerBuilder) 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
integer li_rc oleobject loo_Http integer li_Success oleobject loo_Crypt string ls_ApiPath string ls_ApiKey string ls_ApiSecret oleobject loo_Dt oleobject loo_SbNonce string ls_Nonce string ls_Body oleobject loo_SbSignature string ls_Sig oleobject loo_Resp // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. 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 -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 loo_Crypt = create oleobject // Use "Chilkat_9_5_0.Crypt2" for versions of Chilkat < 10.0.0 li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2") ls_ApiPath = "v2/auth/r/info/user" ls_ApiKey = "MY_API_KEY" ls_ApiSecret = "MY_API_SECRET" loo_Dt = create oleobject // Use "Chilkat_9_5_0.CkDateTime" for versions of Chilkat < 10.0.0 li_rc = loo_Dt.ConnectToNewObject("Chilkat.CkDateTime") loo_Dt.SetFromCurrentSystemTime() loo_SbNonce = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbNonce.ConnectToNewObject("Chilkat.StringBuilder") loo_SbNonce.Append(loo_Dt.GetAsUnixTimeStr(0)) loo_SbNonce.Append("000") ls_Nonce = loo_SbNonce.GetAsString() // This particular request has an empty body. ls_Body = "" loo_SbSignature = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbSignature.ConnectToNewObject("Chilkat.StringBuilder") loo_SbSignature.Append("/api/") loo_SbSignature.Append(ls_ApiPath) loo_SbSignature.Append(ls_Nonce) loo_SbSignature.Append(ls_Body) loo_Crypt.EncodingMode = "hex_lower" loo_Crypt.HashAlgorithm = "sha384" loo_Crypt.MacAlgorithm = "hmac" loo_Crypt.SetMacKeyString(ls_ApiSecret) ls_Sig = loo_Crypt.MacStringENC(loo_SbSignature.GetAsString()) loo_Http.SetRequestHeader("bfx-apikey",ls_ApiKey) loo_Http.SetRequestHeader("bfx-signature",ls_Sig) loo_Http.SetRequestHeader("bfx-nonce",ls_Nonce) loo_Resp = loo_Http.QuickRequest("POST","https://api.bitfinex.com/v2/auth/r/info/user") if loo_Http.LastMethodSuccess = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_Crypt destroy loo_Dt destroy loo_SbNonce destroy loo_SbSignature return end if Write-Debug "Response body:" Write-Debug loo_Resp.BodyStr // Sample response body: // [1234567,"joe@example.com","joe_trader",1527691729000,0,null,null,"Central Time (US & Canada)"] destroy loo_Http destroy loo_Crypt destroy loo_Dt destroy loo_SbNonce destroy loo_SbSignature |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.