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
(AutoIt) 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
; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oHttp = ObjCreate("Chilkat.Http") Local $bSuccess ; 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 $oCrypt = ObjCreate("Chilkat.Crypt2") Local $sApiPath = "v2/auth/r/info/user" Local $sApiKey = "MY_API_KEY" Local $sApiSecret = "MY_API_SECRET" $oDt = ObjCreate("Chilkat.CkDateTime") $oDt.SetFromCurrentSystemTime() $oSbNonce = ObjCreate("Chilkat.StringBuilder") $oSbNonce.Append($oDt.GetAsUnixTimeStr(False)) $oSbNonce.Append("000") Local $sNonce = $oSbNonce.GetAsString() ; This particular request has an empty body. Local $sBody = "" $oSbSignature = ObjCreate("Chilkat.StringBuilder") $oSbSignature.Append("/api/") $oSbSignature.Append($sApiPath) $oSbSignature.Append($sNonce) $oSbSignature.Append($sBody) $oCrypt.EncodingMode = "hex_lower" $oCrypt.HashAlgorithm = "sha384" $oCrypt.MacAlgorithm = "hmac" $oCrypt.SetMacKeyString($sApiSecret) Local $sig = $oCrypt.MacStringENC($oSbSignature.GetAsString()) $oHttp.SetRequestHeader "bfx-apikey",$sApiKey $oHttp.SetRequestHeader "bfx-signature",$sig $oHttp.SetRequestHeader "bfx-nonce",$sNonce Local $oResp = $oHttp.QuickRequest("POST","https://api.bitfinex.com/v2/auth/r/info/user") If ($oHttp.LastMethodSuccess = False) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf ConsoleWrite("Response body:" & @CRLF) ConsoleWrite($oResp.BodyStr & @CRLF) ; Sample response body: ; [1234567,"joe@example.com","joe_trader",1527691729000,0,null,null,"Central Time (US & Canada)"] |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.